Пример #1
0
    // Use this for initialization
    void Start()
    {
        //读配置数据
        var levelC = CGameManager.configExcel.Level;

        //手动设置当前关卡,测试使用
        CGameManager.instance.levelCurrent = 31;
        curLevelC = levelC.Find((elem) => elem.ID == CGameManager.instance.levelCurrent);
        //整理地图字典
        GenerateMapObjDic();
        //更换当前等级基础数据
        UpdateBaseMapInfo();
        //生成地图物体
        GenerateMapObj();

        //忽略钩子和虚拟墙的碰撞
        Physics2D.IgnoreCollision(quayTraiC, hookC, true);
        Physics2D.IgnoreCollision(quayPhaiC, hookC, true);

        score          = PlayerPrefs.GetInt("MaxDollar");
        scoreText.text = "$" + score;
        MakeInstance();

        level = 0;
        this.StartCoroutine("Do");

        levelText.text = "LEVEL " + CGameManager.instance.levelCurrent;
        //scoreTarget = CGameManager.instance.GetScoreTarget(CGameManager.instance.levelCurrent);

        SoundControl();
        MusicControl();
        SetButtonMusic();
        SetButtonSound();
        SetNumberBoom();
    }
Пример #2
0
        public LevelDefine GetLevelByID(int ID, LevelDefine def = default(LevelDefine))
        {
            LevelDefine ret;

            if (_LevelByID.TryGetValue(ID, out ret))
            {
                return(ret);
            }

            if (def == default(LevelDefine))
            {
                TableLogger.ErrorLine("GetLevelByID failed, ID: {0}", ID);
            }

            return(def);
        }
Пример #3
0
    private IEnumerator DelayGenerateMapObj()
    {
        yield return(new WaitForSeconds(2f));

        if (true)
        {
            //读配置数据
            var levelC = CGameManager.configExcel.Level;
            //手动设置当前关卡,测试使用
            CGameManager.instance.levelCurrent = 80;
            curLevelC = levelC.Find((elem) => elem.ID == CGameManager.instance.levelCurrent);
            //整理地图字典
            GenerateMapObjDic();
            //生成地图物体
            GenerateMapObj();
        }
    }
Пример #4
0
        public static void Deserialize(LevelDefine ins, tabtoy.DataReader reader)
        {
            int tag = -1;

            while (-1 != (tag = reader.ReadTag()))
            {
                switch (tag)
                {
                case 0x10000:
                {
                    ins.ID = reader.ReadInt32();
                }
                break;

                case 0x10001:
                {
                    ins.Time = reader.ReadInt32();
                }
                break;

                case 0x10002:
                {
                    ins.TargetScore = reader.ReadInt32();
                }
                break;

                case 0x60003:
                {
                    ins.BGM = reader.ReadString();
                }
                break;

                case 0x60004:
                {
                    ins.PersonBg = reader.ReadString();
                }
                break;

                case 0x60005:
                {
                    ins.MapBg = reader.ReadString();
                }
                break;

                case 0x60006:
                {
                    ins.TotalValue = reader.ReadString();
                }
                break;

                case 0x60007:
                {
                    ins.Topic = reader.ReadString();
                }
                break;

                case 0x90008:
                {
                    ins.ObjPos.Add(reader.ReadStruct <Pos>(PosDeserializeHandler));
                }
                break;
                }
            }
        }