public void Fade(float time)
    {
        if (!faded)
        {
            StartCoroutine(FadeAlpha(time));

            faded = true;

            Image i = (CustomInput.GetHorizontalInput() == -1) ? left : right;
            Color c = i.color;
            i.color = new Color(c.r, c.g, c.b, c.a / 2);
        }
    }
Пример #2
0
    protected override void Update()
    {
        base.Update();

        input = CustomInput.GetHorizontalInput();
        if (!Game.main.gameover)
        {
            Move(input * moveSpeed * Vector2.right);
        }
        else
        {
            gravity = 0;
        }

        if (transform.position.x + behindLimit > activeLimit)
        {
            activeLimit = transform.position.x + behindLimit;
        }
    }