public override void Activate(GameManager gameManager) { base.Activate(gameManager); /* * //Want the raycast cam to look at the POI. So we get the rotation needed for the cam to see it and we apply to the entire platform. * Quaternion oldRot = Controller.instance.raycastCam.transform.localRotation; * Controller.instance.raycastCam.transform.LookAt(this.transform.position); * Quaternion newRot = Controller.instance.raycastCam.transform.localRotation; * * //Apply to platform, and reset raycastCam pos. * * Controller.playerShip.transform.rotation *= ((newRot * Quaternion.Inverse(oldRot))); * Controller.instance.raycastCam.transform.localRotation = oldRot; * * // * Controller.playerShip.transform.position = this.transform.position - Controller.instance.raycastCam.transform.forward * 50.0f; */ //Teleport to location. CatalystPlatform platform = gameManager.platform; platform.transform.position = this.transform.position + 50 * this.transform.forward + 50 * this.transform.up; Quaternion oldRot = GameManager.instance.cameraRig.viewpoint.transform.rotation; GameManager.instance.cameraRig.viewpoint.transform.LookAt(this.transform.position); Quaternion newRot = GameManager.instance.cameraRig.viewpoint.transform.rotation; //Apply to platform, and reset raycastCam pos. GameManager.instance.cameraRig.viewpoint.transform.rotation = oldRot; platform.transform.rotation *= ((newRot * Quaternion.Inverse(oldRot))); }
// Use this for initialization void Start() { CatalystPlatform platform = GetComponentInParent <CatalystPlatform>(); platformAnim = platform.GetComponent <Animator> (); MovePanelUp(); controlsPanelActive = true; }
public void SetupGameManagers() { if (this != null && user != null) { platform = user.GetComponentInChildren <CatalystPlatform>(); cameraRig = user.GetComponentInChildren <CAVECameraRig>(); monitor = user.GetComponentInChildren <PlatformMonitor>(); photoController = GetComponentInChildren <PhotoController>(); inputGuide = user.GetComponentInChildren <InputGuideController>(); platform.gameManager = this; } }
// Use this for initialization void Start() { bookmarkIndex = 0; CatalystPlatform platform = GetComponentInParent <CatalystPlatform>(); platformAnim = platform.GetComponent <Animator>(); initActivate = true; initDeactivate = false; parentPlatform = GetComponentInParent <CatalystPlatform>(); }
private void Awake() { if (activePlatform != null) { EnforceSingleton(); } else { activePlatform = this; GameObject topLevelParent = gameObject; while (topLevelParent.transform.parent != null) { topLevelParent = topLevelParent.transform.parent.gameObject; } DontDestroyOnLoad(topLevelParent); } }