Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        nmo          = transform.FindChild("SmallAlienMesh").GetComponent <NavMeshObstacle>();
        health       = gameObject.GetComponent <SmallAlienHealth>();
        AlienPhysics = gameObject.GetComponent <SmallAlienPhysicsManager>();
        ai           = gameObject.GetComponent <SmallAlienAI>();
        walkSpeed    = 1f;
        GameObject SmallAlienNavmeshAgent = (GameObject)Instantiate(SmallAlienNavmeshAgentPrefab, transform.position, transform.rotation);

        _SmallAlienAgent = SmallAlienNavmeshAgent.GetComponent <NavMeshAgent>();
        anims            = gameObject.GetComponent <Animator>();
        ToggleNavmeshAgent(true);

        target = GameObject.Find("PlayerSpawnLocation");
        startDistanceFromPlayer = Vector3.Distance(transform.position, target.transform.position);
        FindAttackPosition();

        // Added by Matt
        attackingPlayer = true;

        /*
         * //debug target
         * target = GameObject.Find("debugNavmeshtarget");
         * SetNavMeshAgentDestination(target.transform.position, true, target);
         */
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     currentHealth = health;
     ai            = gameObject.GetComponent <SmallAlienAI>();
     Physics       = gameObject.GetComponent <SmallAlienPhysicsManager>();
     anims         = gameObject.GetComponent <Animator>();
 }
 // Use this for initialization
 void Start()
 {
     currentHealth = health;
     ai            = gameObject.GetComponent <SmallAlienAI>();
     Physics       = gameObject.GetComponent <SmallAlienPhysicsManager>();
     anims         = gameObject.GetComponent <Animator>();
     Reticle       = GameObject.Find("Reticle").GetComponent <HitMarkerScript>();
 }