// Use this for initialization public override void Start() { base.Start(); agent = GetComponent <NavMeshAgent>(); animator = GetComponent <Animator>(); groundMask = LayerMask.GetMask("Floor"); state = SURVIVORSTATE.NORMAL; currentHealth = 100.0f; if (healthSlider != null) { healthSlider.value = currentHealth; } weaponList = GetComponents <Weapon>(); foreach (Weapon w in weaponList) { w.enabled = true; w.DisableWeapon(); if (w.type == WEAPON_TYPE.PISTOL) { currentWeapon = w; currentWeapon.EnableWeapon(); } } }
// Use this for initialization public override void Start() { base.Start(); agent = GetComponent <NavMeshAgent> (); animator = GetComponentInChildren <Animator> (); groundMask = LayerMask.GetMask("Ground"); state = SURVIVORSTATE.NORMAL; GameManager.AddSurvivor(this); weaponList = GetComponentsInChildren <Weapon> (); foreach (Weapon w in weaponList) { w.enabled = false; if (w.type == WEAPON_TYPE.PISTOL) { currentWeapon = w; currentWeapon.enabled = true; } } }
protected override void Dead() { state = SURVIVORSTATE.DEAD; agent.isStopped = true; GameManager.RemoveSurvivor(this); }
protected override void Dead() { state = SURVIVORSTATE.DEAD; agent.isStopped = true; }