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