Esempio n. 1
0
        private void InitMove(CameraModel model)
        {
            transform.localRotation = Quaternion.AngleAxis(angle, Vector3.right);

            var cameraPos = distance * new Vector3(0, Mathf.Sin(angle * Mathf.Deg2Rad), -Mathf.Cos(angle * Mathf.Deg2Rad));

            Observable.EveryUpdate()
            .Select(_ => target.transform.position)
            .DistinctUntilChanged()
            .Subscribe(targetPos => transform.localPosition = targetPos + cameraPos);
        }
Esempio n. 2
0
        private void Start()
        {
            Model = new CameraModel(moveSpeed);

            InitMove(Model);
        }