Exemple #1
0
 private void ResetMouseLookTween()
 {
     if (mouseLookTimer != null)
     {
         mouseLookTimer.Cancel();
         isMouseMoving        = false;
         isMouseLooking       = false;
         smoothIsMouseLooking = 0f;
     }
 }
        public virtual void haltCamera()
        {
            lowUpdateTimer.Cancel();
            lowUpdateTimer = null;

            removeDebugVars();
        }
Exemple #3
0
 private void ShowHurtFrame(float duration)
 {
     if (hurtFrameCallback != null)
     {
         hurtFrameCallback.Cancel();
     }
     hurtSprite.Play("hurt");
     hurtFrameCallback = Scene.Callback(duration, hurtSprite.Stop);
 }
Exemple #4
0
 private void CancelFades()
 {
     StopAllCoroutines();
     foreach (AudioSource loopSource in loopSources)
     {
         Tween.Cancel(loopSource.GetInstanceID());
     }
     Fading = false;
 }
Exemple #5
0
    private void PulseText()
    {
        Vector3 startScale = new Vector3(1.0f, 1.0f, 1.0f);
        Vector3 endScale   = new Vector3(1.1f, 1.1f, 1.1f);

        Tween.Cancel(progressText.GetInstanceID());
        Tween.LocalScale(progressText.transform, startScale, endScale, 0.75f, 0, pulseCurve, Tween.LoopType.None);
        Tween.Color(progressText, Color.black, Color.red, 0.75f, 0f, pulseCurve, Tween.LoopType.None);
    }
    private void GeneralReset()
    {
        Tween.Cancel(fallingEnemy.GetInstanceID());
        fallingEnemyAnim.ResetTrigger("die");

        if (screamSound != null)
        {
            Destroy(screamSound);
        }
    }
Exemple #7
0
        private void updateMouseAndGamepadInput(Vehicle veh)
        {
            Vector2 currentMousePosition = new Vector2(InputR.MouseX, InputR.MouseY);

            if ((currentMousePosition.X == 0f && currentMousePosition.Y == 0f))
            {
                return; // Fix for mouse look  to beign fired after return from pause menu or splash screen
            }
            float xMovement = Math.Abs(oldMousePosition.X - currentMousePosition.X);
            float yMovement = Math.Abs(oldMousePosition.Y - currentMousePosition.Y);

            oldMousePosition = currentMousePosition;

            var isGamepadLooking =
                Game.IsControlPressed(2, GTA.Control.LookLeftOnly) ||
                Game.IsControlPressed(2, GTA.Control.LookRightOnly) ||
                Game.IsControlPressed(2, GTA.Control.LookUpOnly) ||
                Game.IsControlPressed(2, GTA.Control.LookDownOnly)
            ;

            if (xMovement > 2.0f || yMovement > 2.0f || isGamepadLooking)
            {
                isMouseMoving  = true;
                isMouseLooking = true;

                //tweener.Tween<CustomCameraV>(this, new { smoothIsFreeLooking = 1f }, 0.01f, 0f).Ease(Ease.SineInOut);
                smoothIsFreeLooking = 1f;

                if (mouseLookTimer != null)
                {
                    mouseLookTimer.Cancel();
                }
                // TODO
                mouseLookTimer = tweener.Timer(isGamepadLooking ? 0.1f : 1.55f).OnComplete(new Action(endFreeLookingSmooth));
            }
            else
            {
                isMouseMoving = false;
            }

            //if (mouseLookTimer != null && mouseLookTimer.Completion == 1f)
            //{
            //    isMouseLooking = false;
            //    mouseLookTimer.Cancel();
            //    mouseLookTimer = null;
            //    tweener.Tween<CustomCameraV>(this, new { smoothIsFreeLooking = 0f }, 0.25f, 0f).Ease(Ease.SineInOut);
            //}

            if (!isMouseLooking)
            {
                // When we are not looking around with mouse, sync gamplaycam heading with mod camera, so radar always shows the right rotation
                GameplayCamera.RelativeHeading = gameCamera.Rotation.Z - veh.Rotation.Z;
            }
        }
Exemple #8
0
        private void Bounce()
        {
            if (bounceTween != null)
            {
                bounceTween.Cancel();
            }
            image.ScaleX = 0.5f;
            image.ScaleY = 1.5f;

            bounceTween = Tweener.Tween(image, new { ScaleX = 1, ScaleY = 1 }, 0.75f)
                          .Ease(Ease.ElasticOut);
        }