protected virtual void GiveOrTake() { if (Requirement != null) { if (!FollowerInventory.Instance.Contains(Requirement)) { return; } } if (RequirementMissing != null) { if (FollowerInventory.Instance.Contains(RequirementMissing)) { return; } } if (Taken != null) { FollowerEvent.Trigger(FollowerEventTypes.Loss, Taken, null, null, Requirement, Reason); } if (Given != null) { FollowerEvent.Trigger(FollowerEventTypes.Gift, Given, null, null, Requirement, Reason); // we instantiate the given follower and make it follow the player _newPosition.z = _givenFollower.transform.position.z; _newPosition.x = LevelManager.Instance.Players[0].transform.position.x; _newPosition.y = LevelManager.Instance.Players[0].transform.position.y; _newPosition.x -= xOffset; _givenFollower.transform.position = _newPosition; StartCoroutine(_givenFollower.StartFollowing()); } }
protected virtual void SceneInit() { if (SceneManager.GetActiveScene().name == "1-Childhood") { //MMDebug.DebugLogTime("scene init, scene name : " + SceneManager.GetActiveScene().name + " clear"); Content.Clear(); } if ((SceneManager.GetActiveScene().name == "2-Adolescence") || (SceneManager.GetActiveScene().name == "3-Adulthood") || (SceneManager.GetActiveScene().name == "4-OldAge") ) { foreach (FollowerData data in Content) { _follower = Instantiate(FollowerPrefab); _follower.Data = data; _newPosition = LevelManager.Instance.Players[0].transform.position; _newPosition.x -= 10f; _follower.transform.position = _newPosition; _follower.TargetBuyZone.gameObject.SetActive(false); StartCoroutine(_follower.StartFollowing()); CorgiEngineEvent.Trigger(CorgiEngineEventTypes.SortFollowers); } } if (SceneManager.GetActiveScene().name == "5-End") { Story += "\n\n"; Story += "At the end you had "; for (int i = 0; i < Content.Count; i++) { if (i < Content.Count - 2) { Story += "<color=red>" + Content[i].MessageDisplayText + "</color>, "; } if (i == Content.Count - 2) { Story += "<color=red>" + Content[i].MessageDisplayText + "</color> and "; } if (i == Content.Count - 1) { Story += "finally <color=red>you died</color>."; } } Story += "\n\n"; Story += "This was your life. You could have done better. Press any key to try a new life and maybe make better choices."; } }