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); } }
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(); } }
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(); }