예제 #1
0
 public void AddBuildingConf(BuildingConf conf)
 {
     //	Debug.LogError ("conf.id" + conf.id);
     if (buildingConfs.ContainsKey(conf.id))
     {
         return;
     }
     buildingConfs.Add(conf.id, conf);
 }
예제 #2
0
    public override void Start()
    {
        base.Start();
        BuildingConf conf = BuildingConfManager.Instance.GetConfByID(10102);

        if (conf != null)
        {
            data.life    = conf.life;
            data.maxlife = conf.life;
        }
    }
예제 #3
0
    private static void Deserialize(byte[] bytes)
    {
        int startIndex = 0;

        while (startIndex < bytes.Length)
        {
            var conf = new BuildingConf();
            conf.Desearize(bytes, ref startIndex);
            Configs.Add(conf.Id, conf);
        }
    }
예제 #4
0
    public override void Start()
    {
        int classType = data.classtype;

        base.Start();
        BuildingConf conf = BuildingConfManager.Instance.GetBuildingConfById(10102);

        if (conf != null)
        {
            data.life    = conf.life;
            data.maxlife = conf.life;
        }
    }
예제 #5
0
    public override void Start()
    {
        base.Start();
        BuildingConf conf = BuildingConfManager.Instance.GetBuildingConfById(10111);

        if (conf != null)
        {
            data.life           = 20; //conf.life;
            data.maxlife        = 20; //conf.life;
            data.attackRange    = conf.attackRange[1];
            data.searchInterval = 0.1f;
            data.attackInterval = 1.0f;
            data.attackPower    = conf.attack[1];
        }
    }
예제 #6
0
    private void ReadBuilding(CsvReader cr)
    {
        int fieldCount = cr.FieldCount;

        string [] headers = cr.GetFieldHeaders();
        //cr.ReadNextRecord ();// the real head
        while (cr.ReadNextRecord())
        {
            int i = 0;

            BuildingConf conf = new BuildingConf();
            conf.id   = int.Parse(cr[i++]);
            conf.name = cr[i++];
            conf.type = int.Parse(cr[i++]);
            string[] buildRange = cr[i++].Split(';');
            conf.buildRange[0] = int.Parse(buildRange[0]);
            conf.buildRange[1] = int.Parse(buildRange[1]);
            conf.life          = int.Parse(cr[i++]);
            conf.hitRate       = int.Parse(empty2number(cr[i++]));
            conf.attackSpeed   = float.Parse(empty2number(cr[i++]));
            string[] attack = cr[i++].Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);
            if (attack.Length != 0)
            {
                conf.attack[0] = int.Parse(attack[0]);
                conf.attack[1] = int.Parse(attack[1]);
            }
            string[] attackRange = cr[i++].Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);
            if (attackRange.Length != 0)
            {
                conf.attackRange[0] = float.Parse(attackRange[0]);
                conf.attackRange[1] = float.Parse(attackRange[1]);
            }
            conf.attackMode   = int.Parse(empty2number(cr[i++]));
            conf.damageRange  = float.Parse(empty2number(cr[i++]));
            conf.cooldownHit  = int.Parse(empty2number(cr[i++]));
            conf.cooldownTime = float.Parse(empty2number(cr[i++]));
            conf.buffId       = int.Parse(empty2number(cr[i++]));
            conf.level        = int.Parse(empty2number(cr[i++]));
            conf.desc         = cr[i++];
            conf.atlas        = cr[i++];
            BuildingConfManager.Instance.AddBuildingConf(conf);
        }
        //BuildingConfManager.Instance.GetBuildingConfById (0);
    }
예제 #7
0
        public override string GetResPath()
        {
            var conf = BuildingConf.Get(BuildingId);

            return(conf.ResPath);
        }
예제 #8
0
 private void InitConfig()
 {
     ArmyConf.Init();
     BuildingConf.Init();
 }