Пример #1
0
    //private FoxCollection foxCollection;


    private void Awake()
    {
        //canvas = FindObjectOfType<Canvas>();
        //cam = FindObjectOfType<Camera>();
        foxAI = GetComponent <FoxAI>();
        //foxCollection = FindObjectOfType<FoxCollection>();
    }
Пример #2
0
    void FixedUpdate()
    {
        Vector2 PlayerPos = Raccoon.transform.position;

        valX = PlayerPos.x - this.transform.position.x;
        valY = PlayerPos.y - this.transform.position.y;
        if (valY < 0 && valY >= -10)
        {
            if (valX >= -1 && valX <= 1)
            {
                if (gameObject.transform.parent != null)
                {
                    if (gameObject.transform.parent.gameObject.GetComponent <FoxAI> ().HasBomb == true)
                    {
                        RB.isKinematic = false;
                        gameObject.transform.parent.gameObject.GetComponent <FoxAI> ().HasBomb = false;
                        GameObject Fox = gameObject.transform.parent.gameObject;
                        Col.isTrigger = false;
                        FoxAI brain = Fox.GetComponent <FoxAI>();
                        brain.Invoke("Dead", 3);
                        gameObject.transform.parent = null;
                    }
                }
            }
        }
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     foxAIController = GetComponentInParent <FoxAI>();
 }
Пример #4
0
 private void Awake()
 {
     foxAI   = GetComponentInParent <FoxAI>();
     navMesh = GetComponent <NavMeshAgent>();
 }