コード例 #1
0
    void Start()
    {
        var size = rect.GetComponent <RectTransform>().sizeDelta;

        width  = size.x;
        height = size.y;
    }
コード例 #2
0
    public void OpenWindow()
    {
        if (FindObjectOfType <QuestManager>().isOnTheQuest)
        {
            return;
        }

        encyclopediaWindow.SetActive(true);

        background.GetComponent <ColorChanger>().ChangeColor();
        characterButton.GetComponent <ColorChanger>().ChangeColor();
        paletteButton.GetComponent <ColorChanger>().ChangeColor();

        UpdatePaletteItems();
        UpdateCharacterItems();
    }
コード例 #3
0
    public void UpdateItem()
    {
        bool isHaving = characterManager.GetCharacterIsHaving(index);
        bool isUsing  = (characterManager.currentIndex == index);

        GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.MidLight);

        if (isHaving)
        {
            character.gameObject.SetActive(true);
            lockImage.gameObject.SetActive(false);

            chooseButtonText.text = character.GetName();
            character.AnimateWait(!isUsing);

            if (isUsing)
            {
                GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Mid);
                chooseButton.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Dark);
                chooseButtonText.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.White);
            }
            else
            {
                chooseButton.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.White);
                chooseButtonText.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Black);
            }
        }
        else
        {
            character.gameObject.SetActive(false);
            lockImage.gameObject.SetActive(true);

            chooseButtonText.text = "???";

            chooseButton.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Light);
            chooseButtonText.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Mid);
        }
    }
コード例 #4
0
    void UpdateTimeLimitUI()
    {
        if (!currentQuest || isEditing || !currentQuest.alarm.hasAlarm)
        {
            return;
        }

        if (IsRightTime(currentQuest.alarm))
        {
            if (inSwitch)
            {
                diaImage.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Dark);
                diaAmountText.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Dark);

                StartTime.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.Mid);
                timeText.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.White);

                inSwitch  = false;
                outSwitch = true;
            }
        }
        else
        {
            if (outSwitch)
            {
                diaImage.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.MidLight);
                diaAmountText.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.MidLight);

                StartTime.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.MidLight);
                timeText.GetComponent <ColorChanger>().ChangeColorValueTo(ColorValue.White);

                inSwitch  = true;
                outSwitch = false;
            }
        }
    }
コード例 #5
0
    public void SetupTimer(float _second)
    {
        isRunning  = false;
        isTimeOver = false;
        leftTime   = _second;
        maxTime    = _second;

        completeButton.gameObject.SetActive(false);
        playButton.gameObject.SetActive(true);

        leftTimeText.color = Color.black;
        sliderFill.GetComponent <ColorChanger>().ChangeColor();

        timerSlider.GetComponent <Animator>().SetBool("TimeOver", false);

        UpdateTimerUI();
    }