Exemple #1
0
        /// <summary>
        /// [GET] Creates or retrieves a named log. Once a log has been created, it will remain available until
        /// explicitly removed.
        /// </summary>
        /// <param name="logName"></param>
        /// <returns></returns>
        public static VisualLog Get(string logName)
        {
            VisualLog log;

            if (!logRegistry.TryGetValue(logName, out log))
            {
                log = new VisualLog(logName);
                logRegistry[logName] = log;
            }
            return(log);
        }
Exemple #2
0
            static CustomLogHolder()
            {
                T logInfo = new T();

                Instance = new VisualLog(logInfo.Name, logInfo);
                lock (syncObj)
                {
                    logs.Add(Instance);
                    syncLogs = logs.ToArray();
                }
            }
Exemple #3
0
        internal static void EditorUpdate(IEnumerable <GameObject> updateObjects, bool simulateGame, bool forceFixedStep)
        {
            isUpdating = true;
            Profile.TimeUpdate.BeginMeasure();

            Time.FrameTick(forceFixedStep, simulateGame);
            Profile.FrameTick();
            if (simulateGame)
            {
                VisualLog.UpdateLogEntries();
            }
            pluginManager.InvokeBeforeUpdate();
            if (simulateGame)
            {
                UpdateUserInput();
                Scene.Current.Update();

                foreach (GameObject obj in updateObjects)
                {
                    if (obj.ParentScene == Scene.Current)
                    {
                        continue;
                    }

                    obj.IterateComponents <ICmpUpdatable>(
                        l => l.OnUpdate(),
                        l => (l as Component).Active);
                }
            }
            else
            {
                Scene.Current.EditorUpdate();
                foreach (GameObject obj in updateObjects)
                {
                    obj.IterateComponents <ICmpUpdatable>(
                        l => l.OnUpdate(),
                        l => (l as Component).Active);
                }
            }
            sound.Update();
            pluginManager.InvokeAfterUpdate();
            VisualLog.PrepareRenderLogEntries();
            RunCleanup();

            Profile.TimeUpdate.EndMeasure();
            isUpdating = false;

            if (terminateScheduled)
            {
                Terminate();
            }
        }
        private static void pluginManager_PluginsRemoving(object sender, DualityPluginEventArgs e)
        {
            // Wrapper method for delivering the old API until removing it in v3.0
            if (DiscardPluginData != null)
            {
                DiscardPluginData(sender, e);
            }

            // Dispose any existing Resources that could reference plugin data
            VisualLog.ClearAll();
            if (!Scene.Current.IsEmpty)
            {
                Scene.Current.Dispose();
            }
            foreach (Resource r in ContentProvider.EnumeratePluginContent().ToArray())
            {
                ContentProvider.RemoveContent(r.Path);
            }
        }
        /// <summary>
        /// Performs a single update cycle.
        /// </summary>
        public static void Update()
        {
            isUpdating = true;
            Profile.TimeUpdate.BeginMeasure();

            Time.FrameTick();
            Profile.FrameTick();
            VisualLog.UpdateLogEntries();
            pluginManager.InvokeBeforeUpdate();
            UpdateUserInput();
            Scene.Current.Update();
            sound.Update();
            pluginManager.InvokeAfterUpdate();
            VisualLog.PrepareRenderLogEntries();
            RunCleanup();

            Profile.TimeUpdate.EndMeasure();
            isUpdating = false;

            if (terminateScheduled)
            {
                Terminate();
            }
        }
Exemple #6
0
 static VisualLogs()
 {
     defaultLog = new VisualLog("Default");
     logs.Add(defaultLog);
     syncLogs = logs.ToArray();
 }