Beispiel #1
0
 private void InitialiseLists()
 {
     if (this._orientationList == null)
     {
         this._orientationList = base.get_gameObject().AddComponent <CameraPathOrientationList>();
     }
     if (this._fovList == null)
     {
         this._fovList = base.get_gameObject().AddComponent <CameraPathFOVList>();
     }
     if (this._tiltList == null)
     {
         this._tiltList = base.get_gameObject().AddComponent <CameraPathTiltList>();
     }
     if (this._speedList == null)
     {
         this._speedList = base.get_gameObject().AddComponent <CameraPathSpeedList>();
     }
     if (this._eventList == null)
     {
         this._eventList = base.get_gameObject().AddComponent <CameraPathEventList>();
     }
     if (this._delayList == null)
     {
         this._delayList = base.get_gameObject().AddComponent <CameraPathDelayList>();
     }
     this._orientationList.Init(this);
     this._fovList.Init(this);
     this._tiltList.Init(this);
     this._speedList.Init(this);
     this._eventList.Init(this);
     this._delayList.Init(this);
 }
    private static void SceneGUIFOVBased()
    {
        DisplayAtPoint();

        CameraPathFOVList fovList     = _cameraPath.fovList;
        Camera            sceneCamera = Camera.current;
        int pointCount = fovList.realNumberOfPoints;

        for (int i = 0; i < pointCount; i++)
        {
            CameraPathFOV fovPoint = fovList[i];
            if (_cameraPath.enableUndo)
            {
                Undo.RecordObject(fovPoint, "Modifying FOV Point");
            }
            if (Vector3.Dot(sceneCamera.transform.forward, fovPoint.worldPosition - sceneCamera.transform.position) < 0)
            {
                continue;
            }

            string pointLabel = fovPoint.displayName;
            pointLabel += "\nvalue: " + fovPoint.FOV.ToString("F1");
            if (fovPoint.positionModes == CameraPathPoint.PositionModes.FixedToPoint)
            {
                pointLabel += "\nat point: " + fovPoint.point.displayName;
            }
            else
            {
                pointLabel += "\nat percentage: " + fovPoint.percent.ToString("F3");
            }

            Handles.Label(fovPoint.worldPosition, pointLabel);
            float pointHandleSize = HandleUtility.GetHandleSize(fovPoint.worldPosition) * HANDLE_SCALE;
            Handles.color = (i == selectedPointIndex) ? _cameraPath.selectedPointColour : _cameraPath.unselectedPointColour;
            if (Handles.Button(fovPoint.worldPosition, Quaternion.identity, pointHandleSize, pointHandleSize, Handles.DotCap))
            {
                ChangeSelectedPointIndex(i);
                GUI.changed = true;
            }

            if (i == selectedPointIndex)
            {
                CPPSlider(fovPoint);
            }
        }
    }
Beispiel #3
0
    private void InitialiseLists()
    {
        if(_orientationList == null)
            _orientationList = gameObject.AddComponent<CameraPathOrientationList>();// ScriptableObject.CreateInstance<CameraPathOrientationList>();
        if (_fovList == null)
            _fovList = gameObject.AddComponent<CameraPathFOVList>();//ScriptableObject.CreateInstance<CameraPathFOVList>();
        if (_tiltList == null)
            _tiltList = gameObject.AddComponent<CameraPathTiltList>();//ScriptableObject.CreateInstance<CameraPathTiltList>();
        if (_speedList == null)
            _speedList = gameObject.AddComponent<CameraPathSpeedList>();//ScriptableObject.CreateInstance<CameraPathSpeedList>();
        if (_eventList == null)
            _eventList = gameObject.AddComponent<CameraPathEventList>();//ScriptableObject.CreateInstance<CameraPathEventList>();
        if (_delayList == null)
            _delayList = gameObject.AddComponent<CameraPathDelayList>();//ScriptableObject.CreateInstance<CameraPathDelayList>();

        _orientationList.Init(this);
        _fovList.Init(this);
        _tiltList.Init(this);
        _speedList.Init(this);
        _eventList.Init(this);
        _delayList.Init(this);
    }