GetReferences() public static method

public static GetReferences ( MonoIsland island, string projectDirectory ) : string[]
island MonoIsland
projectDirectory string
return string[]
示例#1
0
        public static bool WeaveInto(string unityUNet, string destPath, string unityEngine, string assemblyPath, string[] extraAssemblyPaths, IAssemblyResolver assemblyResolver)
        {
            IEnumerable <MonoIsland> enumerable = from i in InternalEditorUtility.GetMonoIslands()
                                                  where 0 < i._files.Length
                                                  select i;
            string fullName = Directory.GetParent(Application.dataPath).FullName;

            string[] array = null;
            foreach (MonoIsland current in enumerable)
            {
                if (destPath.Equals(current._output))
                {
                    array = Weaver.GetReferences(current, fullName);
                    break;
                }
            }
            if (array == null)
            {
                Debug.LogError("Weaver failure: unable to locate assemblies (no matching project) for: " + destPath);
                return(false);
            }
            List <string> list = new List <string>();

            string[] array2 = array;
            for (int j = 0; j < array2.Length; j++)
            {
                string path = array2[j];
                list.Add(Path.GetDirectoryName(path));
            }
            if (extraAssemblyPaths != null)
            {
                list.AddRange(extraAssemblyPaths);
            }
            try
            {
                if (!Unity.UNetWeaver.Program.Process(unityEngine, unityUNet, Path.GetDirectoryName(destPath), new string[]
                {
                    assemblyPath
                }, list.ToArray(), assemblyResolver, new Action <string>(Debug.LogWarning), new Action <string>(Debug.LogError)))
                {
                    Debug.LogError("Failure generating network code.");
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Debug.LogError("Exception generating network code: " + ex.ToString() + " " + ex.StackTrace);
            }
            return(true);
        }
示例#2
0
        public static bool WeaveInto(string unityUNet, string destPath, string unityEngine, string assemblyPath, string[] extraAssemblyPaths, IAssemblyResolver assemblyResolver)
        {
            IEnumerable <MonoIsland> monoIslands = ((IEnumerable <MonoIsland>)InternalEditorUtility.GetMonoIslands()).Where <MonoIsland>((Func <MonoIsland, bool>)(i => 0 < i._files.Length));
            string fullName = Directory.GetParent(Application.dataPath).FullName;

            string[] strArray = (string[])null;
            foreach (MonoIsland island in monoIslands)
            {
                if (destPath.Equals(island._output))
                {
                    strArray = Weaver.GetReferences(island, fullName);
                    break;
                }
            }
            if (strArray == null)
            {
                Debug.LogError((object)("Weaver failure: unable to locate assemblies (no matching project) for: " + destPath));
                return(false);
            }
            List <string> stringList = new List <string>();

            foreach (string path in strArray)
            {
                stringList.Add(Path.GetDirectoryName(path));
            }
            if (extraAssemblyPaths != null)
            {
                stringList.AddRange((IEnumerable <string>)extraAssemblyPaths);
            }
            try
            {
                if (!Program.Process(unityEngine, unityUNet, Path.GetDirectoryName(destPath), new string[1] {
                    assemblyPath
                }, stringList.ToArray(), assemblyResolver, new System.Action <string>(Debug.LogWarning), new System.Action <string>(Debug.LogError)))
                {
                    Debug.LogError((object)"Failure generating network code.");
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Debug.LogError((object)("Exception generating network code: " + ex.ToString() + " " + ex.StackTrace));
            }
            return(true);
        }
示例#3
0
        public static bool WeaveInto(IEnumerable <MonoIsland> islands, string unityUNet, string destPath, string unityEngine, string assemblyPath, string[] extraAssemblyPaths, IAssemblyResolver assemblyResolver)
        {
            string fullName = Directory.GetParent(Application.dataPath).FullName;

            string[] array = null;
            foreach (MonoIsland current in islands)
            {
                if (destPath.Equals(current._output))
                {
                    array = Weaver.GetReferences(current, fullName);
                    break;
                }
            }
            bool result;

            if (array == null)
            {
                result = true;
            }
            else
            {
                List <string> list   = new List <string>();
                string[]      array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    string path = array2[i];
                    list.Add(Path.GetDirectoryName(path));
                }
                if (extraAssemblyPaths != null)
                {
                    list.AddRange(extraAssemblyPaths);
                }
                try
                {
                    string   arg_115_2 = Path.GetDirectoryName(destPath);
                    string[] expr_CD   = new string[]
                    {
                        assemblyPath
                    };
                    string[] arg_115_4 = list.ToArray();
                    if (Weaver.< > f__mg$cache0 == null)
                    {
                        Weaver.< > f__mg$cache0 = new Action <string>(Debug.LogWarning);
                    }
                    Action <string> arg_115_6 = Weaver.< > f__mg$cache0;
                    if (Weaver.< > f__mg$cache1 == null)
                    {
                        Weaver.< > f__mg$cache1 = new Action <string>(Debug.LogError);
                    }
                    if (!Unity.UNetWeaver.Program.Process(unityEngine, unityUNet, arg_115_2, expr_CD, arg_115_4, assemblyResolver, arg_115_6, Weaver.< > f__mg$cache1))
                    {
                        Debug.LogError("Failure generating network code.");
                        result = false;
                        return(result);
                    }
                }
                catch (Exception ex)
                {
                    Debug.LogError("Exception generating network code: " + ex.ToString() + " " + ex.StackTrace);
                }
                result = true;
            }
            return(result);
        }