Author Topic: Add an option to set targets with a transform list  (Read 163 times)

Christian Petry

  • Guest
Add an option to set targets with a transform list
« on: March 30, 2020, 12:52:45 AM »
Hello,

first of all: This is a great asset! I really like using this.

Still I had to adjust it to my very specific needs. I need to set specific transforms as targets.
This is my little addition:

Code
public void SetTargets(List<Transform> transforms)
{
     transforms = transforms.Where(x => x.gameObject.activeInHierarchy).ToList();

     if (transforms.All(targets.Contains) && transforms.Count == targets.Count)
         return;

     if (_highlighted)
         SetHighlighted(false);
   
     targets = transforms;
     SetupMaterial();
}

I would rather not touch 3rd party plugins. This prevents me from updating.
Can you add something similar?

Best regards
Christian Petry


Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5832
    • View Profile
Re: Add an option to set targets with a transform list
« Reply #1 on: May 31, 2020, 08:42:52 AM »
Latest version includes a SetTargets() method which can received a list of renderers.