Пример #1
0
 static public int BackOut_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         System.Single a1;
         checkType(l, 1, out a1);
         var ret = Ease.BackOut(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
        private IEnumerator EaseOut(float duration)
        {
            float rotFrom = rotation;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime / duration)
            {
                rotation = rotFrom * (1f - Ease.BackOut(p));
                X        = 0f + -1920f * Ease.CubeInOut(p);
                dotEase  = 1f - p;
                yield return(null);
            }
            dotEase = 0f;
            yield break;
        }
        private IEnumerator BirdRoutine(float delay)
        {
            yield return(delay);

            Level.Add(bird = new BirdNPC(Vector2.Zero, BirdNPC.Modes.None));
            bird.Sprite.Play("flyupIdle");
            Vector2 center    = new Vector2(320f, 180f) / 2f;
            Vector2 topCenter = new Vector2(center.X, 0.0f);
            Vector2 botCenter = new Vector2(center.X, 180f);
            Vector2 from1     = botCenter + new Vector2(40f, 40f);
            Vector2 to1       = center + new Vector2(-32f, -24f);

            for (var t = 0.0f; t < 1.0; t += Engine.DeltaTime / 4f)
            {
                birdScreenPosition = from1 + (to1 - from1) * Ease.BackOut(t);
                yield return(null);
            }

            bird.Sprite.Play("flyupRoll");
            for (var t = 0.0f; t < 1.0; t += Engine.DeltaTime / 2f)
            {
                birdScreenPosition = to1 + new Vector2(64f, 0.0f) * Ease.CubeInOut(t);
                yield return(null);
            }

            Vector2 from2      = birdScreenPosition;
            Vector2 to2        = topCenter + new Vector2(-40f, -100f);
            var     playedAnim = false;

            for (var t = 0.0f; t < 1.0; t += Engine.DeltaTime / 4f)
            {
                if (t >= 0.349999994039536 && !playedAnim)
                {
                    bird.Sprite.Play("flyupRoll");
                    playedAnim = true;
                }

                birdScreenPosition    = from2 + (to2 - from2) * Ease.BigBackIn(t);
                birdScreenPosition.X += t * 32f;
                yield return(null);
            }

            bird.RemoveSelf();
            bird = null;
        }
        public IEnumerator Enter()
        {
            PageIndex         = 0;
            Visible           = true;
            X                 = -1920f;
            turningPage       = false;
            turningScale      = 1f;
            rotation          = 0f;
            dot               = 0f;
            dotTarget         = 0f;
            dotEase           = 0f;
            leftArrowEase     = 0f;
            rightArrowEase    = 0f;
            NextPageBuffer    = VirtualContent.CreateRenderTarget("journal-a", 1610, 1000, false, true, 0);
            CurrentPageBuffer = VirtualContent.CreateRenderTarget("journal-b", 1610, 1000, false, true, 0);

            int num = 0;

            foreach (CustomJournalPage CustomJournalPage in Pages)
            {
                CustomJournalPage.PageIndex = num++;
            }
            Pages[0].Redraw(CurrentPageBuffer);
            //this.cameraStart = this.Overworld.Mountain.UntiltedCamera;
            //this.cameraEnd = this.cameraStart;
            //this.cameraEnd.Position = this.cameraEnd.Position + -this.cameraStart.Rotation.Forward() * 1f;
            //this.Overworld.Mountain.EaseCamera(this.Overworld.Mountain.Area, this.cameraEnd, new float?(2f), true, false);
            //this.Overworld.Mountain.AllowUserRotation = false;
            for (float p = 0f; p < 1f; p += Engine.DeltaTime / 0.4f)
            {
                rotation = -0.025f * Ease.BackOut(p);
                X        = -1920f + 1920f * Ease.CubeInOut(p);
                dotEase  = p;
                yield return(null);
            }
            dotEase = 1f;
            yield break;
        }