Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunasawa committed May 30, 2024
1 parent 38abaf0 commit 8633ed4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
6 changes: 5 additions & 1 deletion Editor/Inspectors/AIRootEditor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if UNITY_EDITOR && YNL_EDITOR
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
using YNL.Editors.UIElements.Flexs;
using YNL.Editors.Windows.Utilities;
Expand Down Expand Up @@ -30,7 +31,10 @@ private void Initialization()
.SetGlobalColor("#8FF2FF")
.AddIcon("Icons/AI Root", MAddressType.Resources)
.AddTitle("AI Root")
.AddDocumentation("https://github.com/Yunasawa-Studio/YNL-Simple-AI-System"));
.AddDocumentation("https://github.com/Yunasawa-Studio/YNL-Simple-AI-System")
.AddBottomSpace(10));

InspectorElement.FillDefaultInspector(_root, serializedObject, this);
}
}
}
Expand Down
8 changes: 0 additions & 8 deletions Editor/Resources/Style Sheets/Elements.meta

This file was deleted.

19 changes: 18 additions & 1 deletion Main/AIRoot.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
#if YNL_UTILITIES
using UnityEngine;
using YNL.Extensions.Methods;

namespace YNL.SimpleAISystem
{
public class AIRoot : MonoBehaviour
{
public AIController Controller;

#region MonoBehaviour
private void OnValidate()
{
if (Controller.IsNull()) Controller = GetComponentInChildren<AIController>();
}

private void Start()
{
if (Controller.IsNull()) Controller = GetComponentInChildren<AIController>();
}
#endregion

public void EnableAI(bool enable) => Controller.enabled = enable;
}
}
}
#endif
1 change: 1 addition & 0 deletions Sample/Sample Scene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 24069b42bf0820d4fa616b5d8af14df0, type: 3}
m_Name:
m_EditorClassIdentifier:
Controller: {fileID: 1237137602}
--- !u!65 &721477080
BoxCollider:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name": "com.yunasawa.ynl.simpleaisystem",
"displayName": "YNL - Simple AI System",
"version": "1.1.12",
"version": "1.2.1",
"unity": "2022.3",
"description": "YNL - Simple AI System provides you a simple system to handle objects' behaviours as an AI.",
"keywords": [
Expand Down

0 comments on commit 8633ed4

Please sign in to comment.