예제 #1
0
 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);
 }
예제 #2
0
    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;
    }
예제 #3
0
 void SetCameraBackToNormal()
 {
     setCamera.AdjustCameraForPlaying();
 }