Ejemplo n.º 1
0
    public void SetCameraManagementOnGameObject(GameObject go)
    {
        // Get the camera tracker transform and keep reference
        cameraTracker = go.transform;

        if (cameraTracker == null) {
            string errorMessage = "No cameraTracker founded. Add one under that GameObject !";
            Debug.LogError (errorMessage);
            throw new UnityException (errorMessage);
        }

        // Setup orbital camera reference
        orbitalCamRef = ScriptableObject.CreateInstance<OrbitalCameraControllerImpl> ();
        orbitalCamRef.setCamera (Camera.main.GetComponent<Camera>());
        orbitalCamRef.setTracker (cameraTracker);
        orbitalCamRef.InitCam ();

        // Setup normal camera reference (Not used currently in that project)
        autoOrbitalCamRef = ScriptableObject.CreateInstance<AutoOrbitalCameraControllerImpl> ();
        autoOrbitalCamRef.setCamera (Camera.main.GetComponent<Camera>());
        autoOrbitalCamRef.setTracker (cameraTracker);
        autoOrbitalCamRef.InitCam ();
    }
Ejemplo n.º 2
0
    public void SetCameraManagementOnGameObject(GameObject go)
    {
        // Get the camera tracker transform and keep reference
        cameraTracker = go.transform;

        if (cameraTracker == null)
        {
            string errorMessage = "No cameraTracker founded. Add one under that GameObject !";
            Debug.LogError(errorMessage);
            throw new UnityException(errorMessage);
        }

        // Setup orbital camera reference
        orbitalCamRef = ScriptableObject.CreateInstance <OrbitalCameraControllerImpl> ();
        orbitalCamRef.setCamera(Camera.main.GetComponent <Camera>());
        orbitalCamRef.setTracker(cameraTracker);
        orbitalCamRef.InitCam();

        // Setup normal camera reference (Not used currently in that project)
        autoOrbitalCamRef = ScriptableObject.CreateInstance <AutoOrbitalCameraControllerImpl> ();
        autoOrbitalCamRef.setCamera(Camera.main.GetComponent <Camera>());
        autoOrbitalCamRef.setTracker(cameraTracker);
        autoOrbitalCamRef.InitCam();
    }