Пример #1
0
    //--------------------------------------------------------------------------------------------------------------

    #region Constructor

    protected UiBaseJewelState(IUiJewel handler, BaseStateMachine fsm, Battle.UI.Jewel.UiJewelParameters.UiJewelParameters parameters)
    {
      Fsm = fsm;
      Handler = handler;
      Parameters = parameters;
      IsInitialized = true;
    }
Пример #2
0
    /// <summary>
    ///     Remove a card from the pile.
    /// </summary>
    /// <param name="card"></param>
    public virtual void RemoveJewel(IUiJewel jewel)
    {
      if (jewel == null)
        throw new ArgumentNullException("Null is not a valid argument.");

      Jewels.Remove(jewel);

      NotifyPileChange();
    }
Пример #3
0
    //--------------------------------------------------------------------------------------------------------------

    #region Operations

    /// <summary>
    ///     Add a card to the pile.
    /// </summary>
    /// <param name="card"></param>
    public virtual void AddJewel(IUiJewel jewel)
    {
      if (jewel == null)
        throw new ArgumentNullException("Null is not a valid argument.");

      Jewels.Add(jewel);
      jewel.transform.SetParent(transform);
      //Debug.Log("AddJewel");
      //jewel.Renderer.sprite = jewel.Data.Artwork;
      jewel.Initialize();
      NotifyPileChange();
      jewel.Draw();
    }
Пример #4
0
        //--------------------------------------------------------------------------------------------------------------

        public UiJewelIdle(IUiJewel handler, BaseStateMachine fsm, Battle.UI.Jewel.UiJewelParameters.UiJewelParameters parameters) : base(handler, fsm,
                                                                                                                                          parameters)
        {
            DefaultSize = Handler.transform.localScale;
        }
Пример #5
0
 // Link back to the jewel info and set darker when clicked
 public UiJewelOpacity(IUiJewel JewelComponent)
 {
     JewelComponent.UIRuntimeData.OnSetData += Execute;
     JewelComponent.OnPostSelect            += OnPostSelect;
     renderer = JewelComponent.Renderer;
 }
Пример #6
0
        //--------------------------------------------------------------------------------------------------------------

        #region Constructor

        public UiJewelBoardFsm(Camera camera, Battle.UI.Jewel.UiJewelParameters.UiJewelParameters jewelConfigsParameters, IUiJewel handler = null) :
            base(handler)
        {
            JewelConfigsParameters = jewelConfigsParameters;

            IdleState = new UiJewelIdle(handler, this, JewelConfigsParameters);
            //DisableState = new UiCardDisable(handler, this, CardConfigsParameters);
            //DragState = new UiCardDrag(handler, camera, this, CardConfigsParameters);
            //HoverState = new UiCardHover(handler, this, CardConfigsParameters);
            //DrawState = new UiCardDraw(handler, this, CardConfigsParameters);
            //DiscardState = new UiCardDiscard(handler, this, CardConfigsParameters);
            //TargetState = new UiCardTarget(handler, camera, this, cardConfigsParameters);

            RegisterState(IdleState);
            //RegisterState(DisableState);
            //RegisterState(DragState);
            //RegisterState(HoverState);
            //RegisterState(DrawState);
            //RegisterState(DiscardState);
            //RegisterState(TargetState);

            Initialize();
        }