Exemplo n.º 1
0
    public IEnumerator SwapCor()
    {
        var   playerPos  = player.PositionWithoutHalo;
        float appearTime = player.swapProperty.disappearTime;

        ApCtrl.AppearAlpha(rlCtrl.lightAlpha, appearTime);
        ApCtrl.AppearAlpha(rlCtrl.spriteAlpha, appearTime);
        yield return(new WaitForSecondsRealtime(appearTime));

        var dir   = playerPos - enemyPos;
        var speed = player.swapProperty.speed;

        rlCtrl.EmissionEnable = true;
        rlCtrl.StartCoroutine(rlCtrl.MoveDirWithNormalOffset(dir
                                                             , speed
                                                             , player.rdLtSwapNormalDis));
        var swapTime = dir.magnitude / speed;

        ApCtrl.DisappearAlpha(rlCtrl.lightAlpha, swapTime);
        ApCtrl.DisappearAlpha(rlCtrl.spriteAlpha, swapTime);
        yield return(new WaitForSecondsRealtime(swapTime));

        yield return(new WaitForSecondsRealtime(2));

        rlCtrl.Destroy();
    }
Exemplo n.º 2
0
 public void Disappear(float time)
 {
     foreach (var alphaData in alphaDatas)
     {
         ApCtrl.DisappearAlpha(alphaData, time);
     }
 }
Exemplo n.º 3
0
    public IEnumerator SwapCor(PlayerController player, Vector2 target)
    {
        follow = false;
        var time      = player.swapProperty.disappearTime;
        var playerPos = player.PositionWithoutHalo;

        rlCtrl.StartCoroutine(rlCtrl.MoveToPos(player.PositionWithoutHalo, time, player.rdLtToPlayerTimeDisCurve));
        yield return(new WaitForSecondsRealtime(time));

        var dir   = target - playerPos;
        var speed = player.swapProperty.speed;

        rlCtrl.EmissionEnable = true;
        rlCtrl.StartCoroutine(rlCtrl.MoveDirWithNormalOffset(dir
                                                             , speed
                                                             , player.rdLtSwapNormalDis));
        var swapTime = dir.magnitude / speed;

        ApCtrl.DisappearAlpha(rlCtrl.lightAlpha, swapTime);
        ApCtrl.DisappearAlpha(rlCtrl.spriteAlpha, swapTime);
        yield return(new WaitForSecondsRealtime(swapTime));

        rlCtrl.EmissionEnable = false;
        yield return(new WaitUntil(() => rlCtrl.lightAlpha.alphaRef.get() == 0));

        yield return(new WaitForSecondsRealtime(2));

        rlCtrl.Destroy();
    }
Exemplo n.º 4
0
    private IEnumerator final()
    {
        btmText.FadeOut(1);
        ctText.FadeOut(1);
        image.FadeOut(1);
        ApCtrl.DisappearAlpha(sourcePriorityAd, 1);
        yield return(new WaitForSeconds(1));

        SceneManager.LoadScene("PrepareMap");
        yield return(null);
    }
Exemplo n.º 5
0
    private IEnumerator swapMoveUpdate(Vector2 dir, float time, float disappearTime)
    {
        ApCtrl.DisappearAlpha(meshAlpha, disappearTime);
        yield return(new WaitForSecondsRealtime(disappearTime));

        SwapMove(dir, time, (pos) => Position = pos, () => Position, this);
        renderer.enabled = false;
        var oriValue = mov.staticExtrusion;

        mov.staticExtrusion = false;
        Timer.CreateAUnscaledTimer(time, () => {
            renderer.enabled    = true;
            mov.staticExtrusion = oriValue;
        }, this);
        yield return(new WaitForSecondsRealtime(time));

        ApCtrl.AppearAlpha(meshAlpha, disappearTime);
    }
Exemplo n.º 6
0
    public IEnumerator EnergeGetedCorou(PlayerController player, Action <Vector2> afterAnim)
    {
        anim.state.TimeScale = 0;
        anim.state.SetAnimation(0, "animation", false);;
        GetComponent <BoxCollider2D>().enabled = false;
        var dir      = (Position.x - player.PositionWithoutHalo.x) > 0 ? Vector2.right : Vector2.left;
        var movTimer = Timer.CreateATimer(disappearTime, null, this);

        movTimer.timerUpdateAction += () => {
            float   dis    = timeDistanceCurve.Evaluate(movTimer.Value);
            Vector2 target = dir.normalized * dis + originPos;
            Position = target;
        };
        var rotTimer = Timer.CreateATimer(disappearTime, null, this);

        rotTimer.timerUpdateAction += () => {
            float rotSpeed = timeRotateSpeedCurve.Evaluate(rotTimer.Value);
            transform.Rotate(Vector3.forward * rotSpeed * Time.deltaTime);
        };
        if (meshAp == null)
        {
            var mesh = anim.GetComponent <MeshRenderer>();
            meshAp = ApCtrl.CreateAlphaData(ApCtrl.SpineMeshAlpha(mesh), this);
        }
        ApCtrl.DisappearAlpha(meshAp, disappearTime);
        if (lightAp == null)
        {
            lightAp = ApCtrl.CreateAlphaData(ApCtrl.LightRendererAlpha(lightRenderer), this);
        }
        ApCtrl.DisappearAlpha(lightAp, disappearTime);
        yield return(new WaitForSeconds(disappearTime));

        afterAnim(Position);
        yield return(new WaitForSeconds(appearTime));

        Position           = originPos;
        transform.rotation = Quaternion.identity;
        ApCtrl.AppearAlpha(meshAp, disappearTime);
        ApCtrl.AppearAlpha(lightAp, disappearTime);
        GetComponent <BoxCollider2D>().enabled = true;
        anim.state.TimeScale = 1;
        anim.state.SetAnimation(0, "animation", true);;
    }
Exemplo n.º 7
0
    private IEnumerator mainProcess()
    {
        ColorScreen.Main.SetColor(Color.black, 0);
        yield return(null);

        ColorScreen.Main.SetColor(Color.clear, 2);
        yield return(new WaitForSeconds(2));

        bgm.Play();
        yield return(new WaitForSeconds(1));

        yield return(new WaitUntil(() => Input.anyKey));

        SoundManager.PlaySound(bgm, "TitleButton");
        StopCoroutine(pressKeyCor);
        StartCoroutine(pressAfterAnim());
        yield return(new WaitForSeconds(pressTime));

        ColorScreen.Main.SetColor(Color.black, 2);
        ApCtrl.DisappearAlpha(bgmAd, 2);
        yield return(new WaitForSeconds(2));

        SceneManager.LoadScene("TitleAnim");
    }
Exemplo n.º 8
0
    public IEnumerator ToEndStoryCor()
    {
        yield return(new WaitUntil(() => controller.currentStateName == "Idle"));

        yield return(new WaitForSeconds(0.5f));

        var loopBgm = GameObject.Find("LoopBgm").GetComponent <AudioSource>();
        var ad      = ApCtrl.CreateAlphaData(ApCtrl.AudioVolumeAlpha(loopBgm), this);

        ApCtrl.DisappearAlpha(ad, 2);
        controller.enabled  = false;
        controller.Velocity = Vector2.zero;
        var bodyView = controller.GetComponentInChildren <BodyView>();

        bodyView.enabled = false;
        bodyView.SetAnimate("stand", true);
        controller.GetComponentInChildren <SkeletonAnimation>().skeleton.FlipX = false;
        ColorScreen.Main.SetColor(Color.black, 2);
        StartCoroutine(toEndStoryCameraMov());
        yield return(new WaitForSecondsRealtime(2));

        SceneManager.activeSceneChanged += destroySomething;
        SceneManager.LoadScene("EndAnim");
    }
Exemplo n.º 9
0
 public void ReceivePlayerSwapEnter(PlayerController fsm, float time)
 {
     ApCtrl.DisappearAlpha(alphaData, time);
 }
Exemplo n.º 10
0
 public void FadeIn(float time)
 {
     ApCtrl.DisappearAlpha(ad, time);
 }