new void Start() { if (cameraFollow == null) { cameraFollow = GameObject.Find("PhysicalCameraFollow").GetComponent <CameraFollowAux> (); } level = GameObject.Find("LevelController").GetComponent <LevelControllerScript> (); mcRef = FindObjectOfType <MasterControllerScript>(); if (reentrant) { enabled = level.retrieveBoolValue("is" + this.name + "Enabled"); } reentryDelay = 1.0f; }
void Awake() { GameObject lgo = GameObject.Find("LevelController"); if (lgo != null) { level = lgo.GetComponent <LevelControllerScript> (); } player_A = GameObject.Find("Player"); //warpToOriginalPosition (); softY = new SoftFloat(); softY.setTransformation(TweenTransforms.cubicOut); softX = new SoftFloat(); softX.setTransformation(TweenTransforms.cubicOut); softZ = new SoftFloat(); softZ.setTransformation(TweenTransforms.cubicOut); if (player_A != null) { if (player_A.GetComponent <PlayerScript> ().targetLookAt != null) { target = player_A.GetComponent <PlayerScript> ().targetLookAt; } } // setTargetX (25, 0.1f); // setTargetY (0, 0.1f); // setDistanceZ (10, 0.1f); lgo = GameObject.Find("PhysicalCameraFollow"); if (lgo != null) { cameraTremor = lgo.GetComponentInChildren <CameraUtils> (); cameraFollowAux = lgo.GetComponent <CameraFollowAux> (); } iTween.Init(this.gameObject); /*if(SceneManager.GetActiveScene().name.ToLower().Contains("interior")) * { * setDistanceZ(8.0f); * } * * if (SceneManager.GetActiveScene().name.ToLower().Contains("exterior")) * { * setDistanceZ(10.0f); * }*/ }
// public void storePhysicalCameraPosition() { //// CameraFollowAux physicalCamera = GameObject.Find ("PhysicalCameraFollow").GetComponent<CameraFollowAux> (); //// storeFloatValue ("PCX" + locationName, physicalCamera.transform.position.x); //// storeFloatValue ("PCY" + locationName , physicalCamera.transform.position.y); //// storeFloatValue ("PCZ" + locationName , physicalCamera.transform.position.z); // // } // public void storePhysicalCameraPosition(string otherLocation) { //// CameraFollowAux physicalCamera = GameObject.Find ("PhysicalCameraFollow").GetComponent<CameraFollowAux> (); //// storeFloatValue ("PCX" + otherLocation, physicalCamera.transform.position.x); //// storeFloatValue ("PCY" + otherLocation , physicalCamera.transform.position.y); //// storeFloatValue ("PCZ" + otherLocation , physicalCamera.transform.position.z); // // } public void loadPhysicalCameraPosition() { CameraFollowAux physicalCamera = GameObject.Find("PhysicalCameraFollow").GetComponent <CameraFollowAux> (); CameraManager cameraLerp = GameObject.Find("CameraLerp").GetComponent <CameraManager> (); float x = retrieveFloatValue("Coords" + locationName + "X"); float y = retrieveFloatValue("Coords" + locationName + "Y"); float z = retrieveFloatValue("Coords" + locationName + "Z"); if ((x != 0) || (y != 0) || (z != 0)) { cameraLerp.transform.position = new Vector3(x, y, z) + cameraLerp.offset; cameraLerp.destination = new Vector3(x, y, z) + cameraLerp.offset; physicalCamera.transform.position = cameraLerp.whereTheCameraShouldBe.transform.position; } else { cameraLerp.warpToOriginalPosition(); physicalCamera.transform.position = cameraLerp.whereTheCameraShouldBe.transform.position; } }
void Start() { cameraFollow = GameObject.Find("PhysicalCameraFollow").GetComponent <CameraFollowAux> (); }