void Start() { var size = rect.GetComponent <RectTransform>().sizeDelta; width = size.x; height = size.y; }
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(); }
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); } }
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; } } }
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(); }