// Use this for initialization void Start() { mRenderer = GetComponent <MeshRenderer>(); if (mRenderer) { material = mRenderer.material; } myBursts = GetComponentsInChildren <CompletionBurst>(); player = Toolbox.Instance.GetPlayer(); playplay = player.GetComponent <MFPP.Player>(); flip = Toolbox.Instance.GetFlip(); }
void Start() { player = Toolbox.Instance.GetPlayer().transform; flip = player.gameObject.GetComponent <flipScript>(); flipScript.OnFailedFlip += FailedFlip; eyeParent = GetComponent <SimpleEye>(); InitializeWallCheck(); Debug.Log(transform.rotation.eulerAngles.y); particleSystem = GetComponentInChildren <ParticleSystem>(); audio = GetComponent <AudioSource>(); audio.maxDistance = GetComponent <SphereCollider>().radius; transition = GetComponentInChildren <Transition>(); }
public void UpdateToolbox() { if (!player) { player = GameObject.FindWithTag("Player"); } if (!mainCanvas) { mainCanvas = GameObject.FindWithTag("Main Canvas"); } playerCam = player.GetComponentInChildren <Camera>(); raycastManager = player.GetComponent <RaycastManager>(); pickUp = player.GetComponent <MFPP.Modules.PickUpModule>(); flipScript = player.GetComponent <flipScript>(); UpdateTransforms(); iconContainer = GameObject.FindWithTag("IconContainer").GetComponent <IconContainer>(); pauseMenu = GameObject.Find("PauseMenu"); Application.backgroundLoadingPriority = ThreadPriority.Low; cameraFogStartDefault = Camera.main.GetComponent <UnityStandardAssets.ImageEffects.GlobalFog>().startDistance; fogDensityDefault = RenderSettings.fogDensity; if (Toolbox.Instance == this) { SoundEffectsAudio = GameObject.Find("SoundEffectsAudio").GetComponent <AudioSource>(); } Debug.Log("adding player info!"); Toolbox.Instance.player = player; Toolbox.Instance.playerCam = playerCam; Toolbox.Instance.pickUp = pickUp; Toolbox.Instance.raycastManager = raycastManager; Toolbox.Instance.flipScript = flipScript; UpdateTransforms(); Toolbox.Instance.iconContainer = iconContainer; Toolbox.Instance.pauseMenu = pauseMenu; Toolbox.Instance.SoundEffectsAudio = GameObject.Find("SoundEffectsAudio").GetComponent <AudioSource>(); Toolbox.Instance.SoundtrackAudio = GameObject.Find("LaserChords").GetComponent <AudioSource>(); Toolbox.Instance.soundEffectsSlider = pauseMenu.transform.GetChild(2).GetComponent <Slider>(); Toolbox.Instance.soundEffectsSlider.onValueChanged.AddListener(delegate { VolumeChangeCheck(); }); }