@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using FlaxEditor.CustomEditors.Dedicated;
|
||||
using FlaxEditor.CustomEditors.Editors;
|
||||
using FlaxEditor.Scripting;
|
||||
using FlaxEngine;
|
||||
@@ -107,7 +108,7 @@ namespace FlaxEditor.CustomEditors
|
||||
// Select default editor (based on type)
|
||||
if (targetType.IsEnum)
|
||||
return new EnumEditor();
|
||||
if (targetType.IsGenericType)
|
||||
if (targetType.IsGenericType)
|
||||
{
|
||||
if (targetTypeType.GetGenericTypeDefinition() == typeof(Dictionary<,>))
|
||||
return new DictionaryEditor();
|
||||
@@ -118,6 +119,8 @@ namespace FlaxEditor.CustomEditors
|
||||
if (customEditorType != null)
|
||||
return (CustomEditor)Activator.CreateInstance(customEditorType);
|
||||
}
|
||||
if (typeof(FlaxEngine.Object).IsAssignableFrom(targetTypeType))
|
||||
return new ScriptingObjectEditor();
|
||||
|
||||
// The most generic editor
|
||||
return new GenericEditor();
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.CustomEditors.Editors.GenericEditor" />
|
||||
[CustomEditor(typeof(Actor)), DefaultEditor]
|
||||
public class ActorEditor : GenericEditor
|
||||
public class ActorEditor : ScriptingObjectEditor
|
||||
{
|
||||
private Guid _linkedPrefabId;
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEditor.CustomEditors.Editors;
|
||||
using FlaxEngine.Networking;
|
||||
|
||||
namespace FlaxEditor.CustomEditors.Dedicated
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom editor for <see cref="FlaxEngine.Object"/>.
|
||||
/// </summary>
|
||||
public class ScriptingObjectEditor : GenericEditor
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
// Network objects debugging
|
||||
var obj = Values[0] as FlaxEngine.Object;
|
||||
if (Editor.IsPlayMode && NetworkManager.IsConnected && NetworkReplicator.HasObject(obj))
|
||||
{
|
||||
var group = layout.Group("Network");
|
||||
group.Panel.Open();
|
||||
group.Label("Role", Utilities.Utils.GetPropertyNameUI(NetworkReplicator.GetObjectRole(obj).ToString()));
|
||||
group.Label("Owner Client Id", NetworkReplicator.GetObjectOwnerClientId(obj).ToString());
|
||||
}
|
||||
|
||||
base.Initialize(layout);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FlaxEditor.Actions;
|
||||
using FlaxEditor.Content;
|
||||
using FlaxEditor.GUI;
|
||||
|
||||
Reference in New Issue
Block a user