void DestroySystem() { //manually switch camera control over cameraChanger.ChangeCam(1); setCamera.AdjustCameraForPlaying(); //end cam switch canvasMessage.SetActive(false); //make the sheep start floating away parentObject.AddComponent <Rigidbody>().useGravity = false; parentObject.GetComponent <Rigidbody>().AddForce(0.3f, 0.4f, 0.3f, ForceMode.Impulse); //destroy this script Destroy(SpaceKey.GetComponent <Rigidbody>()); Destroy(this); }
IEnumerator DisplayMessageRoutine(int message) { yield return(new WaitForSeconds(3)); displayCanvas.SetActive(true); if (message > 0) { displayText.SetText("You crafted the eternity potion!"); //TODO make this potion damage you like a fire for as long as it's in your inventory } else { displayText.SetText("Nothing happened..."); } yield return(new WaitForSeconds(3)); displayText.SetText(""); displayCanvas.SetActive(false); //give the camera back to the player. Cauldron cauldron = GetComponent <Cauldron>(); cauldron.cameraChanger.ChangeCam(1); setCamera.AdjustCameraForPlaying(); Global.USER_INPUT_ENABLED = true; //let the player interact again. Interacted = false; }
void SetCameraBackToNormal() { setCamera.AdjustCameraForPlaying(); }