Пример #1
0
    private void OnEnterPartyPhase()
    {
        DebugScreen.Print(1, "Party starting");

        // VISUAL: display the START message on GUI layer (prefab also on GUI layer just in case)
        UIManager.Instance.ShowMessage("START");

        // AUDIO: play the in-game BGM
        MusicManager.Instance.Play();

        // After some time, enable the avatars to move
        CharacterManager.Instance.StartControlAllCharacters();
    }
Пример #2
0
    /* Warp the avatar out of the scene */

    /* alternatives:
     * a) Warp() is public, the warper calls Warp(), Warp() calls the Character Manager
     * b) Warp() is private, the warper sets the avatar's intention to warp, FixedUpdate() converts
     *      intention to action Warp(), Warp() calls the Character Manager
     * c) there is no Warp() here and the warper directly calls the Character Manager
     * chosen: a) (allows to add some extra such as StopMotion or some animation)
     */
    public void Warp()
    {
        DebugScreen.Print(0, "{0} warps.", this);

        control.StopControl();
        // motor.StopMotion();
        /* add some warping view here, should last around 1 second */
        // yield return new WaitForSeconds(1.0f);
        CharacterManager.Instance.DespawnCharacter(master.PlayerId);

        // if the last avatar has been removed, end the session
        if (CharacterManager.Instance.RemainingCharacterNb == 0)
        {
            SceneManager.LoadScene(Scenes.ScoreScreen);
            // SessionManager.Instance.Reset();
        }
    }