Пример #1
0
    public void DoEvent()
    {
        //mPreviousStage = GameData.singleton.currentStage;
        //GameData.singleton.currentStage = GameStage.GS_EVENT; // pause the simulation
        EventState.currentEvent = this; // set self as the callback for the UI. This also signals to other systems that they may need to pause.

        mEventStatus = EventStart();    // derived classes override this to do whatever, including populating the UI
        Debug.Log("EVENT START " + EventState.currentEventText + " - " + mEventStatus.ToString());

        if (mEventStatus == EventResult.SKIP)
        {
            // the event decided not to fire at all for whatever reason
            SetEventToNull();
        }
        if (mEventStatus != EventResult.PERSISTENT)
        {
            mEventStatus = OnStage(mCurrentStage);
            if (mEventStatus == EventResult.SKIP)
            {
                // the event decided not to fire at all for whatever reason
                SetEventToNull();
            }
        }
    }