From 8de4135ee0b9738700d697899f3477c1876b78de Mon Sep 17 00:00:00 2001 From: bgk- Date: Thu, 25 Jul 2024 07:44:39 -0700 Subject: [PATCH] Clean up using statements --- Editor/TopiEnumReferenceDrawer.cs | 2 +- README.md | 4 ++-- Runtime/Choice.cs | 1 - Runtime/Dialogue.cs | 3 +-- Runtime/Library.cs | 2 -- Runtime/Line.cs | 2 -- Runtime/ScriptableObjects/List/EvtTopiVariableList.cs | 2 +- Runtime/State.cs | 4 ---- Runtime/TopiAttribute.cs | 4 ++-- 9 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Editor/TopiEnumReferenceDrawer.cs b/Editor/TopiEnumReferenceDrawer.cs index c257174..7131c31 100644 --- a/Editor/TopiEnumReferenceDrawer.cs +++ b/Editor/TopiEnumReferenceDrawer.cs @@ -17,7 +17,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property) var enumObjField = new PropertyField(enumObjectProperty); var dropdownField = new PopupField("Value", new List(), 0); - enumObjField.RegisterCallback>(evt => + enumObjField.RegisterCallback>(_ => { var enumObject = enumObjectProperty.objectReferenceValue as EnumObject; if (enumObject == null) return; diff --git a/README.md b/README.md index 52cd174..5b67c82 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Can be installed via the Package Manager > Add Package From Git URL... This repo has a dependency on the EvtVariable package which MUST be installed first. (From my understanding Unity does not allow git urls to be used as dependencies of packages) https://github.com/peartreegames/evt-variables.git -This package also depends on the Unity Addressables package, which should automatically be installed, but if you any issues please install it manually from the Package Manager. +This package also depends on the Unity Addressables package, which should automatically be installed, but if you have any issues please install it manually from the Package Manager. then the repo can be added @@ -153,7 +153,7 @@ value.Bool // true ## EvtVariables -I've made [EvtVariables](https://github.com/peartreegames/evt-variables), a scriptableobject event system architecture, a dependency of this package. +I've made [EvtVariables](https://github.com/peartreegames/evt-variables), a ScriptableObject event system architecture, a dependency of this package. Though it isn't actually necessary, a lot of my tools use it. If you prefer not to keep it, please feel free to fork this repo and remove it. diff --git a/Runtime/Choice.cs b/Runtime/Choice.cs index 21bc7f3..9a2ee2a 100644 --- a/Runtime/Choice.cs +++ b/Runtime/Choice.cs @@ -1,6 +1,5 @@ using System; using System.Runtime.InteropServices; -using UnityEngine; namespace PeartreeGames.Topiary.Unity { diff --git a/Runtime/Dialogue.cs b/Runtime/Dialogue.cs index df395bb..292be41 100644 --- a/Runtime/Dialogue.cs +++ b/Runtime/Dialogue.cs @@ -4,7 +4,6 @@ using System.Runtime.InteropServices; using AOT; using PeartreeGames.Evt.Variables; -using Sirenix.OdinInspector; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; @@ -32,10 +31,10 @@ public class Dialogue : MonoBehaviour public static event Action OnChoices; public static event Action OnValueChanged; - [ShowInInspector] public static readonly State State = new(); public static readonly Dictionary Speakers = new(); public static readonly Dictionary Dialogues = new(); + private static readonly Dictionary Variables = new(); private static readonly Dictionary Callbacks = new(); private static readonly List FunctionPtrs = new(); diff --git a/Runtime/Library.cs b/Runtime/Library.cs index 725c29a..6ff7bb5 100644 --- a/Runtime/Library.cs +++ b/Runtime/Library.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Runtime.InteropServices; -using System.Text; namespace PeartreeGames.Topiary.Unity { diff --git a/Runtime/Line.cs b/Runtime/Line.cs index d2086b4..9505c0c 100644 --- a/Runtime/Line.cs +++ b/Runtime/Line.cs @@ -1,7 +1,5 @@ using System; using System.Runtime.InteropServices; -using UnityEngine; -using IntPtr = System.IntPtr; namespace PeartreeGames.Topiary.Unity { diff --git a/Runtime/ScriptableObjects/List/EvtTopiVariableList.cs b/Runtime/ScriptableObjects/List/EvtTopiVariableList.cs index 896e98f..86042c7 100644 --- a/Runtime/ScriptableObjects/List/EvtTopiVariableList.cs +++ b/Runtime/ScriptableObjects/List/EvtTopiVariableList.cs @@ -2,7 +2,7 @@ namespace PeartreeGames.Topiary.Unity { - public class EvtTopiVariableList : EvtVariableList + public abstract class EvtTopiVariableList : EvtVariableList { public new void Add(T item) => Value.Add(item); public new void Remove(T item) => Value.Remove(item); diff --git a/Runtime/State.cs b/Runtime/State.cs index d65b734..cd299dc 100644 --- a/Runtime/State.cs +++ b/Runtime/State.cs @@ -1,13 +1,10 @@ using Newtonsoft.Json.Linq; -using Sirenix.OdinInspector; -using UnityEngine; namespace PeartreeGames.Topiary.Unity { public class State { private JObject _rootState; - [ShowInInspector] public string Value => _rootState?.ToString(); /// @@ -16,7 +13,6 @@ public class State /// public void Amend(string jsonString) { - Debug.Log($"jsonString: {jsonString}"); if (_rootState == null) _rootState = JObject.Parse(jsonString); else { diff --git a/Runtime/TopiAttribute.cs b/Runtime/TopiAttribute.cs index 2888dde..5d5a949 100644 --- a/Runtime/TopiAttribute.cs +++ b/Runtime/TopiAttribute.cs @@ -19,9 +19,9 @@ public class TopiAttribute : Attribute /// /// Gets or sets the name of the function in the topi file. /// - public string Name { get; private set; } + public string Name { get; } - public byte Arity { get; private set; } + public byte Arity { get; } /// /// Declare the function as an extern topi function