IEnumerator <WaitForSeconds> LateStart() { OnActivateFactory?.Invoke(this); yield return(new WaitForSeconds(1f)); var anim = GetComponent <Animator>(); anim.SetTrigger("Spawn"); yield return(new WaitForSeconds(0.6f)); robot = Instantiate(robotPrefab, transform); robot.SetSpawn(Tile); yield return(new WaitForSeconds(0.5f)); OnSpawnRobot?.Invoke(robot); }
IEnumerator <WaitForSeconds> Respawn() { yield return(new WaitForSeconds(1.5f)); robot.HideCorpse(); OnActivateFactory?.Invoke(this); yield return(new WaitForSeconds(0.5f)); var anim = GetComponent <Animator>(); anim.SetTrigger("Spawn"); yield return(new WaitForSeconds(.6f)); robot.Respawn(Tile); yield return(new WaitForSeconds(0.3f)); OnSpawnRobot?.Invoke(robot); }