Ejemplo n.º 1
0
 public static void OnEndGame(string code)
 {
     OnEndGameEvent.Invoke(null, new DiscordGameEventArgs()
     {
         LobbyCode = code,
     });
 }
Ejemplo 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();
        }
Ejemplo 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;
    }