Exemplo n.º 1
0
        // PRAGMA MARK - Public Interface
        public void SetupWithMoveset(IEnumerable <Move> moveset, IMoveViewContext context)
        {
            this.transform.DestroyAllChildren();

            foreach (Move move in moveset)
            {
                GameObject moveViewObject = Toolbox.GetInstance <ObjectPoolManager>().Instantiate("MoveView");
                moveViewObject.transform.SetParent(this.transform, worldPositionStays: false);

                MoveView moveView = moveViewObject.GetComponent <MoveView>();
                moveView.SetupWithMove(move, context);
            }
        }
        // PRAGMA MARK - Public Interface
        public void SetupWithMove(Move move, IMoveViewContext context)
        {
            this._move    = move;
            this._context = context;

            this._buttonImage.sprite = move.displaySprite;
            if (this._move.OnCooldown)
            {
                this._cooldownTurnsLeftText.enabled = true;
                this._cooldownTurnsLeftText.SetText(string.Format("{0}", this._move.cooldownTurnsLeft));
                this._buttonImage.color   = new Color(1.0f, 1.0f, 1.0f, 0.7f);
                this._button.interactable = false;
            }
            else
            {
                this._cooldownTurnsLeftText.enabled = false;
                this._buttonImage.color             = new Color(1.0f, 1.0f, 1.0f, 1.0f);
                this._button.interactable           = true;
            }
        }