Esempio n. 1
0
 public static void OnEndGame(string code)
 {
     OnEndGameEvent.Invoke(null, new DiscordGameEventArgs()
     {
         LobbyCode = code,
     });
 }
Esempio n. 2
0
        /// <summary>
        /// Shows graph, clears events, sets time scale to 0
        /// </summary>
        public virtual void EndGame()
        {
            FindObjectOfType <AudioManager>().SetVolume("bg_game", 0f);

            OnEndGameEvent?.Invoke();

            ClearEvents();
        }
Esempio n. 3
0
    /// <summary>
    /// Sets the current state of the event to finished or waiting (if cyclical) and executes an On End function
    /// </summary>
    /// <param name="OnEndGameEventMethod">function to execute it has to be void return and have no arguments</param>
    public void EndGameEvent(OnEndGameEvent OnEndGameEventMethod)
    {
        m_currentState = EGameEventStates.FINISHED;

        if (!m_cyclicalEvent || !(m_cycles == 0 || m_currentCycleCounter < m_cycles))
        {
            OnEndGameEventMethod();
            return;
        }

        m_currentState         = EGameEventStates.WAITING;
        m_currentCycleCounter += 1;
    }