示例#1
0
 public void AddItem(enObjId objid)
 {
     if (itemList == null)
     {
         itemList = new List <enObjId>();
     }
     itemList.Add(objid);
 }
示例#2
0
    public static BaseObject CreateObj(enObjId objid)
    {
        MapObjectConf conf = ConfigManager.confMapObjectManager.dic[(int)objid];

        if (conf == null)
        {
            return(null);
        }
        GameObject obj = (GameObject)Resources.Load(conf.prefabName);

        obj = MonoBehaviour.Instantiate(obj);

        BaseObject baseobj = obj.GetComponent <BaseObject>();

        baseobj.conf = conf;
        baseobj.ObjInit();
        return(baseobj);
    }