예제 #1
0
 // Use this for initialization
 private void Start()
 {
     if (ActivateObject != null)
     {
         AttachedObject = ActivateObject.GetComponent <IActivatableObject>();
     }
 }
예제 #2
0
 protected virtual void AddComponent(IActivatableObject obj)
 {
     if (children.Contains(obj))
     {
         Debug.Fail("Trying to add same component twice" + obj.ToString());
     }
     children.Add(obj);
 }
예제 #3
0
 protected virtual void RemoveComponent(IActivatableObject obj)
 {
     children.Remove(obj);
 }
예제 #4
0
 /// <summary>
 /// Add a component to this Canvas
 /// All added components have their Update() called by the framework
 /// during each frame. The call order is the addition order
 /// </summary>
 /// <remarks>
 /// Component can be added only once.
 /// </remarks>
 /// <param name="obj">Component to add</param>
 public virtual void AddComponent(IActivatableObject obj)
 {
     Debug.Assert(!children.Contains(obj), "Trying to add same component twice!");
     this.children.Add(obj);
 }