Exemplo n.º 1
0
 public void Appear(float time)
 {
     foreach (var alphaData in alphaDatas)
     {
         ApCtrl.AppearAlpha(alphaData, time);
     }
 }
Exemplo n.º 2
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.º 3
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.º 4
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.º 5
0
 public void ReceivePlayerSwapExit(PlayerController fsm, float time)
 {
     ApCtrl.AppearAlpha(alphaData, time);
 }
Exemplo n.º 6
0
 public void FadeOut(float time)
 {
     ApCtrl.AppearAlpha(ad, time);
 }