Ejemplo n.º 1
0
    private void UpdatePosition()
    {
        int x = (int)Mathf.Round(this.transform.localPosition.x / Constance.GRID_GAP);
        int y = -(int)Mathf.Round(this.transform.localPosition.y / Constance.GRID_GAP);

        if (x != this.position.x || y != this.position.y)
        {
            this.position.x = x;
            this.position.y = y;

            BattleControllor.UpdatePosition(this, this.position, this.attribute.volume);
        }
    }
Ejemplo n.º 2
0
    private void UpdatePosition()
    {
        int x = (int)Mathf.Round(this.transform.localPosition.x / Constance.GRID_GAP);
        int y = -(int)Mathf.Round(this.transform.localPosition.y / Constance.GRID_GAP);

        if (x != this.position.x || y != this.position.y)
        {
            this.position.x = x;
            this.position.y = y;

            BattleControllor.UpdatePosition(this, this.position);

            FindFollower();
            TryPickUpItem();
        }
    }
Ejemplo n.º 3
0
    void Update()
    {
        this.spriteRenderer.sortingOrder = -(int)(this.transform.localPosition.y * 10);

        int x = (int)Mathf.Round(this._transform.localPosition.x / Constance.GRID_GAP);
        int y = -(int)Mathf.Round(this._transform.localPosition.y / Constance.GRID_GAP);

        if (x != this.position.x || y != this.position.y)
        {
            this.position.x = x;
            this.position.y = y;

            BattleControllor.UpdatePosition(this, this.position);
        }


        if (this.dead == true)
        {
            return;
        }

        UpdateState();
        TryAttak();
    }