示例#1
0
    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);
    }
示例#2
0
    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);
    }