예제 #1
0
        /// <summary>
        /// Call this to initialize UnityExplorer with the provided log listener and Unhollowed modules path.
        /// </summary>
        /// <param name="logListener">Your log listener to handle UnityExplorer logs.</param>
        /// <param name="unhollowedModulesPath">The path of the Unhollowed modules, either relative or absolute.</param>
        /// <returns>The new (or active, if one exists) instance of ExplorerStandalone.</returns>
        public static ExplorerStandalone CreateInstance(Action <string, LogType> logListener, string unhollowedModulesPath)
        {
            if (Instance != null)
            {
                return(Instance);
            }

            var instance = new ExplorerStandalone();

            instance.Init();
            instance.CheckExplorerFolder();

            if (logListener != null)
            {
                OnLog += logListener;
            }

            if (string.IsNullOrEmpty(unhollowedModulesPath) || !Directory.Exists(unhollowedModulesPath))
            {
                instance.unhollowedPath = Path.Combine(instance.ExplorerFolder, "Modules");
            }
            else
            {
                instance.unhollowedPath = unhollowedModulesPath;
            }

            return(instance);
        }
예제 #2
0
        /// <summary>
        /// Call this to initialize UnityExplorer and add a listener for UnityExplorer's log messages.
        /// </summary>
        /// <param name="logListener">Your log listener to handle UnityExplorer logs.</param>
        /// <returns>The new (or active, if one exists) instance of ExplorerStandalone.</returns>
        public static ExplorerStandalone CreateInstance(Action <string, LogType> logListener)
        {
            if (Instance != null)
            {
                return(Instance);
            }

            OnLog += logListener;

            var instance = new ExplorerStandalone();

            instance.Init();
            return(instance);
        }