Exemplo n.º 1
0
    public override void LoadAsset()
    {
        IAssetFactory Factory           = PBDGFactory.GetAssetFactory();
        GameObject    soliderGameObject = Factory.CreatSolider("prefab", m_buildParam.AssetName);

        soliderGameObject.transform.position = m_buildParam.Position;
        soliderGameObject.gameObject.name    = "Soldier";
        m_buildParam.NewBuding.SetGameObject(soliderGameObject);



        if (m_pBDG != null)
        {
            m_pBDG.AddSolider(m_buildParam.NewBuding as ISolider);
            m_pBDG.Add(soliderGameObject, "工兵");
        }
    }
Exemplo n.º 2
0
    public CampSystem(PBDG_GameMain pBDG_Game) : base(pBDG_Game)
    {
        //数据可以是在配置表中取

        //兵营
        Camp camp1 = new Camp("Camp", 5, 2000, "Camp", "RookieCamp", false, "工兵");
        Camp camp2 = new Camp("Camp", 5, 2000, "Camp", "RookieCamp", false, "坦克");

        //所有数据先初始化
        campsList.Add(camp1);
        campsList.Add(camp2);

        for (int i = 0; i < 10; i++)
        {
            IAssetFactory factory = PBDGFactory.GetAssetFactory();
            GameObject    temp    = factory.CreatBuding("CaptiveCamp");
            temp.transform.position = new Vector3(Random.Range(-50, 50), 3.7f, Random.Range(-50, 50));
            pBDG_Game.Add(temp, "建筑物");
        }
    }