示例#1
0
    private void EventManager_OnSubEventOccuring(RuntimeEvent ge, RuntimeSubEvent se)
    {
        if (!ge.eventRef.useSubEventMessages)
        {
            return;
        }
        int    index;
        string message;

        Debug.Log(se.eventRef.label + " Starting");

        index   = Random.Range(0, se.eventRef.startingMessage.Length);
        message = se.eventRef.startingMessage[index];
        MessageBox.DisplayMessage(se.eventRef.label, message);
    }
示例#2
0
    public RuntimeEvent(int id)
    {
        if (id < 0 || id >= GameDatabase.Instance.eventList.Count)
        {
            throw new System.ArgumentOutOfRangeException();
        }

        ID       = id;
        eventRef = GameDatabase.Instance.eventList[id];

        subEvents = new RuntimeSubEvent[eventRef.subEvents.Length];
        for (int i = 0; i < subEvents.Length; i++)
        {
            subEvents[i] = new RuntimeSubEvent(eventRef.subEvents[i]);
        }
    }