public void PlayerEnterTrigerArea(Player player, bool isEnter) { if (isEnter) { player?.SetLittleSunHandler(this); InfoSignAnim.Play(InfoSignAnimHash.INTRO); isTeleported = false; } else { player?.SetLittleSunHandler(null); if (!isTeleported && InfoSignAnim.GetCurrentAnimatorStateInfo(0).shortNameHash != InfoSignAnimHash.EMPTY) { InfoSignAnim.Play(InfoSignAnimHash.OUTRO); } } }
public void OnLittleSunInteraction() { FindObjectOfType <Player>().playerRuntimeData.lastLittleSunID = littleSunData.LittleSunID; InfoSignAnim.Play(InfoSignAnimHash.OUTRO); if (!littleSunData.IsActive()) { GameObject.Find("GameManager").GetComponent <GameManager>().playerCinemaMovement.LightLittleSun(this); littleSunData.OnLightLittleSun(); } else { Player player = GameObject.Find("Player").GetComponent <Player>(); //StartCoroutine(refreshScene(player)); player.stateMachine.SwitchState(player.littleSunState); // transfer control authority to littleSunState } // save whenever interaction happends GameObject.Find("GameManager").GetComponent <GameManager>().gameSaver.SaveAll(); UIEventListener.Instance.OnInfomationChange(new UIEventListener.InfomationChangeData("Game Saved")); }