//重置 public void Reset() { m_Crc = 0; m_CloneObj = null; m_bClear = false; m_Guid = 0; m_Already = false; m_SetSceneParent = false; m_DealFinish = null; m_Params = null; m_offlineData = null; }
/// <summary> /// 根据实例化对象直接获取离线数据 /// </summary> /// <returns></returns> public OfflineData FindOfflineData(GameObject obj) { OfflineData data = null; ResourceObj resObj = null; m_ResObjDic.TryGetValue(obj.GetInstanceID(), out resObj); if (resObj != null) { data = resObj.m_offlineData; } return(data); }
public static void CreateOfflineData(string prefabPath) { GameObject go = PrefabUtility.LoadPrefabContents(prefabPath); OfflineData offlineData = go.GetComponent <OfflineData>(); if (offlineData == null) { offlineData = go.AddComponent <OfflineData>(); } offlineData.BindData(); Debug.Log("修改了" + go.name + " prefab!"); PrefabUtility.SaveAsPrefabAsset(go, prefabPath); PrefabUtility.UnloadPrefabContents(go); Resources.UnloadUnusedAssets(); AssetDatabase.Refresh(); }