Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Documentation/Information.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions Documentation/Information/ClassViewer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Runtime
Core
Architecture
Game -> This is a <color=red>red</color> word and <color=green><b>bold green</b></color>. Go to <u><color=blue>TEST</color></link></u> https://github.com/AliJimpa/RealMethod/wiki/Assets.
World -> just test text <color=white> ColortTEst </color> Without link
GameConfig
GameService
ManagerContracts
ServiceContracts
WorldSceneConfig
ProjectSettingAsset -> ProjectSettingAsset Should be in Resource>RealMethod>RealMethodSetting.asset and all RealMethod setting handeled by this asset and this name.
Attributes
ButtonAttribute
ColorFieldAttribute
ConditionalHideAttribute
DropdownAttribute
DropdownFromArrayAttribute
DropdownFromDictionaryAttribute
EnumDescriptionAttribute
ExpandableAttribute
HelpBoxAttribute
HideInInspectorByEnumAttribute
InterfaceValidationDrawer
LayerAttribute
ListToPopupAttribute
MinMaxRangeAttribute
ReadOnlyAttribute
SeparatorAttribute
ShowInInspectorByEnumAttribute
ShowOnlyAttribute
ShowTypeAttribute
TagSelectorAttribute
Definitions
Assets
Identifier
Prefab
Tick
ProjectSetting
ProjectSettingAsset
Library
Extension
Interfaces
SharedScripts
Utilities
Vendor
Pattern
Components
DataAssets
DesignPatterns
Managers
Services
ReadySet
Commands
Components
DefaultsClass
Managers
Presets
Services
Toolkit
Ability
Actor
CSVFile
CurveViewer
Interaction
Inventory
PCG
Pickup
RPG
Tutorial
Upgrade
7 changes: 7 additions & 0 deletions Documentation/Information/ClassViewer.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Documentation/Resource.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using PlasticGui.WorkspaceWindow;
using UnityEditor;

namespace RealMethod
namespace RealMethod.Editor
{
[CustomEditor(typeof(Game), true)]
public class GameCompWindow : UnityEditor.Editor
public class Game_Editor : UnityEditor.Editor
{
private Game BaseComponent;

Expand All @@ -18,10 +17,6 @@ public override void OnInspectorGUI()
EditorGUILayout.Space();
if (BaseComponent != null)
{
if (Game.World != null)
{

}
EditorGUILayout.LabelField($"{GetWorld()} | {GetSetvice()} | {GetConfig()}");
EditorGUILayout.Space(0.5f);
string[] Data = BaseComponent.GetAllServiceNames();
Expand All @@ -32,10 +27,6 @@ public override void OnInspectorGUI()
}
}





private string GetWorld()
{
return Game.World != null ? Game.World.GetType().Name : "World Not Valid";
Expand All @@ -49,14 +40,6 @@ private string GetConfig()
return Game.Config != null ? Game.Config.GetType().Name : "GameConfig Not Valid";
}









}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace RealMethod.Editor
{
//[InitializeOnLoad]
public static class AutoWorldExecutionOrder
public static class WorldExecutionOrder_Tools
{
[MenuItem("Tools/RealMethod/Core/ExecutionOrder" , priority = -1001)]
static void ApplyExecutionOrder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
using System;
Expand All @@ -8,9 +7,9 @@
namespace RealMethod.Editor
{
[InitializeOnLoad]
public static class ConfigAssetValidator
public static class ConfigAsset_Onload
{
static ConfigAssetValidator()
static ConfigAsset_Onload()
{
EditorApplication.delayCall += ValidateAllConfigs;
}
Expand Down Expand Up @@ -84,6 +83,4 @@ private static bool ViolatesPureMethodRules(MethodInfo method)
return false;
}
}
#endif

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;

namespace RealMethod.Editor
{
public class DataAssetEditor : UnityEditor.Editor
public class DataAsset_Editor : UnityEditor.Editor
{
public static void DrawCompleteScriptableObjectEditor<T>(string name, ref T settings, ref bool foldout, ref UnityEditor.Editor editor) where T : ScriptableObject
{
Expand All @@ -23,5 +22,4 @@ public static void DrawSubEditor (Object settings, ref bool foldout, ref UnityEd
}
}
}
}
#endif
}
126 changes: 126 additions & 0 deletions Editor/Core/Definitions/PrefabCore_Drawer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
using UnityEditor;
using UnityEngine;
using System;

namespace RealMethod.Editor
{
[CustomPropertyDrawer(typeof(PrefabCore), true)]
public class PrefabCore_Drawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
SerializedProperty prefabGOProp = property.FindPropertyRelative("PrefabAsset");

if (prefabGOProp == null)
{
EditorGUI.LabelField(position, label.text, "Cannot serialize generic prefab");
return;
}

EditorGUI.BeginProperty(position, label, property);

// Determine label text
// string displayLabel = prefabGOProp.objectReferenceValue != null ? label.text: $"{label.text} (Select a prefab...)";

// Draw the ObjectField for GameObject
UnityEngine.Object newObject = EditorGUI.ObjectField(
position,
label,
prefabGOProp.objectReferenceValue,
typeof(GameObject),
false
);

// Only update if changed
if (newObject != prefabGOProp.objectReferenceValue)
{
if (newObject == null)
{
prefabGOProp.objectReferenceValue = null;
}
else if (PrefabUtility.IsPartOfPrefabAsset(newObject))
{
// Get the concrete PrefabCore instance
PrefabCore targetPrefab = fieldInfo.GetValue(property.serializedObject.targetObject) as PrefabCore;

if (targetPrefab == null)
{
Debug.LogWarning("Invalid prefab wrapper.");
return;
}

var targetClass = targetPrefab.GetTargetClass();
GameObject go = newObject as GameObject;

// Type-check: the prefab must have the required component
if (targetClass != null && go.GetComponent(targetClass) != null)
{
prefabGOProp.objectReferenceValue = newObject;
}
else
{
Debug.LogWarning($"Selected prefab does not have required component: {targetClass?.Name}");
}
}
else
{
Debug.LogWarning("Only prefab assets from the project can be assigned.");
}
}

// --- Set GUI color to blue to indicate change ---
Color prevColor = GUI.color;
GUI.color = Color.cyan; // light blue
EditorGUI.ObjectField(position, label, prefabGOProp.objectReferenceValue, typeof(GameObject), false);
GUI.color = prevColor;
EditorGUI.EndProperty();
}




// --- Utility to get the actual object instance from SerializedProperty ---
// private object GetTargetObjectOfProperty(SerializedProperty prop)
// {
// if (prop == null) return null;

// string path = prop.propertyPath.Replace(".Array.data[", "[");
// object obj = prop.serializedObject.targetObject;
// string[] elements = path.Split('.');

// foreach (string element in elements)
// {
// if (element.Contains("["))
// {
// string elementName = element.Substring(0, element.IndexOf("["));
// int index = Convert.ToInt32(element.Substring(element.IndexOf("[")).Replace("[", "").Replace("]", ""));
// obj = GetValue(obj, elementName, index);
// }
// else
// {
// obj = GetValue(obj, element);
// }
// }
// return obj;
// }
// private object GetValue(object source, string name)
// {
// if (source == null) return null;
// var type = source.GetType();
// var f = type.GetField(name, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
// if (f == null) return null;
// return f.GetValue(source);
// }
// private object GetValue(object source, string name, int index)
// {
// var enumerable = GetValue(source, name) as System.Collections.IEnumerable;
// if (enumerable == null) return null;
// var enm = enumerable.GetEnumerator();
// for (int i = 0; i <= index; i++)
// {
// if (!enm.MoveNext()) return null;
// }
// return enm.Current;
// }
}
}
Loading