Example #1
0
    private static void LocationEvent(LocationEventInfo locationEventInfo)
    {
        Game.currentLocation = locationEventInfo.location;
        ProgressEventInfo e = ScriptableObject.CreateInstance <ProgressEventInfo>();

        e.progressIndex     = locationEventInfo.location.progressIndex;
        e.progressEventType = PROGRESS_EVENT_TYPE.GAME_PROGRESS;
        EventSystem.EventSystem.FireEvent(e);
        Show(locationEventInfo);
        AssignButtons(locationEventInfo);
    }
Example #2
0
    private static void AssignButtons(LocationEventInfo locationEventInfo)
    {
        locationEventInfo.location.EvaluateEventHolders();
        for (int i = 0; i < 4 - locationEventInfo.location.eventHolders.Count; i++)
        {
            _buttonEventHandlers[i].SetEventInfo(null);
        }

        for (int i = 0; i < locationEventInfo.location.eventHolders.Count; i++)
        {
            _buttonEventHandlers[3 - i].SetEventInfo(locationEventInfo.location.eventHolders[i].GetEvent());
        }
    }
Example #3
0
    private static void Show(LocationEventInfo locationEventInfo)
    {
        locationName.text = locationEventInfo.location.name;
        UIHelperClass.ShowPanel(LocationNamePanel, true);
        if (locationEventInfo.location.Texture == null)
        {
            currentLocationEventInfo = locationEventInfo;
            APIHandler.getAPIHandler().FetchImage(locationEventInfo.location.imagePath, FetchImageCallback);
        }
        else
        {
            locationPanelImage.sprite = Sprite.Create(
                locationEventInfo.location.Texture,
                new Rect(0, 0, locationEventInfo.location.Texture.width, locationEventInfo.location.Texture.height),
                new Vector2(0.5f, 0.5f));

            locationPanelImage.SetMaterialDirty();
        }
    }