private void Start() { //This is an emergency thing. It should not ever trigger except in testing environment if (ActualSave.actualSave == null) { ActualSave.actualSave = new SaveFileInfo(); } inputHandler = this.transform.parent.parent.GetComponent <InputHandler>(); //GameObject.FindGameObjectsWithTag("PersistentObject")[0]; inputHandler.addObserver(this); StartParent = this.transform.parent; playerCollider = this.GetComponent <SphereCollider>(); emotions = this.GetComponent <EmotionHandlerScript>(); // We get the player's rigidbody's component player = GetComponent <Rigidbody>(); ActualSave.actualSave.stats[playerNb].playerRotationSpeed = 0f; GameObject[] spawners = GameObject.FindGameObjectsWithTag("Spawn"); bonusCount = GameObject.FindGameObjectsWithTag("BonusCount")[0].GetComponent <TextMeshProUGUI>(); defaultGravity = new Vector3(0, -40f, 0); follower = transform.parent.GetComponentInChildren <PlayerCapsuleFollow>(); swapper = GetComponent <ElementalPlayerVisualSwapper>(); nextPowerEmptiesAll = false; ActivateTrail(0, false); ActivateTrail(1, false); ActivateTrail(2, false); ActivateTrail(3, false); }
// Start is called before the first frame update void Start() { firePlayerEmotion = firePlayer.GetComponent <EmotionHandlerScript>(); firePlayerEmotion.NormalMood(); firePlayerEmotion.NormalStrength(); firePlayerEmotion.NormalEye(); }
private void Start() { persistantHandler = GameObject.FindGameObjectsWithTag("PersistentObject")[0]; persistantHandler.GetComponent <InputHandler>().addObserver(this); StartParent = this.transform.parent; shoutHandler = playerCamera.GetComponentInChildren <ShoutHandlerScript>(); playerCollider = this.GetComponent <SphereCollider>(); emotions = this.GetComponent <EmotionHandlerScript>(); // We get the player's rigidbody's component player = GetComponent <Rigidbody>(); playerRotationSpeed.SetValue(0f); GameObject[] spawners = GameObject.FindGameObjectsWithTag("Spawn"); if (spawners.Length > 0) { respawnPosition = spawners[0].transform.position; } else { respawnPosition = Vector3.one; } /*GameObject victory = GameObject.FindGameObjectsWithTag("Finish")[0]; * transform.LookAt(victory.transform);*/ bumpSource = this.gameObject.GetComponentInChildren <AudioSource>(); baseVolume = bumpSource.volume; bonusCount = GameObject.FindGameObjectsWithTag("BonusCount")[0].GetComponent <TextMeshProUGUI>(); GameObject levelLoader = Instantiate(LevelLoader); _levelLoader = levelLoader.GetComponent <LevelLoader>(); powerGauge.value = powerTime; maxPowerTime.value = powerTime; }
public void makeIceComeOut() { icePlayerEmotion = icePlayer.GetComponent <EmotionHandlerScript>(); icePlayerEmotion.ReallyAngry(); icePlayerLookAt.transform.position = firePlayer.transform.position; icePlayer.transform.LeanMoveLocalZ(0.7f, 0.5f); fireFollowIce = true; }