Beispiel #1
0
    /// <summary>
    /// 加载时更新模型
    /// </summary>
    /// <param name="foodbowid"></param>
    public void InitBuilt(BuildModelVo vo, int foodbow)
    {
        if (tempmodel != null && !tempmodel.ContainsKey(vo.ModeltrsId))
        {
            if (vo.Modelid != 0)
            {
                setmodelfalse(vo);
            }
            List <GameObject> list = new List <GameObject>();
            for (int i = 1; i < 7; i++)
            {
                GameObject            Model = BulitPool.GetInstance().GetBulitPool(i).CreateObject(Buildspts[vo.ModeltrsId].position);
                BuildingBluepointCtrl bl    = Model.AddComponent <BuildingBluepointCtrl>();
                bl.modeltrsID = vo.ModeltrsId;
                bl.isBuild    = true;
                bl.foodBowID  = foodbow;
                list.Add(Model);

                if (i == vo.Modelid)
                {
                    Model.SetActive(true);
                }
                else
                {
                    Model.SetActive(false);
                }
            }
            tempmodel.Add(vo.ModeltrsId, list);
        }
    }
Beispiel #2
0
    private int[] mCurrentCats = new int[] { 1, 2, 3, 4, 5, 6 }; //做好prefab的建筑id 临时存储

    public static BulitPool GetInstance()
    {
        if (mInstance == null)
        {
            mInstance = GameObject.Find("BulitPool").GetComponent <BulitPool>();
        }
        return(mInstance);
    }
Beispiel #3
0
 public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     Debug.Log(scene.name);
     if (scene.name == SceneConst.GameScene)
     {
         //打开游戏界面的时候,需要打开的界面需要注册
         AppFacade.getInstance.SendNotification(NotiConst.INIT_MAIN_MENU_VIEW);
         AppFacade.getInstance.SendNotification(NotiConst.INIT_CUSTOMER_VIEW);
         AppFacade.getInstance.SendNotification(NotiConst.INIT_EMPLOYEE_VIEW);
         AppFacade.getInstance.SendNotification(NotiConst.INIT_CAT_GROUP_MENU_VIEW);
         AppFacade.getInstance.SendNotification(NotiConst.INIT_BUILDING_BLUEPRINT);
         AppFacade.getInstance.SendNotification(NotiConst.INITBUILDINGCHANGE);//注册模型改变
     }
     if (scene.name == SceneConst.BattleScene)
     {
         AppFacade.getInstance.SendNotification(NotiConst.INITBATTLEVIEW);   //注册战斗场景
         BulitPool.GetInstance().DestructAll();
         CatPool.GetInstance().DestructAll();
     }
 }