Exemplo n.º 1
0
    public void Init(MapObjectConf conf, int islock)
    {
        this.conf = conf;

        sprite            = transform.GetComponent <UISprite>();
        sprite.spriteName = conf.prefabName;

        bg = transform.Find("bg").GetComponent <UISprite>();

        btn = transform.GetComponent <UIButton>();
        btn.normalSprite = conf.prefabName;

        priceObj = transform.Find("price").gameObject;

        nofullAction = priceObj.transform.Find("ComboIcon").GetComponent <NofullAction>();

        if (conf.price != -1 && islock == 0)
        {
            UILabel priceLabel = nofullAction.transform.Find("CountLabel").GetComponent <UILabel>();
            priceLabel.text = conf.price + "";
        }
        else
        {
            priceObj.SetActive(false);
        }

        GameUIEventListener.Get(gameObject).onClick = Sel;
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     for (int i = 0; i < btns.Length; i++)
     {
         GameUIEventListener.Get(btns[i]).onClick = BtnCB;
     }
 }
Exemplo n.º 3
0
 public virtual void Init()
 {
     if (closeBtn != null)
     {
         GameUIEventListener.Get(closeBtn).onClick = CloseBtn;
     }
 }
Exemplo n.º 4
0
 public void Start()
 {
     GameUIEventListener.Get(delBtn).onClick     = DelCB;
     GameUIEventListener.Get(equipBtn).onClick   = EquipCB;
     GameUIEventListener.Get(unequipBtn).onClick = UnEquipCB;
     SetData(null);
 }
Exemplo n.º 5
0
    private void Start()
    {
        GameUIEventListener.Get(createRoleBtn).onClick = CreateRoleCB;

        GameUIEventListener.Get(startBtn).onClick = StartCB;

        GameUIEventListener.Get(delBtn).onClick = DelCB;
    }
Exemplo n.º 6
0
    // Use this for initialization
    public void Init(CharacterConf conf)
    {
        this.conf = conf;

        nameLabel.text = conf.name;

        GameUIEventListener.Get(gameObject).onClick = ChooseSelf;
    }
Exemplo n.º 7
0
    public virtual void Show()
    {
        GameObject maskLayer = NGUITools.AddChild(gameObject, Resources.Load("Prefabs/UI/maskbg") as GameObject);

        if (closeBtn)
        {
            GameUIEventListener.Get(closeBtn).onClick = Hide;
        }
    }
Exemplo n.º 8
0
    /// <summary>
    /// Get or add an event listener to the specified game object.
    /// </summary>

    static public GameUIEventListener Get(GameObject go)
    {
        GameUIEventListener listener = go.GetComponent <GameUIEventListener>();

        if (listener == null)
        {
            listener = go.AddComponent <GameUIEventListener>();
        }
        return(listener);
    }
Exemplo n.º 9
0
    public override void Init()
    {
        base.Init();

        GameObject startBtn = transform.Find("StartGame").gameObject;

        GameUIEventListener.Get(startBtn).onClick = StartCB;

        GameObject backBtn = transform.Find("Back").gameObject;

        GameUIEventListener.Get(backBtn).onClick = BackCB;

        GameObject watchBtn = transform.Find("WatchAD").gameObject;

        GameUIEventListener.Get(watchBtn).onClick = WatchAD;

        UILabel watchADCountLabel = watchBtn.transform.Find("Label").GetComponent <UILabel>();

        watchADCountLabel.text = "+" + GameConst.WATCH_AD_REWAER_COUNT;

        itemList = transform.Find("ItemList").GetComponent <UIScrollView>();


        //combo label
        combolabel = transform.Find("TopLeft").Find("ComboIcon").Find("CountLabel").GetComponent <GamePadScoresLabel>();
        int combocount = PlayerPrefs.GetInt(GameConst.USERDATANAME_COMBO_COUNT, 0);

        combolabel.Init(combocount);
        combolabel.SetScores(combocount);

        //item list
        UIGrid grid = itemList.transform.Find("Grid").GetComponent <UIGrid>();

        List <MapObjectConf> objList = ConfigManager.confMapObjectManager.datas;

        GameObject itemObjRes = Resources.Load("Prefabs/UI/ShopInGameObjItem") as GameObject;

        int selRole = PlayerPrefs.GetInt(GameConst.USERDATANAME_SELECT_ROLE, 0);

        for (int i = 0; i < objList.Count; i++)
        {
            MapObjectConf     conf    = objList[i];
            GameObject        itemObj = NGUITools.AddChild(grid.gameObject, itemObjRes);
            ShopInGameObjItem item    = itemObj.GetComponent <ShopInGameObjItem>();

            int islock = PlayerPrefs.GetInt(GameConst.USERDATANAME_UNLOCK_ROLE + conf.objid, 0);
            item.Init(conf, islock);

            objItemList.Add(item);
            item.SetColor((conf.price != -1 && islock == 0) ? lockColor : unLockColor,
                          selRole == conf.objid ? selColor : normalColor);
        }
        grid.Reposition();
        itemList.ResetPosition();
    }
Exemplo n.º 10
0
    public void Refresh()
    {
        InGameBaseCharacter role = InGameManager.GetInstance().inGamePlayerManager.GetRole();

        desLabel.text = string.Format(conf.boardDes, role.propertys.propertyValues[conf.id].ToString("f2"));

        if (addBtn != null && role.GetData().levelupPoint > 0)
        {
            GameUIEventListener.Get(addBtn).onClick = AddBtnCB;
        }
    }
Exemplo n.º 11
0
    public override void Init()
    {
        base.Init();
        GameObject homeBtn = transform.Find("homeBtn").gameObject;

        GameUIEventListener.Get(homeBtn).onClick = HomeBtnCB;

        GameObject nextBtn = transform.Find("nextBtn").gameObject;

        GameUIEventListener.Get(nextBtn).onClick = NextBtnCB;
    }
Exemplo n.º 12
0
    public override void Init()
    {
        base.Init();
        reviveBtn = transform.Find("reviveBtn").gameObject;
        GameUIEventListener.Get(reviveBtn).onClick = Revive;

        cancelBtn = transform.Find("cancelBtn").gameObject;
        GameUIEventListener.Get(cancelBtn).onClick = Cancel;

        timeLabel = transform.Find("Time").GetComponent <GamePadScoresLabel>();
        timeLabel.Init(5);
    }
Exemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        GameObject continueBtn = transform.Find("continueBtn").gameObject;

        GameUIEventListener.Get(continueBtn).onClick = ContinueBtn;

        GameObject homeBtn = transform.Find("homeBtn").gameObject;

        GameUIEventListener.Get(homeBtn).onClick = HomeBtn;

        GameObject replayBtn = transform.Find("replayBtn").gameObject;

        GameUIEventListener.Get(replayBtn).onClick = ReplayBtn;
    }
Exemplo n.º 14
0
    public override void Init()
    {
        base.Init();

        GameUIEventListener.Get(openPackageBtn).onClick = OpenPackageBtnCB;
        GameUIEventListener.Get(playerInfoBtn).onClick  = PlayerInfoBtnCB;
        GameUIEventListener.Get(smallMapBtn).onClick    = SmallMapBtnCB;

        EventManager.Register(this,
                              EventID.EVENT_UI_INITMAPTEXTURE,
                              EventID.EVENT_GAME_INITROLE,
                              EventID.EVENT_DATA_CHANGELIFE,
                              EventID.EVENT_DATA_CHANGEEXP);
    }
Exemplo n.º 15
0
    public override void Init()
    {
        base.Init();
        GameObject exitbtn = transform.Find("exit").gameObject;

        GameUIEventListener.Get(exitbtn).onClick = ExitBtn;

        GameObject replaybtn = transform.Find("replay").gameObject;

        GameUIEventListener.Get(replaybtn).onClick = ReplayBtn;

        scoreLabel = transform.Find("scores").GetComponent <UILabel>();


        bestLabel = transform.Find("Best").GetComponent <UILabel>();
    }
Exemplo n.º 16
0
    public override void Init()
    {
        base.Init();
        GameObject exitbtn = transform.Find("exit").gameObject;

        GameUIEventListener.Get(exitbtn).onClick = ExitBtn;

        GameObject replaybtn = transform.Find("replay").gameObject;

        GameUIEventListener.Get(replaybtn).onClick = ReplayBtn;

        scoreLabel = transform.Find("scores").GetComponent <UILabel>();


        int selmodel   = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);
        int bestscores = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL_MAXSCORES + selmodel);

        UILabel bestLabel = transform.Find("Best").GetComponent <UILabel>();

        bestLabel.text = "Best:" + bestscores;
    }
Exemplo n.º 17
0
    public override void Init()
    {
        base.Init();
        scoreslabel = transform.Find("scores").Find("Label").GetComponent <GamePadScoresLabel>();
        scoreslabel.Init(0);
        Transform comboIcom = transform.Find("TopLeft").Find("ComboIcon");

        combolabel = comboIcom.Find("CountLabel").GetComponent <GamePadScoresLabel>();
        combolabel.Init(combocount);
        combocount = PlayerPrefs.GetInt(GameConst.USERDATANAME_COMBO_COUNT, 0);
        combolabel.SetScores(combocount);

        Camera  uicamera  = GameObject.Find("UI Root").transform.Find("Camera").GetComponent <Camera>();
        Vector3 screenpos = uicamera.WorldToScreenPoint(comboIcom.position);

        comboLabelPos = GameCommon.ScreenPositionToWorld(InGameManager.GetInstance().gamecamera, screenpos);


        GameObject pausebtn = transform.Find("TopRight").Find("pause").gameObject;

        GameUIEventListener.Get(pausebtn).onClick = PauseBtnCB;
    }
Exemplo n.º 18
0
    // Use this for initialization
    void Start()
    {
        GameObject startBtn = GameObject.Find("UI Root").transform.Find("StartGame").gameObject;

        GameUIEventListener.Get(startBtn).onClick = StartCB;
        GameObject chooseRoleBtn = GameObject.Find("UI Root").transform.Find("ChooseRoleBtn").gameObject;

        GameUIEventListener.Get(chooseRoleBtn).onClick = ChooseRoleCB;

        GameObject clearDataBtn = GameObject.Find("UI Root").transform.Find("ClearDataBtn").gameObject;

        GameUIEventListener.Get(clearDataBtn).onClick = ClearDataCB;

        GameObject equipobj = (GameObject)Resources.Load("Prefabs/items/item_icon");

        equipobj = MonoBehaviour.Instantiate(equipobj);

        InGameBaseEquip equip = equipobj.GetComponent <InGameBaseEquip>();

        equip.Init(-1, 200001, enMSCamp.en_camp_item);
        equip.level = 1;
    }
Exemplo n.º 19
0
    public void Init(EquipData data)
    {
        this.data = data;
        GameUIEventListener.Get(delBtn).onClick   = DelCB;
        GameUIEventListener.Get(equipBtn).onClick = EquipCB;

        EquipConf conf = ConfigManager.equipConfManager.dic[data.equipid];

        if (conf == null)
        {
            return;
        }

        iconSprite.spriteName = conf.prefabname;
        titleLabel.text       = conf.name;

        basePropertyLabel.text = "";

        EquipProperty mainp     = data.propertyList[0];
        PropertyConf  mainpconf = ConfigManager.propertyConfManager.dataMap[mainp.id];

        typeLabel.text = "";
        //lvLabel.text = 1+"";

        string propertyText = "";

        for (int i = 1; i < data.propertyList.Count; i++)
        {
            EquipProperty p     = data.propertyList[i];
            PropertyConf  pconf = ConfigManager.propertyConfManager.dataMap[p.id];

            propertyText += string.Format(pconf.des, p.val) + "\n";
        }

        propertyLabel.text = propertyText;

        Show();
    }
Exemplo n.º 20
0
    // Use this for initialization
    void Start()
    {
        AudioManager.Instance.PlayBG("sound/bgm");

        Transform  menu     = GameObject.Find("UI Root").transform.Find("Menu");
        GameObject startBtn = menu.Find("StartGame").gameObject;

        GameUIEventListener.Get(startBtn).onClick = StartCB;

        GameObject storyBtn = menu.Find("Story").gameObject;

        GameUIEventListener.Get(storyBtn).onClick = StoryCB;

        GameObject infinityBtn = menu.Find("Infinity").gameObject;

        GameUIEventListener.Get(infinityBtn).onClick = InfinityCB;


        GameObject leaderBoardBtn = menu.Find("Anchor").Find("LeaderBoard").gameObject;

        GameUIEventListener.Get(leaderBoardBtn).onClick = ShowLB;


        GameObject noADBtn = menu.Find("Anchor").Find("NoAD").gameObject;

        GameUIEventListener.Get(noADBtn).onClick = NoADCB;

        int noad = PlayerPrefs.GetInt("noad", 0);

        if (noad == 1)
        {
            noADBtn.SetActive(false);
        }

        GameObject starBtn = menu.Find("Anchor").Find("Star").gameObject;

        GameUIEventListener.Get(starBtn).onClick = StarCB;
    }
Exemplo n.º 21
0
    // Use this for initialization
    public void Init()
    {
        GameObject createBtn = transform.Find("Bottom").Find("CreateBtn").gameObject;

        GameUIEventListener.Get(createBtn).onClick = CreateCB;

        GameObject backBtn = transform.Find("Bottom").Find("BackBtn").gameObject;

        GameUIEventListener.Get(backBtn).onClick = BackCB;

        List <CharacterConf> roleList = ConfigManager.characterConfManager.dicByType[(int)CharacterConf.enCharacterType.character];

        for (int i = 0; i < roleList.Count; i++)
        {
            GameObject         obj  = NGUITools.AddChild(createRoleGrid, createRoleListItem);
            CreateRoleListItem item = obj.GetComponent <CreateRoleListItem>();
            item.Init(roleList[i]);
            if (selid == -1)
            {
                selid = roleList[i].id;
            }
        }
        createRoleGrid.GetComponent <UIGrid>().Reposition();
    }
Exemplo n.º 22
0
 // Use this for initialization
 void Start()
 {
     GameUIEventListener.Get(gameObject).onClick = Click;
 }
Exemplo n.º 23
0
    // Use this for initialization
    void Start()
    {
        AudioManager.Instance.PlayBG("sound/bgm");

        Transform  menu     = GameObject.Find("UI Root").transform.Find("Menu");
        GameObject startBtn = menu.Find("StartGame").gameObject;

        GameUIEventListener.Get(startBtn).onClick = StartCB;


        GameObject leaderBoardBtn = menu.Find("Anchor").Find("LeaderBoard").gameObject;

        GameUIEventListener.Get(leaderBoardBtn).onClick = ShowLB;


        GameObject noADBtn = menu.Find("Anchor").Find("NoAD").gameObject;

        GameUIEventListener.Get(noADBtn).onClick = NoADCB;

        int noad = PlayerPrefs.GetInt("noad", 0);

        if (noad == 1)
        {
            noADBtn.SetActive(false);
        }

        GameObject starBtn = menu.Find("Anchor").Find("Star").gameObject;

        GameUIEventListener.Get(starBtn).onClick = StarCB;

        yesObj = menu.Find("Yes").gameObject;

        GameObject modelList       = menu.Find("ModelList").gameObject;
        GameObject modelScoresList = menu.Find("ModelScoresList").gameObject;
        int        selmodel        = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);

        for (int i = 0; i < GameConst.gameModels.Length; i++)
        {
            GameObject modelObj = NGUITools.AddChild(modelList, Resources.Load("Prefabs/UI/GameModel") as GameObject);
            modelObj.transform.localPosition          = new Vector3(0, -80 * i, 0);
            GameUIEventListener.Get(modelObj).onClick = SelModel;

            modelObj.name = GameConst.gameModels[i].modelid + "";

            UILabel namelabel = modelObj.transform.Find("Label").GetComponent <UILabel>();
            namelabel.text = GameConst.gameModels[i].name;


            GameObject scoresObj = NGUITools.AddChild(modelScoresList, Resources.Load("Prefabs/UI/ModelScores") as GameObject);
            scoresObj.transform.localPosition = Vector3.zero;

            int basescores = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL_MAXSCORES + GameConst.gameModels[i].modelid);
            int lastscores = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL_LASTSCORES + GameConst.gameModels[i].modelid);

            UILabel bestScoresLabel = scoresObj.transform.Find("Best").Find("Label").GetComponent <UILabel>();
            bestScoresLabel.text = basescores + "";

            UILabel lastScoresLabel = scoresObj.transform.Find("Last").Find("Label").GetComponent <UILabel>();
            lastScoresLabel.text = lastscores + "";

            InGameUIBaseLayer baselayer = scoresObj.GetComponent <InGameUIBaseLayer>();
            scoresList.Add(GameConst.gameModels[i].modelid, baselayer);
            baselayer.Init();

            scoresObj.SetActive(false);
            if (selmodel == GameConst.gameModels[i].modelid)
            {
                yesObj.transform.position = new Vector3(yesObj.transform.position.x, modelObj.transform.position.y, 0);
                baselayer.Show();
            }
        }
    }
Exemplo n.º 24
0
 void Start()
 {
     GameUIEventListener.Get(gameObject).onClick = ChooseSelf;
 }
Exemplo n.º 25
0
    // Use this for initialization
    void Start()
    {
        //PlayerPrefs.SetInt(GameConst.USERDATANAME_COMBO_COUNT,42435);

        AudioManager.Instance.PlayBG("sound/bgm");

        Transform menu = GameObject.Find("UI Root").transform.Find("Menu");

        UILabel bestScores = menu.Find("BestScores").GetComponent <UILabel>();

        int selmodel   = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);
        int bestscores = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL_MAXSCORES + selmodel);

        bestScores.text = "" + bestscores;

        GameObject startBtn = menu.Find("StartGame").gameObject;

        GameUIEventListener.Get(startBtn).onClick = StartCB;

        GameObject shopBtn = menu.Find("Shop").gameObject;

        GameUIEventListener.Get(shopBtn).onClick = ShopCB;

        menuLayer = menu.GetComponent <OutGameUIBaseLayer>();
        menuLayer.Init();
        menuLayer.gameObject.SetActive(true);

        Transform shop = GameObject.Find("UI Root").transform.Find("Shop");

        shopLayerManager = shop.GetComponent <ShopLayerManager>();
        shopLayerManager.Init();
        shopLayerManager.gameObject.SetActive(false);

        GameObject storyBtn = menu.Find("Story").gameObject;

        GameUIEventListener.Get(storyBtn).onClick = StoryCB;

        GameObject infinityBtn = menu.Find("Infinity").gameObject;

        GameUIEventListener.Get(infinityBtn).onClick = InfinityCB;


        GameObject leaderBoardBtn = menu.Find("Anchor").Find("LeaderBoard").gameObject;

        GameUIEventListener.Get(leaderBoardBtn).onClick = ShowLB;


        GameObject noADBtn = menu.Find("Anchor").Find("NoAD").gameObject;

        GameUIEventListener.Get(noADBtn).onClick = NoADCB;

        GameObject rePayBtn = menu.Find("Anchor").Find("Repay").gameObject;

        GameUIEventListener.Get(rePayBtn).onClick = RePayBtnCB;

        int noad = PlayerPrefs.GetInt("noad", 0);

        if (noad == 1)
        {
            noADBtn.SetActive(false);
        }

        GameObject starBtn = menu.Find("Anchor").Find("Star").gameObject;

        GameUIEventListener.Get(starBtn).onClick = StarCB;


        soundOpenBtn = menu.Find("Top").Find("Soundopen").gameObject;
        GameUIEventListener.Get(soundOpenBtn).onClick = SoundOpen;

        soundCloseBtn = menu.Find("Top").Find("Soundclose").gameObject;
        GameUIEventListener.Get(soundCloseBtn).onClick = SoundClose;


        if (AudioManager.Instance.MusicSize > 0)
        {
            SoundOpen(null);
        }
        else
        {
            SoundClose(null);
        }
    }
Exemplo n.º 26
0
 // Use this for initialization
 void Start()
 {
     GameUIEventListener.Get(startBtn).onClick = StartCB;
 }