Beispiel #1
0
    public void Update()
    {
#if !UNITY_EDITOR
        if (!am_running && auto_run && Central.Instance.state == GameState.InGame)
        {
            RunMe();
            auto_run = false;
        }
#endif

        if (!am_running)
        {
            return;
        }
        if (Central.Instance.state != GameState.InGame)
        {
            if (current_player.fake_player != null)
            {
                current_player.fake_player.Stop();
            }
            return;
        }

        if (current_player_id >= fake_players.Count)
        {
            DumpLogs();
            am_running = false;
        }

        if (!am_running)
        {
            return;
        }

        if (current_player.fake_player.amDone())
        {
            current_player.fake_player.Stop();
            if (!incrementCurrentPlayerID())
            {
                return;
            }
            current_player = fake_players[current_player_id];
            Central.Instance.changeState(GameState.Loading, "LoadStartLevelSnapshot");
            return;
        }

        if (current_player.run_me && !current_player.fake_player.amRunning() && !current_player.fake_player.amDone())
        {
            setTimeOverride();
            current_player.fake_player.RunMe();
        }
    }
Beispiel #2
0
 public void RunMe()
 {
     current_player_id = 0;
     current_player    = fake_players[current_player_id];
     am_running        = true;
     if (fake_players[current_player_id].run_me)
     {
         setTimeOverride();
         current_player.fake_player.RunMe();
     }
     else
     {
         current_player.fake_player.GetComponent <FakePlayer>().setDone(true);
     }
 }