// Use this for initialization void Start() { currentState = States.Navigating; _navMeshInterface = gameObject.GetComponent <AlienNavMeshInterface>(); _health = gameObject.GetComponent <SmallAlienHealth>(); anims = gameObject.GetComponent <Animator>(); }
// 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); */ }
// Use this for initialization void Start() { currentState = States.Navigating; _navMeshInterface = gameObject.GetComponent <AlienNavMeshInterface>(); _health = gameObject.GetComponent <SmallAlienHealth>(); anims = gameObject.GetComponent <Animator>(); SplashDamage = GameObject.Find("SplashDamage").GetComponent <SplashDamageScript>(); }
// Use this for initialization void Start() { rb = gameObject.GetComponent <Rigidbody>(); anims = gameObject.GetComponent <Animator>(); ai = gameObject.GetComponent <SmallAlienAI>(); health = gameObject.GetComponent <SmallAlienHealth>(); nav = gameObject.GetComponent <AlienNavMeshInterface>(); mesh = gameObject.transform.FindChild("SmallAlienMesh").gameObject; startEmission = mesh.GetComponent <SkinnedMeshRenderer>().material.GetColor("_Emission"); startDrag = gameObject.GetComponent <Rigidbody>().drag; startY = transform.position.y; }