コード例 #1
0
 protected override void OnCreate()
 {
     InitTrans();
     childMgrComponent = GameUtil.GetOrAddComponent <ChildGoComponent>(MainRoot_RectTransform);
     childMgrComponent.Init(HeadItem_RectTransform);
     itemWidth = HeadItem_RectTransform.rect.width + 10;
 }
コード例 #2
0
    protected override void OnCreate()
    {
        InitTrans();
        childMgr = GameUtil.GetOrAddComponent <ChildGoComponent>(BattleHpRoot_RectTransform);
        childMgr.Init(HUDItem_RectTransform, OnHUDCreate);

        AutoBattle_Toggle.isOn = false;//默认取消
        AutoBattle_Toggle.gameObject.SetActive(false);
        AutoBattle_Toggle.onValueChanged.AddListener(OnAutoBattleValueChange);
    }
コード例 #3
0
    protected override void OnCreate()
    {
        InitTrans();
        childMgr = GameUtil.GetOrAddComponent <ChildGoComponent>(Skills_RectTransform);
        childMgr.Init(SkillItem_RectTransform);

        BindListener(Move_Button, OnMoveClick);
        BindListener(UsePoison_Button, OnUsePoisonClick);
        BindListener(Depoison_Button, OnDepoisonClick);
        BindListener(Heal_Button, OnHealClick);
        BindListener(Item_Button, OnUseItemClick);
        BindListener(Wait_Button, OnWaitClick);
        BindListener(Rest_Button, OnRestClick);
        BindListener(Cancel_Button, OnCancelClick);
    }
コード例 #4
0
    Dictionary <int, int> currentBuyCount = new Dictionary <int, int>();//当前已经购买的物品数量
    protected override void OnCreate()
    {
        InitTrans();
        childMgr = GameUtil.GetOrAddComponent <ChildGoComponent>(ItemRoot_RectTransform);
        childMgr.Init(ScrollItem_RectTransform, (trans) =>
        {
            ShopUIItem item = GameUtil.GetOrAddComponent <ShopUIItem>(trans);
            item.Init();
            BindListener(trans.GetComponent <Button>(), () =>
            {
                OnItemClick(item);
            });
        });

        BindListener(CloseBtn_Button, OnCloseClick);
        BindListener(ConfirmBtn_Button, OnConfirmClick);
    }