// Use this for initialization void Start() { // initialize the components if (!(fb = this.gameObject.GetComponent<FlashlightBehaviour>())) throw new NullReferenceException("FlashlightBehaviour component in the FlashlightRecharge script is null."); if(!(view = this.gameObject.GetComponent<PhotonView>())) throw new NullReferenceException("PhotonView component in the FlashlightRecharge script is null."); //initialize the fields flashLightTimeRemaining = flashLightLifeTime; treshold = defaultTreshold; }
// Use this for initialization void Start() { playerRigidbody = GetComponent <Rigidbody>(); currentLookDirection = transform.eulerAngles; playerFlashlight = gameObject.GetComponentInChildren <FlashlightBehaviour>(); myCamera = gameObject.GetComponentInChildren <Camera>(); cameraPositions = new Vector3[3]; cameraPositions[0] = new Vector3(0, 1.1f, 0); cameraPositions[1] = new Vector3(0, 0.3f, 0.0f); cameraPositions[2] = new Vector3(0, -0.65f, 0.35f); camMotionBlur = myCamera.GetComponent <UnityStandardAssets.ImageEffects.MotionBlur>(); }
void Awake() { flashlightSingleton = this; switch (GameManager.currentStage) { case 0: batteryDeclineRate = 0.5f; break; case 1: batteryDeclineRate = 0.75f; break; case 2: batteryDeclineRate = 1.0f; break; default: batteryDeclineRate = 1.25f; break; } }
void Start() { if(!(fb = flashlight.GetComponent<FlashlightBehaviour>())) throw new NullReferenceException("FlashlightBehaviour component in PrimsControls script is null!"); pauseObject = Resources.Load("PauseCamera"); }