private void OnDestroy() { if (Instance == this) { Instance = null; } }
private void Start() { pages = GetComponent <Text>(); gameEventHandler = ExperimentalGameEventHandler.Instance; pages.text = "Collect all " + gameEventHandler.pagesToCollect + " pages"; pages.CrossFadeAlpha(0, fadeOutTime, false); }
private void Start() { mainCamera = Camera.main; controller = GetComponent <CharacterController>(); cardboardController = XRCardboardController.Instance; cardboardController.maxInteractionDistance = reachDistance; gameManager = ExperimentalGameEventHandler.Instance; }
private void Awake() { if (Instance != null) { Debug.LogError("Only one instance of singleton allowed"); } Instance = this; }
private void Start() { ExperimentalGameEventHandler gameManager = ExperimentalGameEventHandler.Instance; playerController = gameManager.player; mainCamera = Camera.main.transform; anim = mainCamera.GetComponent <Animator>(); playerAudioSource = playerController.GetComponent <AudioSource>(); GetComponent <AudioSource>().clip = audioStatic; }
private void Start() { gameManager = ExperimentalGameEventHandler.Instance; GameObject slender = gameManager.slenderman; ExperimentalPlayerController player = gameManager.player; mainCamera = Camera.main; slendermanLocation = slender.transform; playerLocation = player.transform; spawnRadius = player.viewDistance; }