Example #1
0
    protected void Awake()
    {
        isOnCamera = GetComponent <IsOnCamera>();
        body       = GetComponent <Rigidbody>();
        animator   = gameObject.GetComponent <Animator>();
        collider   = GetComponent <Collider>();

        readyToMove = isMoving;
    }
Example #2
0
 /// <summary>
 /// Add target to camera
 /// </summary>
 public void AddTarget(IsOnCamera other)
 {
     // Check object is not already a target
     if (targetList.IndexOf(other) < 0)
     {
         freezeCamera = false;
         targetList.Add(other);
     }
 }
Example #3
0
 /// <summary>
 /// Remove target from target list
 /// </summary>
 public void RemoveTarget(IsOnCamera other)
 {
     for (int i = 0; i < targetList.Count; i++)
     {
         if (targetList[i].GetInstanceID() == other.GetInstanceID())
         {
             targetList.RemoveAt(i);
             return;
         }
     }
 }
Example #4
0
 protected void Awake()
 {
     bodyBullet = GetComponent <Rigidbody>();
     isOnCamera = GetComponent <IsOnCamera>();
 }
 private void Awake()
 {
     isOnCamera = GetComponent <IsOnCamera>();
 }