public void SetupQuestButton(QuestEvent quest) { refEvent = quest; newButtonText = GetComponentInChildren <Text>(); display = FindObjectOfType <QuestDisplay>(); newButtonText.text = refEvent.eventName; }
public static void NewQuest() { if (Instance.currentQuest < 4) { ++Instance.currentQuest; switch (Instance.currentQuest) { case 1: QuestDisplay.SetQuestInfo(Instance.quest1.questName, "", Instance.quest1.questFeedback, Instance.quest1.questTip); break; case 2: QuestDisplay.SetQuestInfo(Instance.quest2.questName, "", Instance.quest2.questFeedback, Instance.quest2.questTip); break; case 3: QuestDisplay.SetQuestInfo(Instance.quest3.questName, "", Instance.quest3.questFeedback, Instance.quest3.questTip); break; case 4: QuestDisplay.SetQuestInfo(Instance.quest4.questName, "", Instance.quest4.questFeedback, Instance.quest4.questTip); break; default: break; } QuestDisplay.QuestFadein(); } }
public void Update() { switch (currentQuest) { case 1: QuestDisplay.SetQuestFeedback(triggerGate.TriggeredPlates + "/" + 2); if (triggerGate.isUnlocked && !QuestDisplay.isTransitioning) { EndQuest(); } break; case 2: if (targetPractice.isUnlocked && !QuestDisplay.isTransitioning) { QuestDisplay.SetQuestFeedback("4/4"); EndQuest(); } else { QuestDisplay.SetQuestFeedback(targetPractice.DeadTargets + "/" + 4); } break; case 3: QuestDisplay.SetQuestFeedback(EnemyController.LivingEnemies + "/" + startEnemies); if (EnemyController.LivingEnemies == 0 && !QuestDisplay.isTransitioning) { gateAnimator.SetBool("Open", true); LitBraziers(); EndQuest(); } break; case 4: if (goalTrigger.bounds.Contains(PlayerController.Instance.transform.position)) { GameManager.WinGame(); } break; default: break; } }
public void Initialize(QuestManager questManager) { Debug.Log("Initializing QuestsDisplay"); // Destroy all children for (int i = 0; i < listTransform.childCount; i++) { Destroy(listTransform.GetChild(i).gameObject); } // Initialize quest list this.questManager = questManager; List <Quest> quests = questManager.Quests; foreach (Quest quest in quests) { QuestDisplay display = Instantiate(questDisplayPrefab) as QuestDisplay; display.transform.SetParent(listTransform, false); display.Initialize(quest); } }
public void updateDisplay() { int maxQuests = QuestManager.Instance.maxQuests; for (int i = 0; i < transform.childCount; i++) { Destroy(transform.GetChild(i).gameObject); } for (int i = 0; i < QuestManager.Instance.currentQuests.Count; i++) { QuestDisplay qd = Instantiate(questPrefab); qd.quest = QuestManager.Instance.currentQuests[i]; Rect r = new Rect(); r.xMin = 0; r.yMin = (1f - (1f / maxQuests)) - ((1f / maxQuests) * i); r.xMax = 1; r.yMax = 1 - ((1f / maxQuests) * i); UIManager.Instance.seatInside(this.GetComponent <RectTransform>(), qd.GetComponent <RectTransform>(), r); qd.UpdateDisplay(); } }
private void EndQuest() { StartCoroutine(QuestDisplay.QuestFadeout()); }
public void AddDisplay(QuestDisplay display) { display.transform.SetParent(layoutGroup.transform); display.transform.localScale = Vector3.one; }
private void Awake() { Instance = this; }
private void Start() { questDisplay = GetComponentInParent <QuestDisplay>(); AcceptDisplay = GetComponentInParent <QuestAcceptDisplay>(); }
public void AddDisplay(QuestDisplay newDisplay) { _displays.Add(newDisplay); }
void Start() { instance = this; }