Exemplo n.º 1
0
        public void LoadEventStorage()
        {
            eventStoragePrefab = (GameObject)Resources.Load("Prefabs/Kingdom Events Storage");
            curEventStorage    = (GameObject)Instantiate(eventStoragePrefab);

            if (curEventStorage == null)
            {
                Debug.LogWarning("Storage not found! Check Reference");
                return;
            }

            curKingdomEventData = curEventStorage.GetComponent <KingdomEventStorage>();

            // INTERVALS FOR ALL EVENTS - STUDY IF THIS IS SOMETHING WORTH STAYING, SINCE YOU LOAD STUFF
            // AND YOU MIGHT WANT TO CHANGE IT LATER ON TO BALANCE, I THINK THIS CAN BE REMOVED
            // -July Self.
            for (int i = 0; i < curKingdomEventData.storyArcEvents.Count; i++)
            {
                if (curKingdomEventData.storyArcEvents[selectedArcIdx].eventIntervals.Count <= 0)
                {
                    curKingdomEventData.storyArcEvents[selectedArcIdx].eventIntervals = new List <int>();
                    for (int x = 0; x < curKingdomEventData.storyArcEvents[selectedArcIdx].storyEvents.Count; x++)
                    {
                        curKingdomEventData.storyArcEvents[selectedArcIdx].eventIntervals.Add(1);
                    }
                }
                else
                {
                    break;
                }
            }

            for (int i = 0; i < curKingdomEventData.storyArcEvents.Count; i++)
            {
                if (curKingdomEventData.storyArcEvents[selectedArcIdx].eventBoosts.Count <= 0)
                {
                    curKingdomEventData.storyArcEvents[selectedArcIdx].eventBoosts = new List <float>();
                    for (int x = 0; x < curKingdomEventData.storyArcEvents[selectedArcIdx].storyEvents.Count; x++)
                    {
                        curKingdomEventData.storyArcEvents[selectedArcIdx].eventBoosts.Add(0.5f);
                    }
                }
                else
                {
                    break;
                }
            }


            eventStorageLoaded = true;
        }
Exemplo n.º 2
0
 public void Awake()
 {
     instance = this;
 }