public void Init(int _idx, DBCraftingTable _runtimeTable)
 {
     idx          = _idx;
     runtimeTable = _runtimeTable;
     state        = new CLStateUpdator <State>();
     state.Init(OnCheckState, OnSetState, OnUpdateState);
     selected.Subscribe(isOn => {
         if (isOn == true)
         {
             gameObject.CLGetComponent <RectTransform>("Image").DOScale(Vector3.one * 2.0f, 0.2f);
         }
         else
         {
             gameObject.CLGetComponent <RectTransform>("Image").DOScale(Vector3.one, 0.2f);
         }
     });
     currentItem.Subscribe(item => {
         if (item == null)
         {
             gameObject.CLGetComponent <Image>("Image").sprite = null;
         }
         else
         {
             var staticItem = staticData.GetByID <GDCraftRecipeData>(item.recipeID).rewardArr[0].item;
             gameObject.CLGetComponent <Image>("Image").sprite = sprite.GetItem(staticItem.imageName);
         }
     });
 }
Example #2
0
//		ReactiveProperty<DBCraftingItem> currentMaking = new ReactiveProperty<DBCraftingItem>();
        public void Init(DBCraftingTable _table)
        {
            runtimeTable = _table;
            staticTable  = staticData.GetByID <GDCraftingTable>(runtimeTable.craftingTableID);
            state        = new CLStateUpdator <State>();
            state.Init(OnCheckState, OnSetState, OnUpdateState);
        }
Example #3
0
    public override void OnInitialize(params object[] args)
    {
        base.OnInitialize(args);
        runtimeTable = args[0] as DBCraftingTable;
        staticTable  = staticData.GetByID <GDCraftingTable>(runtimeTable.craftingTableID);

        view = viewManager.CreateView("Popup/Craft", "Popup");
        BindInstance();
        BindLogic();
    }
Example #4
0
        public void Init(DBCraftingTable _table, int _idx)
        {
            runtimeTable = _table;
            idx          = _idx;
            staticTable  = staticData.GetByID <GDCraftingTable>(runtimeTable.craftingTableID);
            state        = new CLStateUpdator <State>();
            state.Init(OnCheckState, OnSetState, OnUpdateState);

            gameObject.CLOnClickAsObservable("State/Expand").Subscribe(_ => {
                //Popup..
            });
        }