Esempio n. 1
0
		public override void Go()
		{
			if (By)
				Ease3.GoColorBy(this, Value.GetVector3(), Time, null, Complete.Invoke, Type, Delay, Repeat, PingPong, RealTime);
			else
				Ease3.GoColorTo(this, Value.GetVector3(), Time, null, Complete.Invoke, Type, Delay, Repeat, PingPong, RealTime);
		}
Esempio n. 2
0
 public void Pause()
 {
     Time.timeScale = (_pause = !_pause) ? 0f : _slow ? .1f : _fast ? 2f : 1f;
     _pauseStatus.StopAllCoroutines();
     Ease3.GoColorTo(_pauseStatus, (_pause ? _colorOn : _colorOff).GetVector3(), _time, null, null, EaseType.SineInOut, 0f, 1, false, true);
     Ease3.GoScaleTo(_pauseStatus, _scaleTo, _time, null, () =>
     {
         Ease3.GoScaleTo(_pauseStatus, Vector3.one, _time, null, null, EaseType.BackInOut, 0f, 1, false, true);
     }, EaseType.BackInOut, 0f, 1, false, true);
 }
Esempio n. 3
0
 public override void Go()
 {
     if (By)
     {
         Ease3.GoPositionBy(this, Value, Time, null, Complete.Invoke, Type, Delay, Repeat, PingPong, RealTime);
     }
     else
     {
         Ease3.GoPositionTo(this, Value, Time, null, Complete.Invoke, Type, Delay, Repeat, PingPong, RealTime);
     }
 }
Esempio n. 4
0
        public void CenterOn(Vector2 p, bool animate = false)
        {
            var start  = GameCamera.transform.localPosition;
            var finish = new Vector3(p.x, p.y, start.z);

            if (animate)
            {
                Ease3.Go(this, start, finish, Constants.TimeTween, v => GameCamera.transform.localPosition = v, null);
            }
            else
            {
                GameCamera.transform.localPosition = finish;
            }
        }
Esempio n. 5
0
 public void Fast()
 {
     _slow              = false;
     _slowStatus.color  = _colorOff;
     _pause             = false;
     _pauseStatus.color = _colorOff;
     Time.timeScale     = (_fast = !_fast) ? 2f : 1f;
     _fastStatus.StopAllCoroutines();
     Ease3.GoColorTo(_fastStatus, (_fast ? _colorOn : _colorOff).GetVector3(), _time, null, null, EaseType.SineInOut, 0f, 1, false, true);
     Ease3.GoScaleTo(_fastStatus, _scaleTo, _time, null, () =>
     {
         Ease3.GoScaleTo(_fastStatus, Vector3.one, _time, null, null, EaseType.BackInOut, 0f, 1, false, true);
     }, EaseType.BackInOut, 0f, 1, false, true);
 }
Esempio n. 6
0
 public void SetTargetPosition(Vector3 p, bool animate)
 {
     TargetTarget = new Vector3(p.x, p.y, _t.localPosition.z);
     if (animate)
     {
         AnimateTarget(true);
         if (_easeTargetPosition != null)
         {
             StopCoroutine(_easeTargetPosition);
         }
         _easeTargetPosition = Ease3.Go(this, _t.localPosition, TargetTarget, Constants.TimeTween, v => _t.localPosition = v, null, EaseType.Spring);
     }
     else
     {
         ActivateTarget(false);
         _t.localPosition = TargetTarget;
     }
 }
Esempio n. 7
0
    void Start()
    {
        var scale  = 2;
        var camera = Camera.main;

        if (camera != null)
        {
            var fitX     = (int)(Screen.width / Henry.sprite.rect.width);
            var fitY     = (int)(Screen.height / Henry.sprite.rect.height);
            var newScale = Mathf.Min(fitX, fitY) - 2;
            if (newScale > scale)
            {
                scale = newScale;
            }
        }
        StartCoroutine(PlayDelayed());
        Ease3.GoScaleTo(Henry, new Vector3(scale, scale, 1f), _timeAnimation, null, null, EaseType.BounceOut, _timeDelay);
        Ease3.GoRotationTo(Henry, new Vector3(0f, 0f, 180f), _timeAnimation, null, null, EaseType.BounceOut, _timeDelay);
        Ease3.GoColorTo(this, Color.black.GetVector3(), _timeAnimation, null, Fade, EaseType.BounceOut, _timeDelay);
    }
Esempio n. 8
0
 public void SetTargetPosition(int x, int y, bool animate)
 {
     if (Manager.Instance.TileMap.InsideMap(x, y))
     {
         TargetTarget = new Vector3(x, y, transform.localPosition.z);
         if (animate)
         {
             AnimateTarget(true);
             if (_easeTargetPosition != null)
             {
                 StopCoroutine(_easeTargetPosition);
             }
             _easeTargetPosition = Ease3.Go(this, transform.localPosition, TargetTarget, Constants.TimeTween, v => transform.localPosition = v, null, EaseType.Spring);
         }
         else
         {
             ActivateTarget(false);
             transform.localPosition = TargetTarget;
         }
     }
 }
Esempio n. 9
0
        void Spring(Vector2 delta)
        {
            var p        = GameCamera.transform.localPosition;
            var isDeltaX = !Mathf.Approximately(delta.x, 0f);
            var x        = isDeltaX ? p.x + delta.x : Mathf.RoundToInt(p.x);
            var isDeltaY = !Mathf.Approximately(delta.y, 0f);
            var y        = isDeltaY ? p.y + delta.y : Mathf.RoundToInt(p.y);
            var to       = new Vector3(x, y, p.z);

            if (_spring != null)
            {
                StopCoroutine(_spring);
            }
            _spring = Ease3.Go(this, p, to, Constants.TimeTween, v =>
            {
                GameCamera.transform.localPosition = v;
                if (isDeltaX || isDeltaY)
                {
                    MiniMap.Instance.UpdateMiniMap(v);
                }
            }, () => MiniMap.Instance.UpdateMiniMap(GameCamera.transform.localPosition), EaseType.Spring);
        }
Esempio n. 10
0
        private void Spring(Vector2 delta)
        {
            var p        = GameCamera.transform.localPosition;
            var isDeltaX = !Mathf.Approximately(delta.x, 0f);
            var x        = p.x + delta.x;
            var isDeltaY = !Mathf.Approximately(delta.y, 0f);
            var y        = p.y + delta.y;
            var center   = Map.BackMap.GetCellCenterWorld(new Vector3Int((int)x, (int)y, 0));
            var to       = new Vector3(center.x, center.y, p.z);

            if (_spring != null)
            {
                StopCoroutine(_spring);
            }
            _spring = Ease3.Go(this, p, to, Constants.TimeTween, v =>
            {
                GameCamera.transform.localPosition = v;
                if (isDeltaX || isDeltaY)
                {
                    MiniMap.UpdateMiniMap(v);
                }
            }, () => MiniMap.UpdateMiniMap(GameCamera.transform.localPosition), EaseType.Spring);
        }