Пример #1
0
 void Awake()
 {
     #if (UNITY_ANDROID || UNITY_IOS) && (!UNITY_EDITOR)
     controller = new MobileController();
     #else
     controller = new StandaloneController();
     #endif
 }
Пример #2
0
    // Use this for initialization
    void Awake()
    {
        #if (UNITY_ANDROID || UNITY_IOS) && (!UNITY_EDITOR)
        controller = new MobileController();
        #else
        controller = new StandaloneController();
        #endif

        cameraTransform = GetComponentInChildren<Camera> ().gameObject.transform;
    }
Пример #3
0
    /**
      * Move the camera to its initial position.
      */
    void Start()
    {
        #if (UNITY_ANDROID || UNITY_IOS) && (!UNITY_EDITOR)
        controller = new MobileController();
        #else
        controller = new StandaloneController();
        ((StandaloneController)controller).rotateOnFireDown = true;
        #endif

        if (_target != null) {
            Vector2 angles = _target.transform.localEulerAngles;
            if(!_target.GetComponent<CameraPoint>())
            {
                _x = angles.y;
                _y = 0f;
            } else {
                CameraPoint cp = _target.GetComponent<CameraPoint>();
                _x = angles.y;
                _y = cp.startAngle;
                _distance = cp.startDistance;
                _lowAngle = cp.minAngle;
                _highAngle = cp.maxAngle;
                _minDistance = cp.minDistance;
                _maxDistance = cp.maxDistance;
            }
        } else {
            _target = new GameObject("CameraTarget");
            _x = 0f;
            _y = 0f;
        }
        _distanceVector = new Vector3(0.0f,0.0f,-_distance);
        _focusPosition = _target.transform.position;
        hasGyro = SystemInfo.supportsGyroscope;
        if (hasGyro) {
            Input.gyro.enabled = true;
            gyro = Input.gyro;
        }
        StartCoroutine(autoOrbit(3f));
    }
 void Awake()
 {
     controller = (gameObject.AddComponent <MouseDragController>()) as IBasicControlls;
 }