private void LevelUp(RewardLevel rewardLevel) { // TODO: animation to show level up along with what power was received. print("Level up. " + rewardLevel.reward); DialogKey dialogKey = DialogKey.None; switch (rewardLevel.reward) { case RewardType.RewardPushCrates: dialogKey = DialogKey.MoveCrates; break; case RewardType.RewardCarryDoubleSouls: dialogKey = DialogKey.MoreSoulCapacity; break; case RewardType.RewardMoreTime: dialogKey = DialogKey.MoreTime; break; case RewardType.RewardDash: dialogKey = DialogKey.NowCanDash; break; case RewardType.RewardEvenMoreTime: dialogKey = DialogKey.EvenMoreTime; break; } if (dialogKey != DialogKey.None) { ShowDialog(dialogKey); } }
public string TextForKey(DialogKey key) { string text = dialogs[key]; Assert.IsNotNull(text); return(text); }
public void ShowDialog(DialogKey key) { dialogText.text = dialogs.TextForKey(key); dialog.SetActive(true); showingDialog = true; paused = true; plotPoint = key + 1; }
public override void LoadState() { paused = false; waitingToRestart = false; gameOverText.gameObject.SetActive(false); plotPoint = (DialogKey)RestoreInt("plotPoint"); nextRewardLevel = RestoreInt("nextRewardLevel"); }
public GameObject OpenIfNoneOpened(DialogKey key, GameObject obj) { var dialog = CurrentDialog.FirstOrDefault(o => o.Key == key); if (!dialog.Equals(default(DialogItem))) { return(dialog.Dialog); } var item = new DialogItem(key, Instantiate(obj, transform)); CurrentDialog.Push(item); return(item.Dialog); }
private void OnTriggerEnter2D(Collider2D collision) { if (!collision.CompareTag("Player")) { return; } print("DialogTrigger " + dialogType + "collided with player."); DialogKey plotPoint = GameManager.instance.plotPoint; if (plotPoint == dialogType) { print("Show the dialog"); GameManager.instance.ShowDialog(dialogType); Destroy(this.gameObject); } else { print("Not time yet to show " + dialogType + ". Plot point is " + plotPoint); } }
public DialogItem(DialogKey key, GameObject obj) { Key = key; Dialog = obj; }