public override ExportPointer CreateExportPointer(Object asset, bool isLocal) { if (isLocal) { throw new NotSupportedException(); } MonoScript script = m_scripts[asset]; if (!MonoScript.IsReadAssemblyName(script.File.Version, script.File.Flags) || s_unityEngine.IsMatch(script.AssemblyName)) { if (MonoScript.IsReadNamespace(script.File.Version)) { int fileID = Compute(script.Namespace, script.ClassName); return(new ExportPointer(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset))); } else { ScriptIdentifier scriptInfo = script.GetScriptID(); if (!scriptInfo.IsDefault) { int fileID = Compute(scriptInfo.Namespace, scriptInfo.Name); return(new ExportPointer(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset))); } } } long exportID = GetExportID(asset); GUID uniqueGUID = script.GUID; return(new ExportPointer(exportID, uniqueGUID, AssetExporter.ToExportType(asset))); }
public ScriptExportType GetExportType(ScriptExportManager exportManager) { ScriptIdentifier scriptID = IsReadNamespace(File.Version) ? File.AssemblyManager.GetScriptID(AssemblyName, Namespace, ClassName) : File.AssemblyManager.GetScriptID(AssemblyName, ClassName); return(File.AssemblyManager.GetExportType(exportManager, scriptID)); }
public bool IsScriptPresents() { ScriptIdentifier scriptID = IsReadNamespace(File.Version) ? File.AssemblyManager.GetScriptID(AssemblyName, Namespace, ClassName) : File.AssemblyManager.GetScriptID(AssemblyName, ClassName); return(File.AssemblyManager.IsPresent(scriptID)); }
public ScriptExportType GetExportType(ScriptExportManager exportManager, ScriptIdentifier scriptID) { if (ScriptingBackend == ScriptingBackend.Unknown) { throw new Exception("You have to set backend first"); } return(m_manager.GetExportType(exportManager, scriptID)); }
public SerializableType GetSerializableType(ScriptIdentifier scriptID) { TypeDefinition type = FindType(scriptID); if (type == null) { throw new ArgumentException($"Can't find type {scriptID.UniqueName}"); } return(new MonoType(this, type)); }
public bool IsValid(ScriptIdentifier scriptID) { TypeDefinition type = FindType(scriptID); if (type == null) { return(false); } return(IsTypeValid(type, s_emptyArguments)); }
public SerializableType GetSerializableType(ScriptIdentifier scriptID) { string uniqueName = scriptID.UniqueName; if (m_serializableTypes.TryGetValue(uniqueName, out SerializableType type)) { return(type); } return(m_manager.GetSerializableType(scriptID)); }
public ScriptExportType GetExportType(ScriptExportManager exportManager, ScriptIdentifier scriptID) { TypeDefinition type = FindType(scriptID); if (type == null) { throw new ArgumentException($"Can't find type {scriptID.UniqueName}"); } return(exportManager.RetrieveType(type)); }
public SerializableType GetBehaviourType() { ScriptIdentifier scriptID = IsReadNamespace(File.Version) ? File.AssemblyManager.GetScriptID(AssemblyName, Namespace, ClassName) : File.AssemblyManager.GetScriptID(AssemblyName, ClassName); if (File.AssemblyManager.IsValid(scriptID)) { return(File.AssemblyManager.GetSerializableType(scriptID)); } return(null); }
public bool IsPresent(ScriptIdentifier scriptID) { if (m_manager == null) { return(false); } if (scriptID.IsDefault) { return(false); } return(m_manager.IsPresent(scriptID)); }
public bool IsValid(ScriptIdentifier scriptID) { if (ScriptingBackend == ScriptingBackend.Unknown) { return(false); } if (scriptID.IsDefault) { return(false); } return(m_manager.IsValid(scriptID)); }
public bool IsValid(ScriptIdentifier scriptID) { if (!IsSet) { return(false); } if (scriptID.IsDefault) { return(false); } return(m_manager.IsValid(scriptID)); }
public bool IsValid(ScriptIdentifier scriptID) { TypeDefinition type = FindType(scriptID); if (type == null) { return(false); } MonoTypeContext context = new MonoTypeContext(type); if (!IsTypeValid(context)) { return(false); } if (!IsUnityObject(type)) { return(false); } return(true); }
public override MetaPtr CreateExportPointer(Object asset, bool isLocal) { if (isLocal) { throw new NotSupportedException(); } MonoScript script = m_scripts[asset]; if (!MonoScript.HasAssemblyName(script.File.Version, script.File.Flags) || s_unityEngine.IsMatch(script.AssemblyName)) { if (MonoScript.HasNamespace(script.File.Version)) { int fileID = Compute(script.Namespace, script.ClassName); return(new MetaPtr(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset))); } else { ScriptIdentifier scriptInfo = script.GetScriptID(); if (!scriptInfo.IsDefault) { int fileID = Compute(scriptInfo.Namespace, scriptInfo.Name); return(new MetaPtr(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset))); } } } if (!AssemblyHash.ContainsKey(script.AssemblyNameOrigin)) { AssemblyHash[script.AssemblyNameOrigin] = GetAssemblyHashGuid(script.AssemblyNameOrigin); } var scriptKey = $"{script.AssemblyNameOrigin}{script.Namespace}{script.ClassName}"; if (!ScriptId.ContainsKey(scriptKey)) { ScriptId[scriptKey] = Compute(script.Namespace, script.ClassName); } return(new MetaPtr(ScriptId[scriptKey], new UnityGUID(AssemblyHash[script.AssemblyNameOrigin]), AssetExporter.ToExportType(asset))); }
public bool IsValid(ScriptIdentifier scriptID) { TypeDefinition type = FindType(scriptID); if (type == null) { return(false); } if (type.IsAbstract) { return(false); } MonoTypeContext context = new MonoTypeContext(type); if (!IsTypeValid(context)) { return(false); } if (!IsInheritanceValid(type)) { return(false); } return(true); }
public ScriptExportType GetExportType(ScriptExportManager exportManager, ScriptIdentifier scriptID) { return(m_manager.GetExportType(exportManager, scriptID)); }
public static string GetUniqueName(TypeReference type) { string assembly = FilenameUtils.FixAssemblyEndian(type.Module.Name); return(ScriptIdentifier.ToUniqueName(assembly, type.FullName)); }
public bool IsPresent(ScriptIdentifier scriptID) { return(FindType(scriptID.Assembly, scriptID.Namespace, scriptID.Name) != null); }