Exemple #1
0
        public static void Move(TargetType type, float time)
        {
            Vector3 targetPos;
            Vector3 targetRot;

            INSTANCE.isGame   = type != TargetType.Opening;
            INSTANCE.isMoving = true;

            if (INSTANCE.isGame)
            {
                targetPos = INSTANCE.gamePosition;
                targetRot = INSTANCE.gameRotation;

                if (type == TargetType.A)
                {
                    targetRot.y = -targetRot.y;
                }
            }
            else
            {
                targetPos = INSTANCE.openingPosition;
                targetRot = INSTANCE.openingRotation;
            }

            Sound.Play(INSTANCE.clip);
            INSTANCE.transform.DOLocalMove(targetPos, time)
            .SetEase(Ease.InOutBack)
            .OnComplete(() => {
                ViceCamera.OnEndEvent(type);
                INSTANCE.isMoving = false;
            });
            INSTANCE.transform.DOLocalRotate(targetRot, time)
            .SetEase(Ease.InOutBack);
        }
Exemple #2
0
        protected new void Awake()
        {
            base.Awake();

            INSTANCE    = this;
            this.camera = this.GetComponent <Camera>();
        }
Exemple #3
0
 public static void Shake(Vector4 value)
 {
     ViceCamera.Shake(value, value.w);
 }