public void Respawn() { int id = Random.Range(0, gameManager.respawnPoints.Length); GetComponent <NavMeshAgent>().Warp(gameManager.respawnPoints[id].transform.position); bOT_Profile.isDead = false; currState = BOT_FStateMachineRespawn.Stop; }
// Use this for initialization void Start() { currState = BOT_FStateMachineRespawn.Stop; bOT_Profile = GetComponent <BOT_Profile>(); gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); mesh = transform.Find("Player_3PNew:Character_Unwrapped:Egor"); bOT_Manager = GetComponent <BOT_Manager>(); }
public void RespawnTimer() { curTimer -= Time.deltaTime; if (curTimer < 0) { currState = BOT_FStateMachineRespawn.Respawn; } }
public void Death() { mesh.gameObject.SetActive(false); bOT_Manager.currentStateAttack = BOT_Manager.BOT_FStateMachineAttack.Stop; bOT_Manager.currentStateWander = BOT_Manager.BOT_FStateMachineWander.Stop; GetComponent <NavMeshAgent>().Warp(gameObject.transform.position = new Vector3(99999, 99999, 99999)); curTimer = timer; currState = BOT_FStateMachineRespawn.RespawnTimer; bOT_Profile.isDead = true; }