public Type GetGraphType(int i) { if (this.typeNames[i] == null) { return(null); } Type type = UtilityPlugin.GetType(this.typeNames[i]); if (!object.Equals(type, null)) { return(type); } throw new Exception("No graph of type '" + this.typeNames[i] + "' could be created, type does not exist"); }
public Object DeserializeUnityObject() { int num = this.reader.ReadInt32(); if (num == 2147483647) { return(null); } string text = this.reader.ReadString(); string text2 = this.reader.ReadString(); string text3 = this.reader.ReadString(); Type type = UtilityPlugin.GetType(text2); if (type == null) { Debug.LogError("Could not find type '" + text2 + "'. Cannot deserialize Unity reference"); return(null); } if (!string.IsNullOrEmpty(text3)) { UnityReferenceHelper[] array = Object.FindObjectsOfType(typeof(UnityReferenceHelper)) as UnityReferenceHelper[]; int i = 0; while (i < array.Length) { if (array[i].GetGUID() == text3) { if (type == typeof(GameObject)) { return(array[i].gameObject); } return(array[i].GetComponent(type)); } else { i++; } } } Object[] array2 = Resources.LoadAll(text, type); for (int j = 0; j < array2.Length; j++) { if (array2[j].name == text || array2.Length == 1) { return(array2[j]); } } return(null); }
protected void RegisterTriggers(List <int> in_triggerList, AkTriggerBase.Trigger in_delegate) { foreach (uint num in in_triggerList) { string str = string.Empty; if (((triggerTypes.TryGetValue(num, out str) && (str != "Awake")) && (str != "Start")) && (str != "Destroy")) { AkTriggerBase component = (AkTriggerBase)base.GetComponent(UtilityPlugin.GetType(str)); if (component == null) { component = (AkTriggerBase)base.gameObject.AddComponent(UtilityPlugin.GetType(str)); } component.triggerDelegate = (AkTriggerBase.Trigger)Delegate.Combine(component.triggerDelegate, in_delegate); } } }
public static System.Type GetType2(string typeName) { System.Type type = UtilityPlugin.GetType(typeName); if (type != null) { return(type); } foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { type = assembly.GetType(typeName); if (type != null) { Debug.Log("GetType2 find " + typeName + "FullName= " + assembly.FullName); return(type); } } return(null); }
public static Type GetType2(string typeName) { Type type = UtilityPlugin.GetType(typeName); if (type != null) { return(type); } Assembly[] assemblies = AppDomain.get_CurrentDomain().GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { Assembly assembly = assemblies[i]; type = assembly.GetType(typeName); if (type != null) { Debug.Log("GetType2 find " + typeName + "FullName= " + assembly.get_FullName()); return(type); } } return(null); }
protected void RegisterTriggers(List <int> in_triggerList, AkTriggerBase.Trigger in_delegate) { using (List <int> .Enumerator enumerator = in_triggerList.GetEnumerator()) { while (enumerator.MoveNext()) { uint current = (uint)enumerator.get_Current(); string empty = string.Empty; if (AkUnityEventHandler.triggerTypes.TryGetValue(current, ref empty) && !(empty == "Awake") && !(empty == "Start") && !(empty == "Destroy")) { AkTriggerBase akTriggerBase = (AkTriggerBase)base.GetComponent(UtilityPlugin.GetType(empty)); if (akTriggerBase == null) { akTriggerBase = (AkTriggerBase)base.gameObject.AddComponent(UtilityPlugin.GetType(empty)); } AkTriggerBase akTriggerBase2 = akTriggerBase; akTriggerBase2.triggerDelegate = (AkTriggerBase.Trigger)Delegate.Combine(akTriggerBase2.triggerDelegate, in_delegate); } } } }
public UnityEngine.Object DeserializeUnityObject() { if (this.reader.ReadInt32() != 0x7fffffff) { string path = this.reader.ReadString(); string typeName = this.reader.ReadString(); string str3 = this.reader.ReadString(); System.Type type = UtilityPlugin.GetType(typeName); if (type == null) { Debug.LogError("Could not find type '" + typeName + "'. Cannot deserialize Unity reference"); return(null); } if (!string.IsNullOrEmpty(str3)) { UnityReferenceHelper[] helperArray = UnityEngine.Object.FindObjectsOfType(typeof(UnityReferenceHelper)) as UnityReferenceHelper[]; for (int j = 0; j < helperArray.Length; j++) { if (helperArray[j].GetGUID() == str3) { if (type == typeof(GameObject)) { return(helperArray[j].gameObject); } return(helperArray[j].GetComponent(type)); } } } UnityEngine.Object[] objArray = Resources.LoadAll(path, type); for (int i = 0; i < objArray.Length; i++) { if ((objArray[i].name == path) || (objArray.Length == 1)) { return(objArray[i]); } } } return(null); }