Exemplo n.º 1
0
    void FixedUpdate()
    {
        transform.position = new Vector3(transform.position.x - moveSpeed, transform.position.y, transform.position.z);

        BackgroundScrollEvent scroll = new BackgroundScrollEvent (Time.deltaTime*10, 0);
        GameEvents.GameEventManager.post (scroll);
    }
Exemplo n.º 2
0
    public void Initialization(BackgroundPosition position)
    {
        var sut = new BackgroundScrollEvent(position);

        sut.Position.Should().Be(position);
        sut.ToString().Should().Be("bg scroll");
    }
Exemplo n.º 3
0
    void FixedUpdate()
    {
        transform.position = new Vector3(transform.position.x - moveSpeed, transform.position.y, transform.position.z);

        BackgroundScrollEvent scroll = new BackgroundScrollEvent(Time.deltaTime * 10, 0);

        GameEvents.GameEventManager.post(scroll);
    }
Exemplo n.º 4
0
    void FixedUpdate()
    {
        float movementX = transform.position.x - lastPosition.x;
        float movementY = transform.position.y - lastPosition.y;

        BackgroundScrollEvent scroll = new BackgroundScrollEvent (movementX, movementY);
        GameEvents.GameEventManager.post (scroll);

        lastPosition = transform.position;
    }
Exemplo n.º 5
0
    void FixedUpdate()
    {
        float movementX = transform.position.x - lastPosition.x;
        float movementY = transform.position.y - lastPosition.y;

        BackgroundScrollEvent scroll = new BackgroundScrollEvent(movementX, movementY);

        GameEvents.GameEventManager.post(scroll);

        lastPosition = transform.position;
    }