Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using AC; //Import Adventure Creator Library
- using PixelCrushers.DialogueSystem; //Import DialogueSystem library
- public class BacktrackScript : MonoBehaviour
- {
- private Camera currentCam;
- public _Camera GoBackTo;
- public bool isInConversation = false;
- // Start is called before the first frame update
- void Update ()
- {
- isInConversation = GameObject.FindWithTag("DialogueManager").GetComponent<DialogueSystemController>().IsConversationActive; //Checks if DialogueSystem is active.
- if (Input.GetButtonUp("InteractionB") && KickStarter.mainCamera.attachedCamera == GetComponent<_Camera>() && isInConversation == false)//If I Right-Click & I'm on the current camera, and Dialogue System is off...
- {
- AC.KickStarter.mainCamera.SetGameCamera(GoBackTo, 1.0f, MoveMethod.Smooth, null); //...Camera Switch to the defined GoBackTo Camera.
- Debug.Log("Going Back to: " + GoBackTo); //Report it in the console.
- }
- Debug.Log("Assigned Camera: " + KickStarter.mainCamera.attachedCamera); //Always report what camera we're on.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement