// Use this for initialization void Start() { //set thisparent to be this collider's parent in the hierarchy; i.e. the object that contains the object with this script //thisParent = ; scriptThing = thisParent.GetComponentInParent <ScriptEnemyClass>(); eMove = GetComponentInParent <ScriptEnemyMovement>(); }
public GameObject onDeathObject; //spawn this on death //public NavMeshAgent navi; // Use this for initialization void Start() { eMove = GetComponent <ScriptEnemyMovement>(); detector = GetComponentInChildren <ScriptDetectionRadius>(); health = startingHealth; baseAttackRangeFloat = attackRange.radius; baseSightRangeFloat = sightRange.radius; AttackRangeFloat = baseAttackRangeFloat; SightRangeFloat = baseSightRangeFloat; if (Alertness == -1) //if alertness has not been set { Alertness = baseAlertness; } AlertnessApplication(Alertness); //if(navi != null) { //AgentAssignment(); //navi.velocity = Vector3.zero; //navi.Stop(); } }
// Use this for initialization void Start() { eMove = GetComponent <ScriptEnemyMovement>(); detector = GetComponentInChildren <ScriptDetectionRadius>(); health = startingHealth; }