public virtual void respawn()
{
navagent.enabled = true;
if (fac == Types.Faction.BLUE)
{
navagent.Warp(GameSceneConsts.blue_team_respawn_pt.transform.position);
navagent.SetDestination(GameSceneConsts.blue_team_respawn_pt.transform.position);
AI_unit.holdedPos = GameSceneConsts.blue_team_respawn_pt.transform.position; //not sure if this is necessary
transform.position = navagent.transform.position;
}
else if (fac == Types.Faction.RED)
{
navagent.Warp(GameSceneConsts.red_team_respawn_pt.transform.position);
navagent.SetDestination(GameSceneConsts.red_team_respawn_pt.transform.position);
AI_unit.holdedPos = GameSceneConsts.red_team_respawn_pt.transform.position; //not sure if this is necessary
transform.position = navagent.transform.position;
}
gameObject.transform.rotation = Quaternion.identity;
//refill hp and mana
change_health(runtime_u_stats.max_hp);
runtime_u_stats.mana = runtime_u_stats.max_mana;
navagent.Resume();
flags.is_dead = false;
ui.refill();
gameObject.layer = GameSceneConsts.LAYER_DEFAULT;
}