Beispiel #1
0
    public static void FetchImageCallback(Texture2D texture)
    {
        currentEntity.Texture = texture;
        Sprite tempSpr = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));

        entityImage.sprite = tempSpr;
        entityImage.SetMaterialDirty();
        UIHelperClass.ShowPanel(entityImageObject, true);
    }
Beispiel #2
0
 private void ShowPanel(bool show)
 {
     if (show)
     {
         _mCamera.Play();
     }
     else
     {
         _mCamera.Stop();
     }
     _cameraPanel.SetActive(show);
     UIHelperClass.ShowPanel(_cameraPanel, show);
     enabled = show;
 }
Beispiel #3
0
 public static void SetElements(GameObject locationPanel, GameObject cameraPanel, GameObject nameableInput)
 {
     _locationPanel     = locationPanel;
     _cameraPanel       = cameraPanel;
     _nameableInput     = nameableInput;
     _cameraController  = _cameraPanel.GetComponent <CameraController>();
     _inputField        = _nameableInput.GetComponentInChildren <TMP_InputField>();
     _inputSubmitButton = _nameableInput.GetComponentInChildren <Button>();
     _inputSubmitButton.onClick.AddListener(SubmitEvent);
     _cameraPanel.SetActive(false);
     _nameableInput.SetActive(false);
     UIHelperClass.ShowPanel(_cameraPanel, true);
     UIHelperClass.ShowPanel(_nameableInput, true);
     EventSystem.EventSystem.RegisterListener <NamableEventInfo>(NameableEvent);
 }
Beispiel #4
0
    private void InitialPanelState()
    {
        cameraPanel.SetActive(false);
        startMenu.SetActive(true);
        loadingScreen.SetActive(true);
        loadSavePanel.GetComponent <LeanWindow>().TurnOff();
        LoginPanel.TurnOff();
        RegisterPanel.TurnOff();
        UIHelperClass.ShowPanel(dialoguePanel, false);

        bool tokenExists = PlayerPrefs.GetString("token") != "";

        continueButton.SetActive(tokenExists);
        logoutButton.SetActive(tokenExists);
        loginButton.SetActive(!tokenExists);
    }
Beispiel #5
0
    /*public static DialogueSystem GetDialogueSystem()
     * {
     *  return _dialogueSystem ?? (_dialogueSystem = new DialogueSystem()); //If null, right, if not, left, simple!
     * }*/

    private static void Instantiate()
    {
        _dialoguePanel = GameObject.Find("DialoguePanel").gameObject;
        _textJuicer    = Object.FindObjectOfType <TMP_TextJuicer>().gameObject.GetComponent <TMP_TextJuicer>();
        UIHelperClass.ShowPanel(_dialoguePanel, false);

        for (var i = 0; i < 4; i++)
        {
            _buttonEventHandlers[i] = GameObject.Find("Option" + i).GetComponent <ButtonEventHandler>();
        }

        _dialogueTextMesh = GameObject.Find("DialogueText").GetComponent <TextMeshProUGUI>();

        _defaultContinueEventInfo           = ScriptableObject.CreateInstance <DialogueEventInfo>();
        _defaultContinueEventInfo.eventType = DIALOGUE_EVENT_TYPE.ContinueDialogue;
        _defaultContinueEventInfo.Validate();
    }
Beispiel #6
0
    private static void ShowEntity(EntityEventInfo entityEventInfo)
    {
        LocationSystem.HideNamePanel();
        if (entityEventInfo.entity.Texture == null)
        {
            currentEntity = entityEventInfo.entity;
            APIHandler.getAPIHandler().FetchImage(entityEventInfo.entity.imagePath, FetchImageCallback);
        }
        else
        {
            entityImage.sprite = Sprite.Create(
                entityEventInfo.entity.Texture,
                new Rect(0, 0, entityEventInfo.entity.Texture.width, entityEventInfo.entity.Texture.height),
                new Vector2(0.5f, 0.5f));

            entityImage.SetMaterialDirty();
            UIHelperClass.ShowPanel(entityImageObject, true);
        }
    }
Beispiel #7
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();
        }
    }
Beispiel #8
0
    private static void DialogueEvent(DialogueEventInfo e)
    {
        switch (e.eventType)
        {
        case DIALOGUE_EVENT_TYPE.StartDialogue:
            e.dialogue.current = e.dialogue.first;
            UIHelperClass.ShowPanel(_dialoguePanel, true);
            _textJuicer.enabled = e.juicy;
            SetCurrentDialogue(e.dialogue);
            break;

        case DIALOGUE_EVENT_TYPE.ContinueDialogue:
            ContinueDialogue(e.node);
            break;

        case DIALOGUE_EVENT_TYPE.EndDialogue:
            UIHelperClass.ShowPanel(_dialoguePanel, false);
            _textJuicer.enabled = false;
            break;
        }
    }
Beispiel #9
0
 private static void HideEntity(EntityEventInfo entityEventInfo)
 {
     UIHelperClass.ShowPanel(entityImageObject, false);
 }
Beispiel #10
0
 public static void HideNamePanel()
 {
     UIHelperClass.ShowPanel(LocationNamePanel, false);
 }