Esempio n. 1
0
 public static ShipCfg GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ShipCfg();
     }
     return(_instance);
 }
Esempio n. 2
0
        public IEnumerator InitCfg()
        {
            //Debug.Log("开始初始化配置:" + Time.time);
            currCount  = -1;
            totalCount = 0;
            ShipCfg.GetInstance().Init("ship", ref totalCount); yield return(new WaitForSeconds(0.02f));

            //MyDebug.Log("初始化配置结束:" + Time.time);
            currCount += 1;
            yield break;
        }
Esempio n. 3
0
    /// <summary>
    /// 模拟数据
    /// </summary>
    private void Simulation()
    {
        MdlFight.GetInstance().enemyList.Clear();
        MdlFight.GetInstance().enemyList.Add(new ActorData(ShipCfg.GetInstance().GetById(100003)));
        MdlFight.GetInstance().enemyList.Add(new ActorData(ShipCfg.GetInstance().GetById(100004)));
        MdlFight.GetInstance().enemyList.Add(new ActorData(ShipCfg.GetInstance().GetById(100002)));
        MdlFight.GetInstance().enemyList.Add(new ActorData(ShipCfg.GetInstance().GetById(100003)));
        MdlFight.GetInstance().enemyList.Add(new ActorData(ShipCfg.GetInstance().GetById(100004)));
        MdlFight.GetInstance().enemyList.Add(new ActorData(ShipCfg.GetInstance().GetById(100002)));

        MdlFight.GetInstance().ourList.Clear();
        MdlFight.GetInstance().ourList.Add(new ActorData(ShipCfg.GetInstance().GetById(100001)));
        MdlFight.GetInstance().ourList.Add(new ActorData(ShipCfg.GetInstance().GetById(100001)));
        MdlFight.GetInstance().ourList.Add(new ActorData(ShipCfg.GetInstance().GetById(100001)));
        MdlFight.GetInstance().ourList.Add(new ActorData(ShipCfg.GetInstance().GetById(100001)));
        MdlFight.GetInstance().ourList.Add(new ActorData(ShipCfg.GetInstance().GetById(100001)));
        MdlFight.GetInstance().ourList.Add(new ActorData(ShipCfg.GetInstance().GetById(100001)));
    }
Esempio n. 4
0
    public void InitTable()
    {
        string data = ConfigUtil.GetConfigData("/Ship/Ship.txt");

        string[] splits = data.Split('\n');
        foreach (string split in splits)
        {
            string line = split.Trim();
            if (line.Length > 0)
            {
                ShipCfg rowdata = new ShipCfg(line);
                mList.Add(rowdata);
            }
            else
            {
                continue;
            }
        }
    }
Esempio n. 5
0
 /// <summary>
 /// 重置配置
 /// </summary>
 public void Reset()
 {
     ShipCfg.GetInstance().Reset();
 }