예제 #1
0
        public override void init()
        {
            a3_pet_skin.instan = this;
            this.petmodel      = ModelBase <A3_PetModel> .getInstance();

            this.feedid       = this.petmodel.GetFeedItemTpid();
            this.levelid      = this.petmodel.GetLevelItemTpid();
            this.stageid      = this.petmodel.GetStageItemTpid();
            this.currentLevel = this.petmodel.CurrentLevelConf();
            this.currentStage = this.petmodel.CurrentStageConf();
            this.stagestep    = this.currentStage.getUint("crystal_step");
            BaseButton baseButton = new BaseButton(base.getTransformByPath("exp_con/upgrade"), 1, 1);

            baseButton.onClick = new Action <GameObject>(this.OnUpgrade);
            BaseButton baseButton2 = new BaseButton(base.getTransformByPath("exp_con/onekey"), 1, 1);

            baseButton2.onClick = new Action <GameObject>(this.OnOnekey);
            BaseButton baseButton3 = new BaseButton(base.getTransformByPath("lampoil"), 1, 1);

            baseButton3.onClick = new Action <GameObject>(this.OnFeed);
            BaseButton baseButton4 = new BaseButton(base.getTransformByPath("stage_con/improve"), 1, 1);

            baseButton4.onClick = new Action <GameObject>(this.OnStage);
            BaseButton baseButton5 = new BaseButton(base.getTransformByPath("title/help"), 1, 1);

            baseButton5.onClick = new Action <GameObject>(this.OnHelp);
            BaseButton baseButton6 = new BaseButton(base.getTransformByPath("close"), 1, 1);

            baseButton6.onClick = new Action <GameObject>(this.onclose);
            this.autofeed       = base.getComponentByPath <Toggle>("light_hint/toggle");
            this.autofeed.onValueChanged.AddListener(new UnityAction <bool>(this.OnAutoFeedToggleChange));
            this.autobuy = base.getComponentByPath <Toggle>("light_hint/toggle2");
            this.autobuy.onValueChanged.AddListener(new UnityAction <bool>(this.OnAutoBuyToggleChange));
            this.prefab = base.getGameObjectByPath("att/a3_pet_att");
        }
예제 #2
0
        public override void init()
        {
            instan   = this;
            petmodel = A3_PetModel.getInstance();

            feedid  = petmodel.GetFeedItemTpid();
            levelid = petmodel.GetLevelItemTpid();
            stageid = petmodel.GetStageItemTpid();

            currentLevel = petmodel.CurrentLevelConf();
            currentStage = petmodel.CurrentStageConf();
            stagestep    = currentStage.getUint("crystal_step");

            BaseButton upBtn = new BaseButton(getTransformByPath("exp_con/upgrade"));

            upBtn.onClick = OnUpgrade;

            BaseButton onekeyBtn = new BaseButton(getTransformByPath("exp_con/onekey"));

            onekeyBtn.onClick = OnOnekey;

            BaseButton feedBtn = new BaseButton(getTransformByPath("lampoil"));

            feedBtn.onClick = OnFeed;

            BaseButton stageBtn = new BaseButton(getTransformByPath("stage_con/improve"));

            stageBtn.onClick = OnStage;

            BaseButton helpBtn = new BaseButton(getTransformByPath("title/help"));

            helpBtn.onClick = OnHelp;

            BaseButton close_btn = new BaseButton(getTransformByPath("close"));

            close_btn.onClick = onclose;

            autofeed = getComponentByPath <Toggle>("light_hint/toggle");
            autofeed.onValueChanged.AddListener(OnAutoFeedToggleChange);

            autobuy = getComponentByPath <Toggle>("light_hint/toggle2");
            autobuy.onValueChanged.AddListener(OnAutoBuyToggleChange);

            prefab = getGameObjectByPath("att/a3_pet_att");
        }