reorganize

This commit is contained in:
2022-05-02 20:34:42 +03:00
parent 654e641464
commit 3f1230fdf9
34 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
using System.Collections.Generic;
using System.Linq;
using FlaxEngine;
using Cabrito;
#if FLAX_EDITOR
using FlaxEditor.CustomEditors.Dedicated;
using FlaxEditor.Scripting;
#endif
using FlaxEngine.GUI;
namespace Game
{
#if FLAX_EDITOR
[CustomEditor(typeof(PlayerActor))]
public class PlayerActorEditor : ActorEditor
{
protected override List<ItemInfo> GetItemsForType(ScriptType type)
{
List<ItemInfo> items = GetItemsForType(type, type.IsClass, true);
// Remove all Rigid Body options
items.RemoveAll(x => x.Display.Group == "Rigid Body");
// Inject scripts editor
var scriptsMember = type.GetProperty("Scripts");
if (scriptsMember != ScriptMemberInfo.Null)
{
var item = new ItemInfo(scriptsMember)
{
CustomEditor = new CustomEditorAttribute(typeof(ScriptsEditor))
};
items.Add(item);
}
return items;
}
}
#endif
public class PlayerActor : RigidBody
{
public PlayerActor()
{
// Default internal values for RigidBody
IsKinematic = true;
EnableGravity = false;
LinearDamping = 0f;
AngularDamping = 0f;
Constraints = RigidbodyConstraints.LockRotation;
}
}
}