void Start() { EtherealTutorialStarted = false; FinishedEtherealTutorial = false; EtherealFlashScale = 0f; TheEtherealManager = this; EmptinessBackgroundSound = AudioManager.TheAudioManager.createGeneralAudioSource(AudioManager.AM.EtherealEmptyBackground, AudioManager.AM.PlayerAudioMixer, 0f, 1f, true); EtherealGroup.SetActive(false); }
// Update is called once per frame void FixedUpdate() { EtherealManager eth = EtherealManager.TheEtherealManager; if (eth == null) { return; } if ((Astronaut.TheAstronaut != null) && (Astronaut.TheAstronaut.Alive)) { Vector3 dif = (startlocation - Astronaut.TheAstronaut.transform.position); if (dif.magnitude < DetectRange) { DV = true; } else { DV = false; } } if (eth.EtherealCurrentLevel < RequiredEtherealLevel) { DV = (!DV); } else { if (RemoveIfQualified) { this.gameObject.SetActive(false); } } float sp = 3f * Time.fixedDeltaTime; Vector3 loc = startlocation; if (DV == DisplaceWhenDV) { loc = startlocation + Displacement; } else { loc = startlocation; } Vector3 dif2 = (loc - this.transform.position); if (dif2.magnitude < sp) { this.transform.position = loc; } else { this.transform.position = (this.transform.position + (dif2.normalized * sp)); } }