Exemple #1
0
 public SplineAddress(SplineAddress copy)
 {
     if (copy != null && copy.depth != 0)
     {
         for (int i = 0; i < copy.elements.Length; i++)
         {
             AddElement(copy.elements[i]);
         }
     }
 }
 public SplineAddress(SplineAddress copy)
 {
     if (copy == null)
     {
         return;
     }
     if (copy.depth == 0)
     {
         return;
     }
     for (int i = 0; i < copy.elements.Length; i++)
     {
         AddElement(copy.elements[i]);
     }
 }
Exemple #3
0
 /// <summary>
 /// Used by the custom editor. DO NO CALL THIS METHOD IN YOUR RUNTIME CODE
 /// </summary>
 public virtual void EditorAwake()
 {
     //Create a new instance of the address. Otherwise it would be a reference
     _address = new SplineAddress(_address);
     if (sampleUser)
     {
         if (!user.IsSubscribed(this))
         {
             user.Subscribe(this);
         }
     }
     else
     {
         if (computer == null)
         {
             computer = GetComponent <SplineComputer>();
         }
         else if (!computer.IsSubscribed(this))
         {
             computer.Subscribe(this);
         }
     }
     RebuildImmediate(true);
 }