├── .github └── workflows │ ├── ci.yml │ └── test_build.yml ├── .gitignore ├── Assets ├── Cheater.meta ├── Cheater │ ├── BasicCommands.cs │ ├── BasicCommands.cs.meta │ ├── CheaterStyles.cs │ ├── CheaterStyles.cs.meta │ ├── Command.cs │ ├── Command.cs.meta │ ├── CommandArgument.cs │ ├── CommandArgument.cs.meta │ ├── CommandCompleter.cs │ ├── CommandCompleter.cs.meta │ ├── CommandHelper.cs │ ├── CommandHelper.cs.meta │ ├── CommandManager.cs │ ├── CommandManager.cs.meta │ ├── CommandParser.cs │ ├── CommandParser.cs.meta │ ├── CommandWindow.cs │ ├── CommandWindow.cs.meta │ ├── Tsuki.Cheater.asmdef │ └── Tsuki.Cheater.asmdef.meta ├── Content.meta ├── Content │ ├── 128w.meta │ ├── 128w │ │ ├── TsukiLogo_Black_128px.png │ │ ├── TsukiLogo_Black_128px.png.meta │ │ ├── TsukiLogo_White_128px.png │ │ └── TsukiLogo_White_128px.png.meta │ ├── 1x.meta │ ├── 1x │ │ ├── TsukiLogo_Black_Original.png │ │ ├── TsukiLogo_Black_Original.png.meta │ │ ├── TsukiLogo_White_Original.png │ │ └── TsukiLogo_White_Original.png.meta │ ├── Logo.ai │ ├── Logo.ai.meta │ ├── SVG.meta │ └── SVG │ │ ├── TsukiLogo_Black_SVG.svg │ │ ├── TsukiLogo_Black_SVG.svg.meta │ │ ├── TsukiLogo_White_SVG.svg │ │ └── TsukiLogo_White_SVG.svg.meta ├── Editor.meta ├── Editor │ ├── AssetsUtility.cs │ ├── AssetsUtility.cs.meta │ ├── Drawers.meta │ ├── Drawers │ │ ├── ClockDrawer.cs │ │ ├── ClockDrawer.cs.meta │ │ ├── SerializableInterfaceDrawer.cs │ │ └── SerializableInterfaceDrawer.cs.meta │ ├── Dropdowns.cs │ ├── Dropdowns.cs.meta │ ├── Extenders.meta │ ├── Extenders │ │ ├── DropdownButton.cs │ │ ├── DropdownButton.cs.meta │ │ ├── InlinedObjectList.cs │ │ ├── InlinedObjectList.cs.meta │ │ ├── TypeSelectorButton.cs │ │ ├── TypeSelectorButton.cs.meta │ │ ├── TypeSelectorDropdown.cs │ │ └── TypeSelectorDropdown.cs.meta │ ├── Icons.cs │ ├── Icons.cs.meta │ ├── Plotting.meta │ ├── Plotting │ │ ├── Plot.cs │ │ ├── Plot.cs.meta │ │ ├── Plotter.cs │ │ ├── Plotter.cs.meta │ │ ├── SplitPlotter.cs │ │ └── SplitPlotter.cs.meta │ ├── Preference.meta │ ├── Preference │ │ ├── EditorPreferenceExtensions.cs │ │ ├── EditorPreferenceExtensions.cs.meta │ │ ├── EditorPreferences.cs │ │ └── EditorPreferences.cs.meta │ ├── Properties.meta │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── AssemblyInfo.cs.meta │ ├── Styles.cs │ ├── Styles.cs.meta │ ├── Tsuki.Editor.asmdef │ ├── Tsuki.Editor.asmdef.meta │ ├── TsukiBuild.cs │ ├── TsukiBuild.cs.meta │ ├── TsukiGUILayout.cs │ ├── TsukiGUILayout.cs.meta │ ├── TsukiStyles.cs │ ├── TsukiStyles.cs.meta │ ├── Utilities.meta │ ├── Utilities │ │ ├── EditorGUI2.cs │ │ ├── EditorGUI2.cs.meta │ │ ├── GUIStyleExtraction.cs │ │ ├── GUIStyleExtraction.cs.meta │ │ ├── Handles2.cs │ │ ├── Handles2.cs.meta │ │ ├── ModularContent.cs │ │ ├── ModularContent.cs.meta │ │ ├── Serialization.cs │ │ └── Serialization.cs.meta │ ├── Windows.meta │ └── Windows │ │ ├── EditorContentVisualizer.cs │ │ ├── EditorContentVisualizer.cs.meta │ │ ├── GUIStyleInspector.cs │ │ ├── GUIStyleInspector.cs.meta │ │ ├── IconsGenerator.cs │ │ ├── IconsGenerator.cs.meta │ │ ├── StylesGenerator.cs │ │ └── StylesGenerator.cs.meta ├── Entities.meta ├── Entities │ ├── Common.meta │ ├── Common │ │ ├── Gauge.cs │ │ ├── Gauge.cs.meta │ │ ├── TraitDescriptorExtensions.cs │ │ └── TraitDescriptorExtensions.cs.meta │ ├── Dependencies.cs │ ├── Dependencies.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── CompileDefinitions.cs │ │ ├── CompileDefinitions.cs.meta │ │ ├── DependenciesSugarGenerator.cs │ │ ├── DependenciesSugarGenerator.cs.meta │ │ ├── EntityEditor.Styles.cs │ │ ├── EntityEditor.Styles.cs.meta │ │ ├── EntityEditor.Traits.cs │ │ ├── EntityEditor.Traits.cs.meta │ │ ├── EntityEditor.cs │ │ ├── EntityEditor.cs.meta │ │ ├── EntityMeta.cs │ │ ├── EntityMeta.cs.meta │ │ ├── TraitEditor.cs │ │ ├── TraitEditor.cs.meta │ │ ├── TraitEditorUtils.cs │ │ ├── TraitEditorUtils.cs.meta │ │ ├── TraitGroup.cs │ │ ├── TraitGroup.cs.meta │ │ ├── Tsuki.Entities.Editor.asmdef │ │ └── Tsuki.Entities.Editor.asmdef.meta │ ├── Entity.cs │ ├── Entity.cs.meta │ ├── EntityEvent.cs │ ├── EntityEvent.cs.meta │ ├── EntityExtensions.cs │ ├── EntityExtensions.cs.meta │ ├── ITraits.cs │ ├── ITraits.cs.meta │ ├── Network.meta │ ├── Network │ │ ├── NetworkTrait.cs │ │ ├── NetworkTrait.cs.meta │ │ ├── Tsuki.Entities.Network.asmdef │ │ └── Tsuki.Entities.Network.asmdef.meta │ ├── Problems.meta │ ├── Problems │ │ ├── MissingAnimatorController.cs │ │ ├── MissingAnimatorController.cs.meta │ │ ├── MissingAnimatorParameter.cs │ │ ├── MissingAnimatorParameter.cs.meta │ │ ├── MissingComponent.cs │ │ ├── MissingComponent.cs.meta │ │ ├── MissingTrait.cs │ │ ├── MissingTrait.cs.meta │ │ ├── Problem.cs │ │ ├── Problem.cs.meta │ │ ├── ProblemBuilder.cs │ │ └── ProblemBuilder.cs.meta │ ├── Trait.cs │ ├── Trait.cs.meta │ ├── TraitDescriptor.cs │ ├── TraitDescriptor.cs.meta │ ├── TraitExtensions.cs │ ├── TraitExtensions.cs.meta │ ├── TraitLocationAttribute.cs │ ├── TraitLocationAttribute.cs.meta │ ├── Traits.cs │ ├── Traits.cs.meta │ ├── Tsuki.Entities.asmdef │ └── Tsuki.Entities.asmdef.meta ├── Gizmos.meta ├── Gizmos │ ├── Lunari.meta │ └── Lunari │ │ ├── Tsuki.meta │ │ └── Tsuki │ │ ├── Entities.meta │ │ └── Entities │ │ ├── Common.meta │ │ ├── Common │ │ ├── Living Icon.png │ │ └── Living Icon.png.meta │ │ ├── Entity Icon.png │ │ └── Entity Icon.png.meta ├── Graphs.meta ├── Graphs │ ├── AdjacencyList.cs │ ├── AdjacencyList.cs.meta │ ├── AdjacencyMatrix.cs │ ├── AdjacencyMatrix.cs.meta │ ├── Exceptions.meta │ ├── Exceptions │ │ ├── EdgeOutOfRangeException.cs │ │ ├── EdgeOutOfRangeException.cs.meta │ │ ├── VertexOutOfRangeException.cs │ │ └── VertexOutOfRangeException.cs.meta │ ├── Graph.cs │ ├── Graph.cs.meta │ ├── Graphs.AStar.cs │ ├── Graphs.AStar.cs.meta │ ├── Graphs.Dijkstra.cs │ ├── Graphs.Dijkstra.cs.meta │ ├── Graphs.Exploration.cs │ ├── Graphs.Exploration.cs.meta │ ├── Graphs.cs │ ├── Graphs.cs.meta │ ├── Tests.meta │ ├── Tests │ │ ├── AbstractGraphTest.cs │ │ ├── AbstractGraphTest.cs.meta │ │ ├── GraphTests.cs │ │ ├── GraphTests.cs.meta │ │ ├── Tsuki.Graphs.Tests.asmdef │ │ └── Tsuki.Graphs.Tests.asmdef.meta │ ├── Tsuki-Graphs.csproj.DotSettings │ ├── Tsuki-Graphs.csproj.DotSettings.meta │ ├── Tsuki.Graphs.asmdef │ └── Tsuki.Graphs.asmdef.meta ├── Runtime.meta ├── Runtime │ ├── Algorithm.meta │ ├── Algorithm │ │ ├── Deque.cs │ │ ├── Deque.cs.meta │ │ ├── PriorityQueue.cs │ │ ├── PriorityQueue.cs.meta │ │ ├── RingBuffer.cs │ │ ├── RingBuffer.cs.meta │ │ ├── Tree.cs │ │ └── Tree.cs.meta │ ├── Animations.cs │ ├── Animations.cs.meta │ ├── Collections.cs │ ├── Collections.cs.meta │ ├── ColorHSV.cs │ ├── ColorHSV.cs.meta │ ├── Colors.cs │ ├── Colors.cs.meta │ ├── Coroutines.cs │ ├── Coroutines.cs.meta │ ├── Debugging.cs │ ├── Debugging.cs.meta │ ├── EditorOnlyAttribute.cs │ ├── EditorOnlyAttribute.cs.meta │ ├── Enums.cs │ ├── Enums.cs.meta │ ├── Events.cs │ ├── Events.cs.meta │ ├── Exceptions.meta │ ├── Exceptions │ │ ├── WTFException.cs │ │ └── WTFException.cs.meta │ ├── Files.cs │ ├── Files.cs.meta │ ├── GUIStyles.cs │ ├── GUIStyles.cs.meta │ ├── GameObjects.cs │ ├── GameObjects.cs.meta │ ├── Gizmos2.cs │ ├── Gizmos2.cs.meta │ ├── GizmosScheduler.cs │ ├── GizmosScheduler.cs.meta │ ├── Indexing.cs │ ├── Indexing.cs.meta │ ├── Logging.meta │ ├── Logging │ │ ├── UnityLogger.cs │ │ └── UnityLogger.cs.meta │ ├── Maths.cs │ ├── Maths.cs.meta │ ├── Misc.meta │ ├── Misc │ │ ├── Axis.cs │ │ ├── Axis.cs.meta │ │ ├── Bounds2D.cs │ │ ├── Bounds2D.cs.meta │ │ ├── CategoryAttribute.cs │ │ ├── CategoryAttribute.cs.meta │ │ ├── Clock.cs │ │ ├── Clock.cs.meta │ │ ├── Cooldown.cs │ │ ├── Cooldown.cs.meta │ │ ├── Direction2D.cs │ │ ├── Direction2D.cs.meta │ │ ├── Historic.cs │ │ ├── Historic.cs.meta │ │ ├── OnGUIHook.cs │ │ ├── OnGUIHook.cs.meta │ │ ├── SerializableInterface.cs │ │ ├── SerializableInterface.cs.meta │ │ ├── Tracker.cs │ │ ├── Tracker.cs.meta │ │ ├── UnitValue.cs │ │ └── UnitValue.cs.meta │ ├── Numbers.cs │ ├── Numbers.cs.meta │ ├── Objects.cs │ ├── Objects.cs.meta │ ├── Paths.cs │ ├── Paths.cs.meta │ ├── Randomization.cs │ ├── Randomization.cs.meta │ ├── Rectangles.cs │ ├── Rectangles.cs.meta │ ├── Scopes.meta │ ├── Scopes │ │ ├── GUIColorScope.cs │ │ ├── GUIColorScope.cs.meta │ │ ├── GUIEnabledScope.cs │ │ ├── GUIEnabledScope.cs.meta │ │ ├── GizmosColorScope.cs │ │ └── GizmosColorScope.cs.meta │ ├── SerializableDictionary.cs │ ├── SerializableDictionary.cs.meta │ ├── Singletons.meta │ ├── Singletons │ │ ├── Manager.cs │ │ ├── Manager.cs.meta │ │ ├── ScriptableSingleton.cs │ │ ├── ScriptableSingleton.cs.meta │ │ ├── Singleton.cs │ │ └── Singleton.cs.meta │ ├── Slot.cs │ ├── Slot.cs.meta │ ├── SlotExtensions.cs │ ├── SlotExtensions.cs.meta │ ├── Stacking.meta │ ├── Stacking │ │ ├── BooleanStackable.cs │ │ ├── BooleanStackable.cs.meta │ │ ├── FloatStackable.cs │ │ ├── FloatStackable.cs.meta │ │ ├── Stackable.cs │ │ └── Stackable.cs.meta │ ├── Tests.meta │ ├── Tests │ │ ├── RingBufferTest.cs │ │ ├── RingBufferTest.cs.meta │ │ ├── Tsuki.Runtime.Tests.asmdef │ │ └── Tsuki.Runtime.Tests.asmdef.meta │ ├── Textures.cs │ ├── Textures.cs.meta │ ├── Tsuki.Runtime.asmdef │ ├── Tsuki.Runtime.asmdef.meta │ ├── Types.cs │ ├── Types.cs.meta │ ├── UI.cs │ ├── UI.cs.meta │ ├── Vectors.cs │ └── Vectors.cs.meta ├── Samples.meta ├── Samples │ ├── Entities.meta │ └── Entities │ │ ├── AITraitThatDoStuff.cs │ │ ├── AITraitThatDoStuff.cs.meta │ │ ├── Basic.meta │ │ ├── Basic │ │ ├── BasicController.controller │ │ ├── BasicController.controller.meta │ │ ├── Entities.unity │ │ └── Entities.unity.meta │ │ ├── Dummy.cs │ │ ├── Dummy.cs.meta │ │ ├── Health.meta │ │ ├── Health │ │ ├── Combatant.cs │ │ ├── Combatant.cs.meta │ │ ├── Health.unity │ │ ├── Health.unity.meta │ │ ├── Living.cs │ │ ├── Living.cs.meta │ │ ├── SquadMember.cs │ │ └── SquadMember.cs.meta │ │ ├── SpriteFlipper.cs │ │ ├── SpriteFlipper.cs.meta │ │ ├── TraitA.cs │ │ ├── TraitA.cs.meta │ │ ├── TraitB.cs │ │ ├── TraitB.cs.meta │ │ ├── TraitC.cs │ │ ├── TraitC.cs.meta │ │ ├── TraitD.cs │ │ └── TraitD.cs.meta ├── package.json └── package.json.meta ├── LICENSE.md ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── TimelineSettings.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md ├── Scripts └── LocalBuild.Windows.ps1 ├── Static ├── Installation_1.png └── Installation_2.png ├── Tsuki.Graphs.csproj.DotSettings ├── Tsuki.Runtime.csproj.DotSettings ├── TsukiSuite.sln.DotSettings ├── UserSettings ├── EditorUserSettings.asset └── Search.settings └── push.bat /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | split-upm: 8 | name: split upm branch (force) 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | with: 13 | fetch-depth: 0 14 | - name: split upm branch 15 | run: | 16 | git branch -d upm &> /dev/null || echo upm branch not found 17 | git subtree split -P Assets -b upm 18 | git checkout upm 19 | if [[ -d "Samples" ]]; then 20 | git mv Samples Samples~ 21 | rm -f Samples.meta 22 | git config --global user.name 'github-bot' 23 | git config --global user.email 'github-bot@users.noreply.github.com' 24 | git commit -am "fix: Samples => Samples~" 25 | fi 26 | git push -f -u origin upm -------------------------------------------------------------------------------- /.github/workflows/test_build.yml: -------------------------------------------------------------------------------- 1 | name: Test Multiple Runtime Production Build 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | buildOptions: 7 | description: 'Build options (comma-separated, e.g. BuildScriptsOnly,StrictMode)' 8 | required: false 9 | scenesPath: 10 | description: 'Scenes folder path' 11 | required: false 12 | push: 13 | branches: 14 | - master 15 | - development 16 | 17 | env: 18 | BUILD_METHOD: "Lunari.Tsuki.Editor.TsukiBuild.PerformTsukiBuild" 19 | UNITY_VERSION: "2020.3.24f1" 20 | SCENES_PATH: "Assets/Samples" 21 | BUILD_OPTIONS: "BuildScriptsOnly,StrictMode" 22 | 23 | jobs: 24 | build: 25 | strategy: 26 | matrix: 27 | include: 28 | - os: windows-latest 29 | buildTarget: StandaloneWindows64 30 | runtime: mono 31 | - os: windows-latest 32 | buildTarget: StandaloneWindows64 33 | runtime: il2cpp 34 | - os: windows-latest 35 | buildTarget: StandaloneWindows64 36 | runtime: dotnet 37 | - os: ubuntu-latest 38 | buildTarget: StandaloneLinux64 39 | runtime: mono 40 | - os: ubuntu-latest 41 | buildTarget: StandaloneLinux64 42 | runtime: il2cpp 43 | 44 | runs-on: ${{ matrix.os }} 45 | 46 | steps: 47 | - name: Checkout Repository 48 | uses: actions/checkout@v3 49 | - uses: actions/cache@v3 50 | with: 51 | # Library folder 52 | path: "${{ runner.workspace }}/Library" 53 | key: "Library-TsukiSuite-${{ runner.os }}-${{ env.UNITY_VERSION }}-${{ matrix.buildTarget }}-${{ matrix.runtime }}" 54 | restore-keys: | 55 | Library-TsukiSuite- 56 | Library- 57 | - name: Build Unity Project 58 | uses: game-ci/unity-builder@v4 59 | env: 60 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 61 | UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} 62 | UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} 63 | with: 64 | buildMethod: ${{ env.BUILD_METHOD }} 65 | targetPlatform: ${{ matrix.buildTarget }} 66 | unityVersion: ${{ env.UNITY_VERSION }} 67 | customParameters: > 68 | -scriptingBackend ${{ matrix.runtime }} 69 | -build Builds/${{ matrix.buildTarget }}/${{ matrix.runtime }} 70 | -buildOptions ${{ inputs.buildOptions || env.BUILD_OPTIONS }} 71 | -scenesPath ${{ inputs.scenesPath || env.SCENES_PATH }} 72 | -------------------------------------------------------------------------------- /Assets/Cheater.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18076fafa8b0418d8e89f5bfa92af1db 3 | timeCreated: 1651855626 -------------------------------------------------------------------------------- /Assets/Cheater/BasicCommands.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b8ed8ab8c6f4cf0b1fd1cb3d8b0ba56 3 | timeCreated: 1651856007 -------------------------------------------------------------------------------- /Assets/Cheater/CheaterStyles.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Editor; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Cheater { 4 | public class CheaterStyles { 5 | public static GUIStyle TextFieldInput = new GUIStyle(Styles.textarea) { 6 | 7 | }; 8 | public static GUIStyle DefaultBackground = new GUIStyle { 9 | normal = new GUIStyleState { 10 | background = Textures.Pixel(new Color32(39, 39, 39, (byte) (255 * 0.75F))), 11 | textColor = Color.white 12 | } 13 | }; 14 | public static GUIStyle CommandSuggestion = DefaultBackground.CopyWith(style => { 15 | 16 | }); 17 | public static GUIStyle CommandSuggestionSelected = DefaultBackground.CopyWith(style => { 18 | style.normal = new GUIStyleState { 19 | background = Textures.Pixel(new Color32(39, 39, 39, 255)), 20 | textColor = Color.green 21 | }; 22 | }); 23 | 24 | public static GUIStyle CommandHeader = new GUIStyle(Styles.HeaderLabel); 25 | } 26 | } -------------------------------------------------------------------------------- /Assets/Cheater/CheaterStyles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b08e443bd234f59afa3872df4009ec7 3 | timeCreated: 1651857758 -------------------------------------------------------------------------------- /Assets/Cheater/Command.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d856a23b72ec4bb89c2edb2fda3f1dfc 3 | timeCreated: 1651856262 -------------------------------------------------------------------------------- /Assets/Cheater/CommandArgument.cs: -------------------------------------------------------------------------------- 1 | namespace Lunari.Tsuki.Cheater { 2 | public abstract class CommandArgument { 3 | protected CommandArgument(string name, string description) { 4 | Name = name; 5 | Description = description; 6 | } 7 | 8 | public string Name { get; } 9 | 10 | public string Description { get; } 11 | 12 | public abstract string ArgumentType { get; } 13 | public string DescriptionOrDefault => Description.IsNullOrEmpty() ? "No description provided." : Description; 14 | public abstract void Consume(CommandParser parser); 15 | } 16 | 17 | public abstract class CommandArgument : CommandArgument { 18 | protected CommandArgument(string name, string description) : base(name, description) { } 19 | 20 | public override void Consume(CommandParser parser) { 21 | var err = string.Empty; 22 | Parse(parser, out _, ref err); 23 | } 24 | 25 | public abstract bool Parse(CommandParser parser, out T value, ref string error); 26 | } 27 | 28 | public class StringArgument : CommandArgument { 29 | public StringArgument(string name, string description) : base(name, description) { } 30 | 31 | public override string ArgumentType => "string"; 32 | 33 | public override bool Parse(CommandParser parser, out string value, ref string error) { 34 | value = parser.Take(); 35 | return true; 36 | } 37 | } 38 | 39 | public class IntArgument : CommandArgument { 40 | public IntArgument(string name, string description) : base(name, description) { } 41 | 42 | public override string ArgumentType => "int"; 43 | 44 | public override bool Parse(CommandParser parser, out int value, ref string error) { 45 | if (int.TryParse(parser.Take(), out value)) { 46 | return true; 47 | } 48 | 49 | return false; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assets/Cheater/CommandArgument.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a22aca7766394e679a3a5a03bdc8bd7a 3 | timeCreated: 1651856448 -------------------------------------------------------------------------------- /Assets/Cheater/CommandCompleter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbfea6dc9cd1497998c71ca2f4b09191 3 | timeCreated: 1651858567 -------------------------------------------------------------------------------- /Assets/Cheater/CommandHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492cf5f3fed24209b056704bdb9c2478 3 | timeCreated: 1651858596 -------------------------------------------------------------------------------- /Assets/Cheater/CommandManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Lunari.Tsuki.Singletons; 4 | namespace Lunari.Tsuki.Cheater { 5 | public static class CommandManager { 6 | 7 | public static HashSet Commands { 8 | get; 9 | } = new HashSet(); 10 | 11 | public static void Register(Command command) { 12 | Commands.Add(command); 13 | } 14 | public static void Register(params Command[] commands) { 15 | foreach (var command in commands) { 16 | Register(command); 17 | } 18 | } 19 | public static Command Get(string label) { 20 | return Commands.FirstOrDefault(command => CommandHelper.IsValidAlias(command, label)); 21 | } 22 | } 23 | 24 | 25 | } -------------------------------------------------------------------------------- /Assets/Cheater/CommandManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 278a1ad738cb46e38470a108db6b1700 3 | timeCreated: 1651855669 -------------------------------------------------------------------------------- /Assets/Cheater/CommandParser.cs: -------------------------------------------------------------------------------- 1 | namespace Lunari.Tsuki.Cheater { 2 | public class CommandParser { 3 | private string[] segments; 4 | private int current; 5 | 6 | public CommandParser(string[] segments) { 7 | this.segments = segments; 8 | current = 0; 9 | } 10 | 11 | public string Take() { 12 | if (current < segments.Length) { 13 | return segments[current++]; 14 | } 15 | 16 | return null; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Assets/Cheater/CommandParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94c7fe3a127946ec86899f9879027ba2 3 | timeCreated: 1657129733 -------------------------------------------------------------------------------- /Assets/Cheater/CommandWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e391a15594f4c86bed93163e4df94f7 3 | timeCreated: 1651857055 -------------------------------------------------------------------------------- /Assets/Cheater/Tsuki.Cheater.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Cheater", 3 | "rootNamespace": "Lunari.Tsuki", 4 | "references": [ 5 | "GUID:4c0668d2c90a58d40a31bb673f8cde7d", 6 | "GUID:4e4b2da11469cf1a1a03b701b200edf7" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": false, 14 | "precompiledReferences": [], 15 | "autoReferenced": true, 16 | "defineConstraints": [], 17 | "versionDefines": [], 18 | "noEngineReferences": false 19 | } -------------------------------------------------------------------------------- /Assets/Cheater/Tsuki.Cheater.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08bc3a3cad264aa384e7e2f50918896b 3 | timeCreated: 1651855641 -------------------------------------------------------------------------------- /Assets/Content.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eadf08e1457a00d23b6094f5324c33c6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Content/128w.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68927457d7a155d5ab5f83a428238d8b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Content/128w/TsukiLogo_Black_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Assets/Content/128w/TsukiLogo_Black_128px.png -------------------------------------------------------------------------------- /Assets/Content/128w/TsukiLogo_Black_128px.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6073f94fa1d5ce108b9e0fc860695c5f 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 3 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | forceMaximumCompressionQuality_BC6H_BC7: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 80 | internalID: 0 81 | vertices: [] 82 | indices: 83 | edges: [] 84 | weights: [] 85 | secondaryTextures: [] 86 | spritePackingTag: 87 | pSDRemoveMatte: 0 88 | pSDShowRemoveMatteOption: 0 89 | userData: 90 | assetBundleName: 91 | assetBundleVariant: 92 | -------------------------------------------------------------------------------- /Assets/Content/128w/TsukiLogo_White_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Assets/Content/128w/TsukiLogo_White_128px.png -------------------------------------------------------------------------------- /Assets/Content/128w/TsukiLogo_White_128px.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb8afe8f53e388b959dba3092fc76994 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 3 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | forceMaximumCompressionQuality_BC6H_BC7: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 80 | internalID: 0 81 | vertices: [] 82 | indices: 83 | edges: [] 84 | weights: [] 85 | secondaryTextures: [] 86 | spritePackingTag: 87 | pSDRemoveMatte: 0 88 | pSDShowRemoveMatteOption: 0 89 | userData: 90 | assetBundleName: 91 | assetBundleVariant: 92 | -------------------------------------------------------------------------------- /Assets/Content/1x.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2f89bccb197a16189ebf8357f92409a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Content/1x/TsukiLogo_Black_Original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Assets/Content/1x/TsukiLogo_Black_Original.png -------------------------------------------------------------------------------- /Assets/Content/1x/TsukiLogo_Black_Original.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0b04c9ad8d63dc61b5668247c7b54ac 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 3 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | forceMaximumCompressionQuality_BC6H_BC7: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 80 | internalID: 0 81 | vertices: [] 82 | indices: 83 | edges: [] 84 | weights: [] 85 | secondaryTextures: [] 86 | spritePackingTag: 87 | pSDRemoveMatte: 0 88 | pSDShowRemoveMatteOption: 0 89 | userData: 90 | assetBundleName: 91 | assetBundleVariant: 92 | -------------------------------------------------------------------------------- /Assets/Content/1x/TsukiLogo_White_Original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Assets/Content/1x/TsukiLogo_White_Original.png -------------------------------------------------------------------------------- /Assets/Content/1x/TsukiLogo_White_Original.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f140534113f814be81a0c5ce7dccd22 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 10 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 3 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | forceMaximumCompressionQuality_BC6H_BC7: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 80 | internalID: 0 81 | vertices: [] 82 | indices: 83 | edges: [] 84 | weights: [] 85 | secondaryTextures: [] 86 | spritePackingTag: 87 | pSDRemoveMatte: 0 88 | pSDShowRemoveMatteOption: 0 89 | userData: 90 | assetBundleName: 91 | assetBundleVariant: 92 | -------------------------------------------------------------------------------- /Assets/Content/Logo.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Assets/Content/Logo.ai -------------------------------------------------------------------------------- /Assets/Content/Logo.ai.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0f4243ed08a1b09487adb050172ec49 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Content/SVG.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b835056cd509e8728a03d5cf0340c02 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Content/SVG/TsukiLogo_Black_SVG.svg: -------------------------------------------------------------------------------- 1 | TsukiLogo_Black_SVG -------------------------------------------------------------------------------- /Assets/Content/SVG/TsukiLogo_Black_SVG.svg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6173c4c66a81bbc59aa856101396f932 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: a57477913897c46af95d590f580878bd, type: 3} 11 | svgType: 0 12 | texturedSpriteMeshType: 0 13 | svgPixelsPerUnit: 100 14 | gradientResolution: 64 15 | alignment: 0 16 | customPivot: {x: 0, y: 0} 17 | generatePhysicsShape: 0 18 | viewportOptions: 0 19 | preserveViewport: 0 20 | advancedMode: 0 21 | predefinedResolutionIndex: 1 22 | targetResolution: 1080 23 | resolutionMultiplier: 1 24 | stepDistance: 10 25 | samplingStepDistance: 100 26 | maxCordDeviationEnabled: 0 27 | maxCordDeviation: 1 28 | maxTangentAngleEnabled: 0 29 | maxTangentAngle: 5 30 | keepTextureAspectRatio: 1 31 | textureSize: 256 32 | textureWidth: 256 33 | textureHeight: 256 34 | wrapMode: 0 35 | filterMode: 1 36 | sampleCount: 4 37 | preserveSVGImageAspect: 0 38 | useSVGPixelsPerUnit: 0 39 | spriteData: 40 | TessellationDetail: 0 41 | SpriteRect: 42 | name: 43 | originalName: 44 | pivot: {x: 0, y: 0} 45 | alignment: 0 46 | border: {x: 0, y: 0, z: 0, w: 0} 47 | rect: 48 | serializedVersion: 2 49 | x: 0 50 | y: 0 51 | width: 0 52 | height: 0 53 | spriteID: 225548dfe23949e40b4edc696a63178a 54 | PhysicsOutlines: [] 55 | -------------------------------------------------------------------------------- /Assets/Content/SVG/TsukiLogo_White_SVG.svg: -------------------------------------------------------------------------------- 1 | TsukiLogo_White_SVG -------------------------------------------------------------------------------- /Assets/Content/SVG/TsukiLogo_White_SVG.svg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3de166e219d4c9aa9aea58789098b8f5 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: a57477913897c46af95d590f580878bd, type: 3} 11 | svgType: 0 12 | texturedSpriteMeshType: 0 13 | svgPixelsPerUnit: 100 14 | gradientResolution: 64 15 | alignment: 0 16 | customPivot: {x: 0, y: 0} 17 | generatePhysicsShape: 0 18 | viewportOptions: 0 19 | preserveViewport: 0 20 | advancedMode: 0 21 | predefinedResolutionIndex: 1 22 | targetResolution: 1080 23 | resolutionMultiplier: 1 24 | stepDistance: 10 25 | samplingStepDistance: 100 26 | maxCordDeviationEnabled: 0 27 | maxCordDeviation: 1 28 | maxTangentAngleEnabled: 0 29 | maxTangentAngle: 5 30 | keepTextureAspectRatio: 1 31 | textureSize: 256 32 | textureWidth: 256 33 | textureHeight: 256 34 | wrapMode: 0 35 | filterMode: 1 36 | sampleCount: 4 37 | preserveSVGImageAspect: 0 38 | useSVGPixelsPerUnit: 0 39 | spriteData: 40 | TessellationDetail: 0 41 | SpriteRect: 42 | name: 43 | originalName: 44 | pivot: {x: 0, y: 0} 45 | alignment: 0 46 | border: {x: 0, y: 0, z: 0, w: 0} 47 | rect: 48 | serializedVersion: 2 49 | x: 0 50 | y: 0 51 | width: 0 52 | height: 0 53 | spriteID: c0155000ada96c34f8d7bd2e13abecc8 54 | PhysicsOutlines: [] 55 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da4950149d9adb901aab3e3a59ca320a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor/AssetsUtility.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using Object = UnityEngine.Object; 6 | 7 | namespace Lunari.Tsuki.Editor { 8 | public static class AssetsUtility { 9 | public static T AddToAssetFile(this ScriptableObject obj, bool setDirty = true, bool save = true) 10 | where T : ScriptableObject { 11 | return (T) obj.AddToAssetFile(typeof(T), setDirty, save); 12 | } 13 | 14 | public static Object AddToAssetFile(this ScriptableObject obj, Type type, bool setDirty = true, 15 | bool save = true) { 16 | var o = ScriptableObject.CreateInstance(type); 17 | AssetDatabase.AddObjectToAsset(o, obj); 18 | if (setDirty) { 19 | EditorUtility.SetDirty(obj); 20 | } 21 | 22 | if (save) { 23 | AssetDatabase.SaveAssets(); 24 | } 25 | 26 | return o; 27 | } 28 | 29 | public static void CreateAsset(string path, Object asset) { 30 | var assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New Cutscene.asset"); 31 | AssetDatabase.CreateAsset(asset, assetPathAndName); 32 | AssetDatabase.SaveAssets(); 33 | EditorUtility.FocusProjectWindow(); 34 | Selection.activeObject = asset; 35 | } 36 | 37 | public static T CreateAsset(string path) where T : ScriptableObject { 38 | var obj = ScriptableObject.CreateInstance(); 39 | CreateAsset(path, obj); 40 | return obj; 41 | } 42 | } 43 | } 44 | #endif -------------------------------------------------------------------------------- /Assets/Editor/AssetsUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c4eeedc5cf69f929aae577961bbf8a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Drawers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5aebadac9ff41049a74a3cfa3692950 3 | timeCreated: 1607726911 -------------------------------------------------------------------------------- /Assets/Editor/Drawers/ClockDrawer.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Misc; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace Lunari.Tsuki.Editor.Drawers { 6 | [CustomPropertyDrawer(typeof(Clock))] 7 | public class ClockDrawer : PropertyDrawer { 8 | private bool open = true; 9 | 10 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { 11 | return Rectangles.GetHeight(open ? 3 : 1); 12 | } 13 | 14 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { 15 | var cooldown = property.FindPropertyRelative(nameof(Clock.cooldown)); 16 | open = EditorGUI.Foldout(position.GetLine(0), open, label); 17 | if (!open) { 18 | return; 19 | } 20 | 21 | using (new EditorGUI.IndentLevelScope()) { 22 | EditorGUI.PropertyField(position.GetLine(1), cooldown); 23 | cooldown.floatValue = 24 | 1 / EditorGUI.FloatField(position.GetLine(2), "Tick Rate", 1 / cooldown.floatValue); 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/Editor/Drawers/ClockDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b6c4595a9fd4a4f8b4c84bdabf46e87 3 | timeCreated: 1607726919 -------------------------------------------------------------------------------- /Assets/Editor/Drawers/SerializableInterfaceDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Lunari.Tsuki.Editor.Utilities; 3 | using Lunari.Tsuki.Misc; 4 | using UnityEditor; 5 | using UnityEngine; 6 | namespace Lunari.Tsuki.Editor.Drawers { 7 | [CustomPropertyDrawer(typeof(SerializableInterface<>), true)] 8 | public class SerializableInterfaceDrawer : PropertyDrawer { 9 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { 10 | var value = property.FindInstanceWithin(); 11 | var interf = (SerializableInterface) value; 12 | var type = value.GetType(); 13 | var interfaceType = type.BaseType.GetGenericArguments().Single(); 14 | interf.SetObject(EditorGUI.ObjectField(position, label, interf.GetObject(), interfaceType, property.serializedObject.targetObject)); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Assets/Editor/Drawers/SerializableInterfaceDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2c4264f4cac4438884284d183137f10 3 | timeCreated: 1644186385 -------------------------------------------------------------------------------- /Assets/Editor/Dropdowns.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEditor.IMGUI.Controls; 5 | namespace Lunari.Tsuki.Editor { 6 | public static class Dropdowns { 7 | public static AdvancedDropdownItem FindOrCreate(this AdvancedDropdownItem root, string path) { 8 | return FindOrCreate(root, path, n => new AdvancedDropdownItem(n)); 9 | } 10 | public static T FindOrCreate(this T root, string path, Func creator) where T : AdvancedDropdownItem { 11 | if (path.IsNullOrEmpty()) { 12 | return root; 13 | } 14 | var current = root; 15 | var toGet = new Queue(); 16 | foreach (var s in path.Split('/')) { 17 | toGet.Enqueue(s); 18 | } 19 | do { 20 | var next = toGet.Dequeue(); 21 | var candidate = (T)current.children.FirstOrDefault(item => item.name == next); 22 | if (candidate == null) { 23 | var newItem = creator(next); 24 | current.AddChild(newItem); 25 | current = newItem; 26 | } else { 27 | current = candidate; 28 | } 29 | } while (!toGet.IsEmpty()); 30 | return current; 31 | } 32 | public static void OrderByGroupFirst(this AdvancedDropdownItem root) { 33 | if (root.children is List children) { 34 | children.Sort(CompareItems); 35 | } 36 | foreach (var advancedDropdownItem in root.children) { 37 | advancedDropdownItem.OrderByGroupFirst(); 38 | } 39 | } 40 | private static int CompareItems(AdvancedDropdownItem x, AdvancedDropdownItem y) { 41 | var isFirstGroup = x.children.IsEmpty(); 42 | var isSecondGroup = y.children.IsEmpty(); 43 | if (isFirstGroup == isSecondGroup) { 44 | return 0; 45 | } 46 | if (isFirstGroup) { 47 | return 1; 48 | } 49 | return -1; 50 | } 51 | 52 | } 53 | } -------------------------------------------------------------------------------- /Assets/Editor/Dropdowns.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5dbaba7475354431b0039624a2e7bf62 3 | timeCreated: 1610732884 -------------------------------------------------------------------------------- /Assets/Editor/Extenders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc61d6460c29bd429400e37e5ac911d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Extenders/DropdownButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEditor.IMGUI.Controls; 3 | using UnityEngine; 4 | namespace Lunari.Tsuki.Editor.Extenders { 5 | public class DropdownButton { 6 | private Rect lastRect; 7 | private readonly AdvancedDropdown dropdown; 8 | 9 | public GUIContent Label { 10 | get; 11 | set; 12 | } 13 | 14 | public DropdownButton(AdvancedDropdown dropdown, GUIContent label) { 15 | this.dropdown = dropdown; 16 | Label = label; 17 | 18 | } 19 | public void OnGUI() { 20 | var r = EditorGUILayout.DropdownButton(Label, FocusType.Passive); 21 | if (Event.current.type == EventType.Repaint) { 22 | lastRect = GUILayoutUtility.GetLastRect(); 23 | } 24 | 25 | if (r) { 26 | dropdown.Show(lastRect); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Editor/Extenders/DropdownButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ba4f006a78b4b00a6f3b3558a4ad6df 3 | timeCreated: 1610733242 -------------------------------------------------------------------------------- /Assets/Editor/Extenders/InlinedObjectList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 022c26c16b40f3897b14e8be26d2ad4f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Extenders/TypeSelectorButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Lunari.Tsuki.Editor.Utilities; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using UnityEngine.Events; 6 | namespace Lunari.Tsuki.Editor.Extenders { 7 | public delegate void RectModifier(ref Rect rect); 8 | public sealed class TypeSelectorButton { 9 | private Rect lastRect; 10 | private readonly TypeSelectorDropdown selector; 11 | private readonly ModularContent guiContent; 12 | public event RectModifier RectCalculated; 13 | 14 | public TypeSelectorButton( 15 | ModularContent guiContent, 16 | TypeSelectorDropdown.OnSelectedCallback onTypeSelected, 17 | TypeSelectorDropdown.PathSelector groupSelector = null, 18 | Predicate typeFilter = null 19 | ) { 20 | this.guiContent = guiContent; 21 | selector = new TypeSelectorDropdown(onTypeSelected, groupSelector, typeFilter); 22 | } 23 | 24 | public void OnInspectorGUI() { 25 | var r = EditorGUILayout.DropdownButton(guiContent.Content, FocusType.Passive); 26 | if (Event.current.type == EventType.Repaint) { 27 | lastRect = GUILayoutUtility.GetLastRect(); 28 | RectCalculated?.Invoke(ref lastRect); 29 | } 30 | 31 | if (r) { 32 | selector.Show(lastRect); 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/Editor/Extenders/TypeSelectorButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35d1010242404a26a9d72740a51411e4 3 | timeCreated: 1609785369 -------------------------------------------------------------------------------- /Assets/Editor/Extenders/TypeSelectorDropdown.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ba919f8d50b4272b73dabb5b8c34456 3 | timeCreated: 1609784236 -------------------------------------------------------------------------------- /Assets/Editor/Icons.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec46471689f1cc749a4e37876427f1e9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Plotting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44d851538dcd46678849542cbfc3d6b0 3 | timeCreated: 1644178609 -------------------------------------------------------------------------------- /Assets/Editor/Plotting/Plot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | namespace Lunari.Tsuki.Editor.Plotting { 5 | public class Plot { 6 | private Vector3[] points; 7 | private float[] data; 8 | public Plot(float min = 0, float max = 1) { 9 | Min = min; 10 | Max = max; 11 | } 12 | 13 | public bool Enabled { 14 | get; 15 | set; 16 | } = true; 17 | 18 | public Color Color { 19 | get; 20 | set; 21 | } 22 | 23 | public float Thickness { 24 | get; 25 | set; 26 | } = 1; 27 | 28 | public float[] Data => data; 29 | 30 | public float Min { 31 | get; 32 | set; 33 | } = 0; 34 | 35 | public float Max { 36 | get; 37 | set; 38 | } = 1.0F; 39 | 40 | public void Resize(int size) { 41 | Array.Resize(ref data, size); 42 | Array.Resize(ref points, size); 43 | } 44 | public void Draw(Rect rect) { 45 | if (!Enabled) { 46 | return; 47 | } 48 | var count = data.Length; 49 | var sampleSize = rect.width / count; 50 | var i = 0; 51 | GUI.BeginClip(rect); 52 | var oldColor = Handles.color; 53 | Handles.color = Color; 54 | foreach (var value in data) { 55 | var relative = Mathf.Clamp01(Mathf.InverseLerp(Min, Max, value)); 56 | var x = i * sampleSize; 57 | var height = rect.height; 58 | var yOffset = (height - 1) * relative; 59 | var y = height - yOffset; 60 | points[i] = new Vector3 { 61 | x = x, 62 | y = y, 63 | z = 0 64 | }; 65 | i++; 66 | } 67 | Handles.DrawAAPolyLine( 68 | Texture2D.whiteTexture, 69 | Thickness, 70 | points 71 | ); 72 | Handles.color = oldColor; 73 | GUI.EndClip(); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /Assets/Editor/Plotting/Plot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da1c672be2c941aab71cddfb8512e9df 3 | timeCreated: 1644177919 -------------------------------------------------------------------------------- /Assets/Editor/Plotting/Plotter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Editor.Plotting { 4 | public abstract class PlotterBase { 5 | protected static Rect GetPlotRect(float height) { 6 | var rect = GUILayoutUtility.GetRect(0, float.MaxValue, 7 | height, height, 8 | Styles.box 9 | ); 10 | return rect; 11 | } 12 | public abstract void Plot(float height); 13 | } 14 | public class Plotter : PlotterBase { 15 | private List plots; 16 | public void AddPlot(Plot p) { 17 | plots.Add(p); 18 | } 19 | public sealed override void Plot( 20 | float height 21 | ) { 22 | var rect = GetPlotRect(height); 23 | GUI.Box(rect, GUIContent.none); 24 | foreach (var plot in plots) { 25 | plot.Draw(rect); 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/Editor/Plotting/Plotter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15baec7bf29c4a42b1e519dd08b3e882 3 | timeCreated: 1643242167 -------------------------------------------------------------------------------- /Assets/Editor/Plotting/SplitPlotter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Lunari.Tsuki.Scopes; 3 | using UnityEditor; 4 | using UnityEngine; 5 | namespace Lunari.Tsuki.Editor.Plotting { 6 | public class SplitPlotter : PlotterBase { 7 | private Plot left, right; 8 | public SplitPlotter(Plot left, Plot right) { 9 | this.left = left; 10 | this.right = right; 11 | } 12 | 13 | public string LeftTitle { 14 | get; 15 | set; 16 | } 17 | 18 | public string RightTitle { 19 | get; 20 | set; 21 | } 22 | 23 | private void DrawLimits( 24 | Rect rect, 25 | string title, 26 | Plot plot, 27 | GUIStyle style 28 | ) { 29 | if (!plot.Enabled) { 30 | return; 31 | } 32 | float lineHeight = EditorGUIUtility.singleLineHeight + 2; 33 | var current = rect.SetHeight(lineHeight); 34 | var minContent = new GUIContent($"Min: {plot.Min}"); 35 | var maxContent = new GUIContent($"Max: {plot.Max}"); 36 | if (!title.IsNullOrEmpty()) { 37 | GUI.Label(current, title, style); 38 | current = current.AddY(lineHeight); 39 | } 40 | GUI.Label(current, minContent, style); 41 | current = current.AddY(lineHeight); 42 | GUI.Label(current, maxContent, style); 43 | } 44 | 45 | public override void Plot(float height) { 46 | var rect = GetPlotRect(height); 47 | /*if (left.Enabled || right.Enabled) { 48 | GUI.Box(rect, GUIContent.none); 49 | }*/ 50 | left.Draw(rect); 51 | right.Draw(rect); 52 | const float limitsSize = 128; 53 | var leftRect = rect.AlignLeft(limitsSize); 54 | var rightRect = rect.AlignRight(limitsSize); 55 | DrawLimits(leftRect, LeftTitle, left, Styles.label); 56 | DrawLimits(rightRect, RightTitle, right, Styles.RightAlignedLabel); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/Editor/Plotting/SplitPlotter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6cb4922628c4c4d89e8cb4c45972860 3 | timeCreated: 1644178632 -------------------------------------------------------------------------------- /Assets/Editor/Preference.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a4f9969ad8046a7986c812c30948739 3 | timeCreated: 1644171601 -------------------------------------------------------------------------------- /Assets/Editor/Preference/EditorPreferenceExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UIElements; 2 | namespace Lunari.Tsuki.Editor.Preference { 3 | public static class EditorPreferenceExtensions { 4 | public static void Bind(this INotifyValueChanged control, EditorPreference preference) { 5 | control.value = preference.Value; 6 | control.RegisterValueChangedCallback(evt => preference.Value = evt.newValue); 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /Assets/Editor/Preference/EditorPreferenceExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8913d8fc6c22476a8b635c4f091b640d 3 | timeCreated: 1655846199 -------------------------------------------------------------------------------- /Assets/Editor/Preference/EditorPreferences.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73138d6675e94be2a46c89bf1b868389 3 | timeCreated: 1644171616 -------------------------------------------------------------------------------- /Assets/Editor/Properties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69e8ef073deaf9502afcc1fcacd90c0a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Tsuki-Editor")] 5 | [assembly: AssemblyDescription("A set of libraries created for improving workflow on the Unity Engine's Editor")] 6 | [assembly: AssemblyCompany("Lunari Studios")] 7 | [assembly: AssemblyProduct("Tsuki-Editor")] 8 | [assembly: AssemblyCopyright("Copyright © 2019")] 9 | [assembly: AssemblyVersion("2.1.0")] 10 | [assembly: ComVisible(false)] 11 | 12 | [assembly: Guid("514403C5-C91E-441F-9B99-8732947A6238")] -------------------------------------------------------------------------------- /Assets/Editor/Properties/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7d3ec42606efdcd0a74395f5dab9115 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Styles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fce21040ac6b5fe489f19ae7859e4aba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Tsuki.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Editor", 3 | "rootNamespace": "Lunari.Tsuki", 4 | "references": [ 5 | "GUID:4c0668d2c90a58d40a31bb673f8cde7d" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Assets/Editor/Tsuki.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e4b2da11469cf1a1a03b701b200edf7 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Editor/TsukiBuild.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab8703d8a4b140fcbe2627c1cffd6146 3 | timeCreated: 1740693338 -------------------------------------------------------------------------------- /Assets/Editor/TsukiGUILayout.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8c742c9985f41cb8b22bdd4ab3fd7c5 3 | timeCreated: 1609686759 -------------------------------------------------------------------------------- /Assets/Editor/TsukiStyles.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace Lunari.Tsuki.Editor { 5 | public static class TsukiStyles { 6 | public static readonly GUIStyle NoMargin = new GUIStyle { 7 | border = new RectOffset(), 8 | margin = new RectOffset(), 9 | stretchWidth = false 10 | }; 11 | } 12 | } -------------------------------------------------------------------------------- /Assets/Editor/TsukiStyles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb7cd9aacb5a1d19c8a6040b8d945d23 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 620f136791741da65825079da7b53714 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Utilities/EditorGUI2.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | namespace Lunari.Tsuki.Editor.Utilities { 3 | public static class EditorGUI2 { 4 | public static readonly float fullSingleLineHeight = GetHeight(1); 5 | public static float GetHeight(int numLines) { 6 | var height = (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) * numLines; 7 | return height; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Editor/Utilities/EditorGUI2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 301a143bb7174619a79f01659b76b348 3 | timeCreated: 1644781616 -------------------------------------------------------------------------------- /Assets/Editor/Utilities/GUIStyleExtraction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0858d18ea7b42c7bfd3160a67c247ac 3 | timeCreated: 1638903853 -------------------------------------------------------------------------------- /Assets/Editor/Utilities/Handles2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2f02c52f22747bf9aa780c19f9ab893 3 | timeCreated: 1644204604 -------------------------------------------------------------------------------- /Assets/Editor/Utilities/ModularContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lunari.Tsuki.Editor.Utilities { 4 | /// 5 | /// Represent a value that may be static or dynamic in relation to a context. 6 | ///
7 | /// The most clear use of this is for easily creating GUIContent on editors. 8 | /// 9 | /// See . 10 | /// 11 | ///
12 | /// 13 | public class ModularContent { 14 | private readonly T staticContent; 15 | private readonly Func dynamicContent; 16 | 17 | public ModularContent(T staticContent) { 18 | this.staticContent = staticContent; 19 | dynamicContent = null; 20 | } 21 | 22 | public ModularContent(Func dynamicContent) { 23 | this.dynamicContent = dynamicContent; 24 | staticContent = default(T); 25 | } 26 | 27 | public T Content => dynamicContent != null ? dynamicContent() : staticContent; 28 | 29 | public static implicit operator ModularContent(T value) { 30 | return new ModularContent(value); 31 | } 32 | 33 | public static implicit operator ModularContent(Func creator) { 34 | return new ModularContent(creator); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/Editor/Utilities/ModularContent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b32a38b32253385a93c8830ad0ebf8d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Utilities/Serialization.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cf65b1bb9195d378ae12063285d8f13 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbf37eb39bd74a7bbbc38332054c0d68 3 | timeCreated: 1638903910 -------------------------------------------------------------------------------- /Assets/Editor/Windows/EditorContentVisualizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4a5eb13016446869cc3b4e821337ee9 3 | timeCreated: 1610731642 -------------------------------------------------------------------------------- /Assets/Editor/Windows/GUIStyleInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ee75d2554ea4e4a96699ff48b8ca56a 3 | timeCreated: 1638903916 -------------------------------------------------------------------------------- /Assets/Editor/Windows/IconsGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d96e8a7650aeecc468409f24e2fe107a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/Windows/StylesGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edba8bb13f9347658c4018f006626ad1 3 | timeCreated: 1607355498 -------------------------------------------------------------------------------- /Assets/Entities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eca73348b932c9f4494938b651ecab7f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Entities/Common.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99e5f964c7a842a5b80113eeaac868d3 3 | timeCreated: 1609624105 -------------------------------------------------------------------------------- /Assets/Entities/Common/Gauge.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | #if ODIN_INSPECTOR 3 | using Sirenix.OdinInspector; 4 | #endif 5 | namespace Lunari.Tsuki.Entities.Common { 6 | public class Gauge : Trait { 7 | [SerializeField] 8 | #if ODIN_INSPECTOR 9 | [HideInInspector] 10 | #endif 11 | private float value = 5; 12 | 13 | [SerializeField] 14 | #if ODIN_INSPECTOR 15 | [HideInInspector] 16 | #endif 17 | private float maxValue = 10; 18 | 19 | [SerializeField] 20 | private float restoration = 3; 21 | 22 | public bool regenerate = true; 23 | 24 | #if ODIN_INSPECTOR 25 | [ShowInInspector] 26 | #endif 27 | public float Value { 28 | get => value; 29 | set => this.value = Mathf.Clamp(value, 0, maxValue); 30 | } 31 | #if ODIN_INSPECTOR 32 | [ShowInInspector] 33 | #endif 34 | public float MaxValue { 35 | get => maxValue; 36 | set { 37 | maxValue = value; 38 | this.value = Mathf.Clamp(this.value, 0, maxValue); 39 | } 40 | } 41 | 42 | public float Percentage => value / maxValue; 43 | 44 | private void Update() { 45 | if (!regenerate) { 46 | return; 47 | } 48 | 49 | var accumulation = restoration * Time.deltaTime; 50 | if (value + accumulation > maxValue) { 51 | value = maxValue; 52 | } else { 53 | value += accumulation; 54 | } 55 | } 56 | 57 | public virtual bool Consume(float amount) { 58 | if (value <= amount) { 59 | return false; 60 | } 61 | 62 | value -= amount; 63 | return true; 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Assets/Entities/Common/Gauge.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb5f0621f0f24de987e5c08c8e8ff3fd 3 | timeCreated: 1609624110 -------------------------------------------------------------------------------- /Assets/Entities/Common/TraitDescriptorExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Text; 3 | using Lunari.Tsuki.Entities.Problems; 4 | using UnityEngine.Events; 5 | 6 | namespace Lunari.Tsuki.Entities.Common { 7 | public static class TraitDescriptorExtensions { 8 | private static ProblemBuilder CreateValueNotEqualProblem(this TraitDescriptor descriptor, T value, T required, string fieldName) { 9 | var builder = new StringBuilder(); 10 | builder.Append($"Value {value} "); 11 | if (fieldName != null) { 12 | builder.Append($"({fieldName}) "); 13 | } 14 | return descriptor.AddProblem($"is not equal to {required}"); 15 | } 16 | public static void EnsureEqual(this TraitDescriptor descriptor, ref T value, T required, string fieldName = null) { 17 | if (!value.Equals(required)) { 18 | value = required; 19 | } 20 | } 21 | public static void EnsureEqual(this TraitDescriptor descriptor, T value, T required, string fieldName = null) { 22 | if (!value.Equals(required)) { 23 | descriptor.CreateValueNotEqualProblem(value, required, fieldName); 24 | } 25 | } 26 | 27 | public static void EnsureEqual(this TraitDescriptor descriptor, T value, T required, UnityAction setter, string fieldName = null) { 28 | if (!value.Equals(required)) { 29 | descriptor.CreateValueNotEqualProblem(value, required, fieldName) 30 | .WithSolution($"Set {fieldName} to {required}", () => { 31 | setter(required); 32 | }); 33 | 34 | } 35 | } 36 | public static void EnsureIsAnyOf(this TraitDescriptor descriptor, T value, UnityAction setter, string fieldName = null, params T[] required) { 37 | if (!required.Contains(value)) { 38 | var p = descriptor.AddProblem($"{fieldName ?? "Value "} {value} is not one of: {string.Join(", ", required)}"); 39 | foreach (var r in required) { 40 | p.WithSolution($"Set {fieldName} to {r}", () => { 41 | setter(r); 42 | }); 43 | } 44 | } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Assets/Entities/Common/TraitDescriptorExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0686827e7b7a08443946a39de064105e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Entities/Dependencies.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4d1da3a442046c8a6e3c855b60d764e 3 | timeCreated: 1610048845 -------------------------------------------------------------------------------- /Assets/Entities/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c204ea4b5a044f04950245b96f631986 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Entities/Editor/CompileDefinitions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using UnityEditor; 4 | namespace Lunari.Tsuki.Entities.Editor { 5 | public static class CompileDefinitions { 6 | public const string EntitiesCompileDefinition = "TSUKI_ENTITIES"; 7 | [InitializeOnLoadMethod] 8 | public static void EnsureHasDefinitions() { 9 | var group = EditorUserBuildSettings.selectedBuildTargetGroup; 10 | var definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); 11 | var definitions = new HashSet(definesString.Split(';')); 12 | if (!definitions.Contains(EntitiesCompileDefinition)) { 13 | definitions.Add(EntitiesCompileDefinition); 14 | } 15 | PlayerSettings.SetScriptingDefineSymbolsForGroup( 16 | group, 17 | definitions.ToArray() 18 | ); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Entities/Editor/CompileDefinitions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7238d125eede49b0b82a39ab487547e4 3 | timeCreated: 1644426818 -------------------------------------------------------------------------------- /Assets/Entities/Editor/DependenciesSugarGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc61754d79df4445a8ef679faa5cf26c 3 | timeCreated: 1610049024 -------------------------------------------------------------------------------- /Assets/Entities/Editor/EntityEditor.Styles.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Lunari.Tsuki.Editor; 3 | using UnityEngine; 4 | namespace Lunari.Tsuki.Entities.Editor { 5 | public partial class EntityEditor { 6 | private static readonly Lazy TraitCategoryHeaderStyle = new Lazy(() => new GUIStyle(Styles.FoldoutHeader) { 7 | margin = new RectOffset(32, 32, 32, 32) 8 | }); 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Entities/Editor/EntityEditor.Styles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fda6e9d434974678a77a963be1c03ab2 3 | timeCreated: 1638904342 -------------------------------------------------------------------------------- /Assets/Entities/Editor/EntityEditor.Traits.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe9f64ec8ff441d4af066b0841084391 3 | timeCreated: 1637429090 -------------------------------------------------------------------------------- /Assets/Entities/Editor/EntityEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d40ad6364f694beaa1e0a38715e6b851 3 | timeCreated: 1609625413 -------------------------------------------------------------------------------- /Assets/Entities/Editor/EntityMeta.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Lunari.Tsuki.Algorithm; 4 | using Lunari.Tsuki.Entities.Problems; 5 | namespace Lunari.Tsuki.Entities.Editor { 6 | /** 7 | * Pre-calculated information about a entity. 8 | */ 9 | public class EntityMeta { 10 | 11 | public Entity Entity { 12 | get; 13 | } 14 | 15 | public ITrait[] AllTraits { 16 | get; 17 | } 18 | 19 | public Tree TraitTree { 20 | get; 21 | } 22 | 23 | public EntityMeta(Entity entity) { 24 | Entity = entity; 25 | AllTraits = entity.GetComponentsInChildren(); 26 | TraitTree = TraitEditorUtils.FindTraitTreeOf(AllTraits); 27 | foreach (var trait in AllTraits) { 28 | trait.PeekDescription(); 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Assets/Entities/Editor/EntityMeta.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da8e271fe2004c7794c27304c304444c 3 | timeCreated: 1637432102 -------------------------------------------------------------------------------- /Assets/Entities/Editor/TraitEditor.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Editor; 2 | using Lunari.Tsuki.Scopes; 3 | using UnityEditor; 4 | using UnityEngine; 5 | namespace Lunari.Tsuki.Entities.Editor { 6 | [CustomEditor(typeof(Trait), true)] 7 | public class TraitEditor : UnityEditor.Editor { 8 | public override void OnInspectorGUI() { 9 | using (new EditorGUILayout.VerticalScope(Styles.box)) { 10 | if (target is Trait trait) { 11 | var entity = trait.GetComponentInParent(); 12 | if (entity == null) { 13 | EditorGUILayout.HelpBox("This trait is not owned by any entity.", MessageType.Warning); 14 | } else { 15 | using (new GUIEnabledScope(false)) { 16 | using (new EditorGUILayout.HorizontalScope()) { 17 | EditorGUILayout.ObjectField("Entity", entity, typeof(Entity), true); 18 | if (!TraitEditorUtils.IsCurrentlySelected(entity)) { 19 | using (new GUIEnabledScope(true)) { 20 | if (GUILayout.Button("Select")) { 21 | Selection.activeObject = entity; 22 | } 23 | } 24 | } 25 | } 26 | } 27 | } 28 | } 29 | } 30 | base.OnInspectorGUI(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/Entities/Editor/TraitEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4122095a2544f8b8fb658633417d7fa 3 | timeCreated: 1639420864 -------------------------------------------------------------------------------- /Assets/Entities/Editor/TraitEditorUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Lunari.Tsuki.Algorithm; 5 | using UnityEditor; 6 | using UnityEngine; 7 | 8 | namespace Lunari.Tsuki.Entities.Editor { 9 | public static class TraitEditorUtils { 10 | public static Entity TryFindParentEntity(this ITrait t) { 11 | return t.gameObject.GetComponentInParent(); 12 | } 13 | public static Tree FindTraitTreeOf(IEnumerable traits) { 14 | var tree = new Tree(new TraitGroup()); 15 | foreach (var trait in traits) { 16 | var location = TraitExtensions.FindTraitLocation(trait); 17 | var node = location.IsNullOrEmpty() ? tree.Root.Value : tree.FindOrCreate(location); 18 | node.Add(trait); 19 | } 20 | 21 | return tree; 22 | } 23 | public static TraitDescriptor PeekDescription(this ITrait trait) { 24 | var entity = trait.gameObject.GetComponentInParent(); 25 | if (entity == null) { 26 | return null; 27 | } 28 | var allTraits = entity.GetComponentsInChildren(); 29 | return trait.PeekDescription(entity, allTraits); 30 | } 31 | public static TraitDescriptor PeekDescription(this ITrait trait, Entity entity, ITrait[] all) { 32 | trait.TryClaim(entity, all, out var dependencies, false); 33 | return dependencies; 34 | } 35 | public static bool IsCurrentlySelected(Component trait) { 36 | var activeObject = Selection.activeObject; 37 | var candidates = new List() { 38 | trait, 39 | trait.gameObject 40 | }; 41 | var entity = trait.GetComponentInParent(); 42 | if (entity != null) { 43 | candidates.Add(entity); 44 | } 45 | return candidates.Any(candidate => candidate == activeObject); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Assets/Entities/Editor/TraitEditorUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecb7a844e2744982aa358ccd1868e437 3 | timeCreated: 1619013907 -------------------------------------------------------------------------------- /Assets/Entities/Editor/TraitGroup.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | namespace Lunari.Tsuki.Entities.Editor { 4 | public class TraitGroup : IEnumerable { 5 | private List traits; 6 | public TraitGroup() : this(new List()) { 7 | } 8 | public TraitGroup(List traits) { 9 | this.traits = traits; 10 | } 11 | 12 | public void Add(ITrait trait) { 13 | traits.Add(trait); 14 | } 15 | public IEnumerator GetEnumerator() { 16 | return traits.GetEnumerator(); 17 | } 18 | IEnumerator IEnumerable.GetEnumerator() { 19 | return GetEnumerator(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/Entities/Editor/TraitGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33704d4dab0344fd83b08b71988e0ac1 3 | timeCreated: 1637429241 -------------------------------------------------------------------------------- /Assets/Entities/Editor/Tsuki.Entities.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Entities.Editor", 3 | "rootNamespace": "Lunari.Tsuki", 4 | "references": [ 5 | "GUID:c7b2a1cd13c5ebf469a4669c48bef51c", 6 | "GUID:4e4b2da11469cf1a1a03b701b200edf7", 7 | "GUID:4c0668d2c90a58d40a31bb673f8cde7d" 8 | ], 9 | "includePlatforms": [ 10 | "Editor" 11 | ], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "defineConstraints": [], 18 | "versionDefines": [], 19 | "noEngineReferences": false 20 | } -------------------------------------------------------------------------------- /Assets/Entities/Editor/Tsuki.Entities.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24dc55227be3bb04f866dc23aa97101f 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Entities/Entity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | #if ODIN_INSPECTOR 6 | using Sirenix.Utilities; 7 | #endif 8 | using UnityEngine; 9 | using UnityEngine.Events; 10 | 11 | namespace Lunari.Tsuki.Entities { 12 | public class Entity : MonoBehaviour, ITraits { 13 | private bool aware; 14 | private readonly Traits traits = new Traits(); 15 | public UnityEvent onAwareChanged = new UnityEvent(); 16 | public UnityEvent onDeleted = new UnityEvent(); 17 | 18 | public bool Aware { 19 | get => aware; 20 | set { 21 | if (aware == value) { 22 | return; 23 | } 24 | 25 | aware = value; 26 | onAwareChanged.Invoke(); 27 | } 28 | } 29 | 30 | private void Awake() { 31 | Aware = true; 32 | var allTraits = GetComponentsInChildren() 33 | .OrderBy(trait => trait.Priority) 34 | .ToArray(); 35 | foreach (var trait in allTraits) { 36 | if (traits.HasTrait(allTraits.GetType())) { 37 | Debug.LogWarning( 38 | $"Entity '{this}' has multiple traits of type '{trait.GetType()}', please remove one of the traits before building for Release" 39 | ); 40 | continue; 41 | } 42 | 43 | if (!trait.TryClaim(this, allTraits, out var dependencies)) { 44 | Debug.LogWarning( 45 | $"Unable to claim trait {trait}: {dependencies.FailureReason}", 46 | this 47 | ); 48 | continue; 49 | } 50 | 51 | traits.Include(trait); 52 | } 53 | } 54 | 55 | public T GetTrait(bool allowSubclasses = false) where T : ITrait { 56 | return traits.GetTrait(allowSubclasses); 57 | } 58 | 59 | public IEnumerable GetTraits() where T : ITrait { 60 | return traits.GetTraits(); 61 | } 62 | 63 | public void Delete() { 64 | onDeleted.Invoke(); 65 | Destroy(gameObject); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Assets/Entities/Entity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 611971c709683634c8e1faf601854baf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: f9fb8c2a667814442b2503995a6b8ac5, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Entities/EntityEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine.Events; 3 | namespace Lunari.Tsuki.Entities { 4 | [Serializable] 5 | public class EntityEvent : UnityEvent { } 6 | } -------------------------------------------------------------------------------- /Assets/Entities/EntityEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bab5eb2e9af42829b60097b32ec923d 3 | timeCreated: 1609966371 -------------------------------------------------------------------------------- /Assets/Entities/EntityExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | namespace Lunari.Tsuki.Entities { 3 | public static class EntityExtensions { 4 | public static bool FindEntity(this GameObject gameObject, out Entity entity) { 5 | return gameObject.TryGetComponentInParent(out entity); 6 | } 7 | public static bool FindEntity(this Collider2D collider, out Entity entity) { 8 | return collider.TryGetComponentInParent(out entity); 9 | } 10 | 11 | public static bool FindEntity(this Collider collider, out Entity entity) { 12 | return collider.TryGetComponentInParent(out entity); 13 | } 14 | public static bool FindTrait(this GameObject gameObject, out T trait) where T : ITrait { 15 | if (!gameObject.FindEntity(out var entity)) { 16 | return entity.Access(out trait); 17 | } 18 | trait = default; 19 | return false; 20 | } 21 | public static bool FindTrait(this Collider2D collider, out T trait) where T : ITrait { 22 | if (collider.FindEntity(out var entity)) { 23 | return entity.Access(out trait); 24 | } 25 | trait = default; 26 | return false; 27 | } 28 | 29 | public static bool FindTrait(this Collider collider, out T trait) where T : ITrait { 30 | if (!collider.FindEntity(out var entity)) { 31 | return entity.Access(out trait); 32 | } 33 | trait = default; 34 | return false; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/Entities/EntityExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b42aad1d0493421c9b91eb94e396b833 3 | timeCreated: 1654379682 -------------------------------------------------------------------------------- /Assets/Entities/ITraits.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4724ba94a9b4145a0b27970cd0bd078 3 | timeCreated: 1609623197 -------------------------------------------------------------------------------- /Assets/Entities/Network.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f792e97b23e417e97fdc9f4cf9dfecb 3 | timeCreated: 1652730758 -------------------------------------------------------------------------------- /Assets/Entities/Network/NetworkTrait.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki; 2 | using Lunari.Tsuki.Entities; 3 | using Unity.Netcode; 4 | namespace Lunari.Entities.Network { 5 | public abstract class NetworkTrait : NetworkBehaviour, ITrait { 6 | private Entity owner; 7 | 8 | public Entity Owner { 9 | get => owner; 10 | private set => owner = value; 11 | } 12 | 13 | public TraitDescriptor TryClaim(Entity requisitor, ITrait[] traits, bool initialize = true) { 14 | return this.ExecuteClaim(requisitor, traits, initialize, out owner); 15 | } 16 | public virtual void Describe(TraitDescriptor descriptor) { } 17 | 18 | public override string ToString() { 19 | var ownerName = Owner == null ? "none" : Owner.name; 20 | return $"{GetType().GetLegibleName()} (Owned by {ownerName})"; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/Entities/Network/NetworkTrait.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e405eccaf374ff88fcff2bbbe7917f6 3 | timeCreated: 1652730810 -------------------------------------------------------------------------------- /Assets/Entities/Network/Tsuki.Entities.Network.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Entities.Network", 3 | "rootNamespace": "Lunari.Tsuki", 4 | "references": [ 5 | "GUID:4c0668d2c90a58d40a31bb673f8cde7d", 6 | "GUID:c7b2a1cd13c5ebf469a4669c48bef51c", 7 | "GUID:1491147abca9d7d4bb7105af628b223e", 8 | "GUID:2bafac87e7f4b9b418d9448d219b01ab", 9 | "GUID:343deaaf83e0cee4ca978e7df0b80d21" 10 | ], 11 | "includePlatforms": [], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "versionDefines": [ 18 | { 19 | "name": "com.unity.netcode.gameobjects", 20 | "expression": "", 21 | "define": "HAS_NETCODE" 22 | } 23 | ], 24 | "defineConstraints": [ 25 | "HAS_NETCODE" 26 | ], 27 | "noEngineReferences": false 28 | } -------------------------------------------------------------------------------- /Assets/Entities/Network/Tsuki.Entities.Network.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9af15e02c7547f8b45e2d8ba08061d2 3 | timeCreated: 1652730762 -------------------------------------------------------------------------------- /Assets/Entities/Problems.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7b76071ee364980bd511aae69c92f7f 3 | timeCreated: 1610048732 -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingAnimatorController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | namespace Lunari.Tsuki.Entities.Problems { 3 | public class MissingAnimatorController : Problem { 4 | public MissingAnimatorController(ITrait requisitor, Entity entity, Animator animator) : base(requisitor, entity, $"Animator {animator} does not have an animator controller") { 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingAnimatorController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6e1a14d052f432da365ce0eb008b57d 3 | timeCreated: 1610735319 -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingAnimatorParameter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | #if UNITY_EDITOR 3 | using UnityEditor.Animations; 4 | #endif 5 | namespace Lunari.Tsuki.Entities.Problems { 6 | public class MissingAnimatorParameter : Problem { 7 | public MissingAnimatorParameter( 8 | Entity entity, 9 | string name, 10 | AnimatorControllerParameterType parameterType, 11 | ITrait requisitor 12 | ) : base(requisitor, entity, $"Entity {entity.name}'s animator not have a parameter named {name} of type {parameterType} which is a dependency of {requisitor} ") { 13 | ParameterName = name; 14 | ParameterType = parameterType; 15 | #if UNITY_EDITOR 16 | WithSolution($"Add {name} ({parameterType})", 17 | () => { 18 | var animator = entity.GetComponentInChildren(); 19 | if (animator.runtimeAnimatorController is AnimatorController controller) { 20 | controller.AddParameter(name, parameterType); 21 | } 22 | }); 23 | #endif 24 | } 25 | 26 | public string ParameterName { 27 | get; 28 | } 29 | 30 | public AnimatorControllerParameterType ParameterType { 31 | get; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingAnimatorParameter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13c54166f28f4cd5861ea40455fcacd5 3 | timeCreated: 1610053818 -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingComponent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | namespace Lunari.Tsuki.Entities.Problems { 6 | public class MissingComponent : Problem { 7 | private static Type[] blacklist = new[] { 8 | typeof(Collider2D), 9 | typeof(Collider) 10 | }; 11 | public MissingComponent( 12 | Entity entity, 13 | Type dependencyType, 14 | ITrait requisitor, 15 | string expectedLocation = null 16 | ) : base(requisitor, entity, $"Entity {entity.name} does not have a component of type {dependencyType.Name} which is a dependency of {requisitor} ") { 17 | DependencyType = dependencyType; 18 | if (!dependencyType.IsAbstract && !IsBlacklisted(dependencyType) && expectedLocation != null) { 19 | WithSolution($"Add {dependencyType.Name}", delegate { 20 | var path = new Queue(); 21 | 22 | foreach (var s in expectedLocation.Split('/')) { 23 | path.Enqueue(s); 24 | } 25 | var toAddOn = entity.gameObject.transform; 26 | foreach (var s in path) { 27 | var found = toAddOn.transform.Find(s); 28 | if (found == null) { 29 | found = new GameObject(s).transform; 30 | found.SetParent(toAddOn); 31 | } 32 | toAddOn = found; 33 | } 34 | toAddOn.gameObject.AddComponent(dependencyType); 35 | }); 36 | } 37 | } 38 | private bool IsBlacklisted(Type dependencyType) { 39 | return blacklist.Contains(dependencyType); 40 | } 41 | 42 | public Type DependencyType { 43 | get; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b523eb9e82b413a8c7bc88ba8f0fc67 3 | timeCreated: 1610053822 -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingTrait.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using UnityEngine; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif 8 | namespace Lunari.Tsuki.Entities.Problems { 9 | public class MissingTrait : Problem { 10 | public MissingTrait( 11 | Entity entity, 12 | Type dependencyType, 13 | ITrait requisitor 14 | ) : base( 15 | requisitor, 16 | entity, 17 | $"Entity {entity.name} does not have a trait of type {dependencyType.Name} which is a dependency of {requisitor} " 18 | ) { 19 | DependencyType = dependencyType; 20 | if (!dependencyType.IsAbstract) { 21 | WithSolution($"Add {dependencyType.Name}", 22 | () => 23 | { 24 | AddComponentTo(entity, dependencyType); 25 | } 26 | ); 27 | } 28 | #if UNITY_EDITOR 29 | foreach (var type in TypeCache.GetTypesDerivedFrom(DependencyType)) { 30 | if (type.IsAbstract) { 31 | continue; 32 | } 33 | WithSolution("Create and add " + type.Name, () => 34 | { 35 | AddComponentTo(entity, type); 36 | }); 37 | } 38 | #endif 39 | } 40 | private static void AddComponentTo(Entity entity, Type dependencyType) { 41 | var path = new Queue(); 42 | 43 | var loc = dependencyType.GetCustomAttribute(); 44 | if (loc != null) { 45 | foreach (var s in loc.Path.Split('/')) { 46 | path.Enqueue(s); 47 | } 48 | } 49 | 50 | var toAddOn = entity.gameObject.transform; 51 | foreach (var s in path) { 52 | var found = toAddOn.transform.Find(s); 53 | if (found == null) { 54 | found = new GameObject(s).transform; 55 | found.SetParent(toAddOn); 56 | } 57 | 58 | toAddOn = found; 59 | } 60 | 61 | toAddOn.gameObject.AddComponent(dependencyType); 62 | #if UNITY_EDITOR 63 | EditorUtility.SetDirty(toAddOn); 64 | #endif 65 | } 66 | 67 | 68 | public Type DependencyType { get; } 69 | } 70 | } -------------------------------------------------------------------------------- /Assets/Entities/Problems/MissingTrait.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5c9de3242c84c8fa9cb9ddc1ae3a3c4 3 | timeCreated: 1610048728 -------------------------------------------------------------------------------- /Assets/Entities/Problems/Problem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | namespace Lunari.Tsuki.Entities.Problems { 4 | 5 | public class Solution { 6 | public Solution(string description, Action solution) { 7 | Description = description; 8 | Action = solution; 9 | } 10 | 11 | public int Score { 12 | get; 13 | set; 14 | } = 0; 15 | 16 | public string Description { 17 | get; 18 | } 19 | 20 | public Action Action { 21 | get; 22 | } 23 | 24 | } 25 | public class Problem { 26 | 27 | public Problem(ITrait requisitor, Entity entity, string description, Solution solution = null) { 28 | Requisitor = requisitor; 29 | Entity = entity; 30 | Description = description; 31 | Solutions = new List(); 32 | if (solution != null) { 33 | WithSolution(solution); 34 | } 35 | } 36 | public void WithSolution(Solution description) { 37 | Solutions.Add(description); 38 | } 39 | public void WithSolution(string description, Action solution) { 40 | WithSolution(new Solution(description, solution)); 41 | } 42 | 43 | 44 | public List Solutions { 45 | get; 46 | } 47 | 48 | public ITrait Requisitor { 49 | get; 50 | } 51 | 52 | public Entity Entity { 53 | get; 54 | } 55 | 56 | public string Description { 57 | get; 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Assets/Entities/Problems/Problem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0468c16ea0ef445283d06e63c7b39083 3 | timeCreated: 1610048817 -------------------------------------------------------------------------------- /Assets/Entities/Problems/ProblemBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki.Entities.Problems { 3 | public class ProblemBuilder { 4 | private TraitDescriptor descriptor; 5 | public ProblemBuilder(TraitDescriptor descriptor, string description) { 6 | this.descriptor = descriptor; 7 | Problem = new Problem(descriptor.Of, descriptor.Entity, description); 8 | } 9 | 10 | public Problem Problem { get; } 11 | 12 | public ProblemBuilder WithSolution(Solution solution) { 13 | Problem.WithSolution(solution); 14 | return this; 15 | } 16 | public ProblemBuilder WithSolution(string description, Action solution) { 17 | Problem.WithSolution(description, solution); 18 | return this; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Entities/Problems/ProblemBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ab0fba2fe0b424e8fa958f7bc9a8ffe 3 | timeCreated: 1635877358 -------------------------------------------------------------------------------- /Assets/Entities/Trait.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Lunari.Tsuki.Entities { 4 | public abstract class Trait : MonoBehaviour, ITrait { 5 | private Entity owner; 6 | 7 | public Entity Owner { 8 | get => owner; 9 | private set => owner = value; 10 | } 11 | 12 | public virtual int Priority => 0; 13 | 14 | public TraitDescriptor TryClaim(Entity requisitor, ITrait[] traits, bool initialize = true) { 15 | return this.ExecuteClaim(requisitor, traits, initialize, out owner); 16 | } 17 | public virtual void Describe(TraitDescriptor descriptor) { } 18 | 19 | public override string ToString() { 20 | var ownerName = Owner == null ? "none" : Owner.name; 21 | return $"{GetType().GetLegibleName()} (Owned by {ownerName})"; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Entities/Trait.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12ee60b25d964987adde0269aa312f7c 3 | timeCreated: 1609623173 -------------------------------------------------------------------------------- /Assets/Entities/TraitDescriptor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea6930ad803d24649a36e89479beaff5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Entities/TraitExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lunari.Tsuki.Entities { 4 | public static partial class TraitExtensions { 5 | public static bool HasTrait(this ITraits traits) where T : ITrait { 6 | return traits.GetTrait() != null; 7 | } 8 | 9 | public static bool Access(this ITraits traits, out T trait) where T : ITrait { 10 | return (trait = traits.GetTrait()) != null; 11 | } 12 | 13 | public static string FindTraitLocation(ITrait trait) { 14 | return FindTraitLocation(trait.GetType()); 15 | } 16 | 17 | public static string FindTraitLocation(Type traitType) { 18 | var traitLocation = traitType.GetCustomAttribute(true); 19 | var location = string.Empty; 20 | if (traitLocation != null) { 21 | location = traitLocation.Path; 22 | } 23 | 24 | return location; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Entities/TraitExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 171ff38f581f415a97aad6d0a49a55da 3 | timeCreated: 1609623687 -------------------------------------------------------------------------------- /Assets/Entities/TraitLocationAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lunari.Tsuki.Entities { 4 | public static class TraitLocations { 5 | public const string Root = ""; 6 | public const string Combat = "Combat"; 7 | public const string AI = "AI"; 8 | public const string Attack = Combat + "/Attack"; 9 | public const string View = "View"; 10 | public const string FX = "FX"; 11 | 12 | public static readonly string[] Names = new[] { 13 | Root, 14 | Combat, 15 | AI, 16 | Attack, 17 | View, 18 | FX 19 | }; 20 | 21 | public static string PathOf(CommonLocation common) { 22 | return Names[(int) common]; 23 | } 24 | } 25 | 26 | public enum CommonLocation { 27 | Root, 28 | Combat, 29 | AI, 30 | Attack, 31 | View, 32 | FX 33 | } 34 | 35 | public interface ITraitPathConvertible { 36 | string Path { get; } 37 | } 38 | 39 | public class TraitLocationAttribute : Attribute { 40 | public TraitLocationAttribute(string path) { 41 | Path = path; 42 | } 43 | 44 | public TraitLocationAttribute(CommonLocation common) : this(TraitLocations.PathOf(common)) { } 45 | 46 | public string Path { get; } 47 | } 48 | } -------------------------------------------------------------------------------- /Assets/Entities/TraitLocationAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 587007168f394811a0dfdfb0544e97bd 3 | timeCreated: 1609624533 -------------------------------------------------------------------------------- /Assets/Entities/Traits.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Lunari.Tsuki.Entities { 6 | public class Traits : ITraits { 7 | private readonly Dictionary traits = new Dictionary(); 8 | 9 | public T GetTrait(bool allowSubclass = false) where T : ITrait { 10 | if (allowSubclass) { 11 | foreach (var trait in traits.Values) { 12 | if (trait is T required) { 13 | return required; 14 | } 15 | } 16 | } else { 17 | if (traits.TryGetValue(typeof(T).GetHashCode(), out var found)) { 18 | if (found is T cast) { 19 | return cast; 20 | } 21 | } 22 | } 23 | 24 | return default; 25 | } 26 | 27 | public IEnumerable GetTraits() where T : ITrait { 28 | foreach (var keyValuePair in traits) { 29 | var trait = keyValuePair.Value; 30 | if (trait is T cast) { 31 | yield return cast; 32 | } 33 | } 34 | } 35 | 36 | public bool HasTrait(Type type) { 37 | return traits.Any(pair => pair.Key == type.GetHashCode()); 38 | } 39 | 40 | public void Include(ITrait trait) { 41 | traits[trait.GetType().GetHashCode()] = trait; 42 | } 43 | 44 | public void Include(Traits traits) { 45 | foreach (var pair in traits.traits) { 46 | Include(pair.Value); 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Assets/Entities/Traits.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a59e46d1c964562b2fac0bb833fbece 3 | timeCreated: 1609623311 -------------------------------------------------------------------------------- /Assets/Entities/Tsuki.Entities.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Entities", 3 | "rootNamespace": "Lunari.Tsuki", 4 | "references": [ 5 | "GUID:4c0668d2c90a58d40a31bb673f8cde7d" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Assets/Entities/Tsuki.Entities.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7b2a1cd13c5ebf469a4669c48bef51c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Gizmos.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2c2142484cbbab47873e27d76a9f8c8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Gizmos/Lunari.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abf161bc660a6cc48800462bc911c386 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Gizmos/Lunari/Tsuki.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 909befcaa524ec44db9e81058eaedfb5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Gizmos/Lunari/Tsuki/Entities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2f8c3c0a9cb328458cd1dcff179f8ab 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Gizmos/Lunari/Tsuki/Entities/Common.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22aaaa7f40766b34491c28aea0557bef 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Gizmos/Lunari/Tsuki/Entities/Common/Living Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Assets/Gizmos/Lunari/Tsuki/Entities/Common/Living Icon.png -------------------------------------------------------------------------------- /Assets/Gizmos/Lunari/Tsuki/Entities/Entity Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Assets/Gizmos/Lunari/Tsuki/Entities/Entity Icon.png -------------------------------------------------------------------------------- /Assets/Graphs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 637592b21824fa4f2a5fe72daee7dd52 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Graphs/AdjacencyList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f8a409391c5c1ea79a20912cfd54a38 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Graphs/AdjacencyMatrix.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8166bff9a6d1b43d6835d23726ba7c2d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Graphs/Exceptions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f867e6b79ad04a3db781bd94607d247b 3 | timeCreated: 1605887819 -------------------------------------------------------------------------------- /Assets/Graphs/Exceptions/EdgeOutOfRangeException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lunari.Tsuki.Graphs.Exceptions { 4 | public class EdgeOutOfRangeException : Exception { 5 | public EdgeOutOfRangeException( 6 | int from, 7 | int to, 8 | Graph graph 9 | ) : base($"Edge {from} -> {to} is out of range of graph {graph} (Has {graph.Size} vertices)") { } 10 | public EdgeOutOfRangeException( 11 | int from, 12 | int to, 13 | int totalEdges 14 | ) : base($"Edge {from} -> {to} is out of range of the graph (Has {totalEdges} edges)") { } 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Graphs/Exceptions/EdgeOutOfRangeException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 105deba5cdfc416f8b1c69eb152cfcdd 3 | timeCreated: 1606593627 -------------------------------------------------------------------------------- /Assets/Graphs/Exceptions/VertexOutOfRangeException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lunari.Tsuki.Graphs.Exceptions { 4 | public class VertexOutOfRangeException : Exception { 5 | public VertexOutOfRangeException( 6 | int index, 7 | Graph graph 8 | ) : base($"Vertex {index} is out of range of graph {graph} (Has {graph.Size} vertices)") { } 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Graphs/Exceptions/VertexOutOfRangeException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9a879713ac04076b41b71f08cf88a26 3 | timeCreated: 1605887820 -------------------------------------------------------------------------------- /Assets/Graphs/Graph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 887185789e535aa3e808c33037b159f4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Graphs/Graphs.AStar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6cd205c79dd4888b8c0069c6767e578 3 | timeCreated: 1605889088 -------------------------------------------------------------------------------- /Assets/Graphs/Graphs.Dijkstra.cs: -------------------------------------------------------------------------------- 1 | namespace Lunari.Tsuki.Graphs { 2 | public static partial class Graphs { 3 | public static bool Dijkstra( 4 | this Graph graph, 5 | int from, 6 | int to, 7 | WeightCalculator calculator, 8 | out GraphPath path, 9 | ExplorationCallbacks callbacks = default 10 | ) { 11 | return graph.AStar(from, to, ZeroHeuristics, calculator, out path, callbacks); 12 | } 13 | 14 | 15 | public static bool DijkstraWithPlan( 16 | this Graph graph, 17 | int from, 18 | int to, 19 | WeightCalculator calculator, 20 | out GraphPlan path, 21 | ExplorationCallbacks callbacks = default 22 | ) { 23 | return graph.AStarWithPlan(from, to, ZeroHeuristics, calculator, out path, callbacks); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Assets/Graphs/Graphs.Dijkstra.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27090b97b6e742cba4ac83cfd49fd3ef 3 | timeCreated: 1608500160 -------------------------------------------------------------------------------- /Assets/Graphs/Graphs.Exploration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Lunari.Tsuki.Algorithm; 5 | 6 | namespace Lunari.Tsuki.Graphs { 7 | /// 8 | /// Delegate which selects what the next vertex should explored, removes it from the deque and returns it. 9 | /// 10 | /// 11 | /// 12 | public delegate int ExplorationStrategy(Deque pending); 13 | 14 | public static partial class Graphs { 15 | public static int DepthFirst(Deque pending) => pending.RemoveBack(); 16 | 17 | public static int BreadthFirst(Deque pending) => pending.RemoveFront(); 18 | 19 | public static IEnumerable> Explore( 20 | this Graph graph, 21 | int from, 22 | ExplorationStrategy strategy 23 | ) { 24 | var visited = new HashSet(); 25 | var open = new Deque { 26 | from 27 | }; 28 | 29 | while (!open.IsEmpty) { 30 | var current = strategy(open); 31 | visited.Add(current); 32 | foreach (var (_, index) in graph.EdgesFrom(current)) { 33 | yield return new Tuple(current, index); 34 | if (!visited.Contains(index)) { 35 | open.Add(index); 36 | } 37 | } 38 | } 39 | } 40 | 41 | public static IEnumerable> FindDepthsFrom( 42 | this Graph graph, 43 | int origin, 44 | ExplorationStrategy strategy 45 | ) { 46 | var result = new Dictionary { 47 | [origin] = 0 48 | }; 49 | foreach (var (from, to) in graph.Explore(origin, strategy)) { 50 | result[to] = result[from] + 1; 51 | } 52 | 53 | return result.Select(pair => new Tuple(pair.Key, pair.Value)); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/Graphs/Graphs.Exploration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03711d0a35864ea3a79e8442864916ba 3 | timeCreated: 1608502560 -------------------------------------------------------------------------------- /Assets/Graphs/Graphs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e51a6380cc7df2b179a16fcf978cf5b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Graphs/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f8d60dec77c6b746802c8be4efb2416 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Graphs/Tests/AbstractGraphTest.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Graphs; 2 | using NUnit.Framework; 3 | using Assert = UnityEngine.Assertions.Assert; 4 | 5 | namespace Graphs.Tests { 6 | public abstract class AbstractGraphTest where G : Graph { 7 | protected readonly G map; 8 | protected readonly int first; 9 | protected readonly int second; 10 | protected readonly int third; 11 | private const int FirstDistance = 10; 12 | private const int SecondDistance = 20; 13 | private const int ThirdDistance = 40; 14 | 15 | public AbstractGraphTest() { 16 | map = CreateGraph(); 17 | first = AddVertex(map, "Step 1"); 18 | second = AddVertex(map, "Step 2"); 19 | third = AddVertex(map, "Step 3"); 20 | map.Connect(first, second, FirstDistance); 21 | map.Connect(second, third, SecondDistance); 22 | map.Connect(first, third, ThirdDistance); 23 | } 24 | 25 | protected abstract int AddVertex(G graph, string label); 26 | 27 | protected abstract G CreateGraph(); 28 | 29 | [Test] 30 | public void PersistencyTest() { 31 | Assert.AreEqual("Step 1", map[first]); 32 | Assert.AreEqual("Step 2", map[second]); 33 | Assert.AreEqual("Step 3", map[third]); 34 | Assert.AreEqual(FirstDistance, map[first, second]); 35 | Assert.AreEqual(SecondDistance, map[second, third]); 36 | Assert.AreEqual(ThirdDistance, map[first, third]); 37 | } 38 | 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/Graphs/Tests/AbstractGraphTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f593ca544a74488fa0d3b8976406a3e4 3 | timeCreated: 1606593016 -------------------------------------------------------------------------------- /Assets/Graphs/Tests/GraphTests.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Graphs; 2 | using NUnit.Framework; 3 | using Assert = UnityEngine.Assertions.Assert; 4 | 5 | namespace Graphs.Tests { 6 | public class AdjacencyListTest : AbstractGraphTest> { 7 | protected override int AddVertex(AdjacencyList graph, string label) { 8 | return graph.AddVertex(label); 9 | } 10 | 11 | [Test] 12 | public void AStarTest() { 13 | Assert.IsTrue(map.AStar( 14 | first, 15 | third, 16 | Lunari.Tsuki.Graphs.Graphs.ZeroHeuristics, 17 | out var path 18 | )); 19 | Assert.IsNotNull(path); 20 | 21 | var expected = new[] {first, second, third}; 22 | for (var i = 0; i < path.Indices.Length; i++) { 23 | Assert.AreEqual(expected[i], path.Indices[i]); 24 | } 25 | } 26 | 27 | protected override AdjacencyList CreateGraph() { 28 | return new AdjacencyList(); 29 | } 30 | } 31 | 32 | public class AdjacencyMatrixTest : AbstractGraphTest> { 33 | private int currentVert = 0; 34 | 35 | protected override int AddVertex(AdjacencyMatrix graph, string label) { 36 | graph[currentVert++] = label; 37 | return currentVert - 1; 38 | } 39 | 40 | protected override AdjacencyMatrix CreateGraph() { 41 | return new AdjacencyMatrix(3); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Assets/Graphs/Tests/GraphTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b442bc5f13b53454e8c8f1518b97287c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Graphs/Tests/Tsuki.Graphs.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Graphs.Tests", 3 | "references": [ 4 | "GUID:13575bce312b8495cb768ae8628785c5" 5 | ], 6 | "optionalUnityReferences": [ 7 | "TestAssemblies" 8 | ], 9 | "includePlatforms": [ 10 | "Editor" 11 | ], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "defineConstraints": [], 18 | "versionDefines": [], 19 | "noEngineReferences": false 20 | } -------------------------------------------------------------------------------- /Assets/Graphs/Tests/Tsuki.Graphs.Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ac8c11296ad57a4fab24a7a13e8e246 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Graphs/Tsuki-Graphs.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | CSharp71 -------------------------------------------------------------------------------- /Assets/Graphs/Tsuki-Graphs.csproj.DotSettings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b72e15ca6466e28c59e1eab7eaa12ce6 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Graphs/Tsuki.Graphs.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Graphs", 3 | "rootNamespace": "Lunari.Tsuki", 4 | "references": [ 5 | "GUID:4c0668d2c90a58d40a31bb673f8cde7d" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Assets/Graphs/Tsuki.Graphs.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13575bce312b8495cb768ae8628785c5 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73f63ad439c2406f0bad15dfe98b8338 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Runtime/Algorithm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6efad8cf72d4d9780c6351e4b76eec6 3 | timeCreated: 1608502720 -------------------------------------------------------------------------------- /Assets/Runtime/Algorithm/Deque.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da8663a37f5545118b75df404c6ee415 3 | timeCreated: 1608502732 -------------------------------------------------------------------------------- /Assets/Runtime/Algorithm/PriorityQueue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54c72f60e4ce4485afcacf19c98da43d 3 | timeCreated: 1618778586 -------------------------------------------------------------------------------- /Assets/Runtime/Algorithm/RingBuffer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17c5748318aa4b76840e838867b6f7c2 3 | timeCreated: 1620162782 -------------------------------------------------------------------------------- /Assets/Runtime/Algorithm/Tree.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8393d32f480e49d4a2960a3744de40ee 3 | timeCreated: 1619014001 -------------------------------------------------------------------------------- /Assets/Runtime/Animations.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 915a4b5d88b630202a7b6f17a8d0c473 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Collections.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4927c87c2e724439f8a3e418241b0f44 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/ColorHSV.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a937c40e64325825b93fde2a52c36536 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Colors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6734500e323d1eb9faa9d56551338348 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Coroutines.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki { 4 | public static class Coroutines { 5 | /// 6 | /// If the provided coroutine is not null, cancels that, and start a new coroutine, replacing the old one. 7 | /// 8 | /// The address of the old routine 9 | /// The the coroutine should be hosted on 10 | /// The method to use for the new coroutine 11 | public static void ReplaceCoroutine(ref Coroutine coroutine, MonoBehaviour owner, IEnumerator newRoutine) { 12 | coroutine.StopIfNotNull(owner); 13 | coroutine = owner.StartCoroutine(newRoutine); 14 | } 15 | 16 | public static void StopIfNotNull(this Coroutine coroutine, MonoBehaviour owner) { 17 | coroutine?.Stop(owner); 18 | } 19 | 20 | public static void Stop(this Coroutine coroutine, MonoBehaviour owner) { 21 | owner.StopCoroutine(coroutine); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Runtime/Coroutines.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71eccee4224710bdf87013167e034d42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Debugging.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1ed06c06db101cd4a472f535392420b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/EditorOnlyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki { 3 | public class EditorOnlyAttribute : Attribute { } 4 | } -------------------------------------------------------------------------------- /Assets/Runtime/EditorOnlyAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51007c7f396543f7baf142ee16d4ff1a 3 | timeCreated: 1611092904 -------------------------------------------------------------------------------- /Assets/Runtime/Enums.cs: -------------------------------------------------------------------------------- 1 | namespace Lunari.Tsuki { 2 | public static class Enums { 3 | public static bool IsSet(this int enumeration, int mask) { 4 | return (enumeration & mask) == mask; 5 | } 6 | 7 | public static bool IsSet(this byte enumeration, byte mask) { 8 | return (enumeration & mask) == mask; 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Runtime/Enums.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3119ebab933ec26ec8afbd0436e1721d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Events.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ef9529fad7b3e54e8b969cfe87b813a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Exceptions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5b3f5f94a63bee1fa2a971856064486 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Runtime/Exceptions/WTFException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki.Exceptions { 3 | /// 4 | /// 5 | /// What a Terrible Failure exception. 6 | /// Meant to be used for conditions that should never occur, but blocks compilation if not checked, for example: 7 | /// 8 | /// public void GetHorizontalSign(bool leftCollision, bool rightCollision){ 9 | /// if (leftCollision == rightCollision) { 10 | /// return UnitValue.Zero; 11 | /// } 12 | /// if (leftCollision) { 13 | /// return UnitValue.MinusOne; 14 | /// } 15 | /// if (rightCollision) { 16 | /// return UnitValue.One; 17 | /// } 18 | /// /* 19 | /// * We will never get here, because 20 | /// * the program would have returned at the 21 | /// * first conditional branch 22 | /// */ 23 | /// throw new WTFException(); 24 | /// } 25 | /// Thanks google. 26 | /// 27 | public class WTFException : Exception { 28 | public WTFException(string message = "Something went very wrong here") : base(message) { } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Runtime/Exceptions/WTFException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3eb37ae05827eb94789ca9509d6c69e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Files.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | namespace Lunari.Tsuki { 3 | public static class Files { 4 | public static void EnsureParentFolderExists(string file) { 5 | var folder = Path.GetDirectoryName(file); 6 | if (folder == null) { 7 | return; 8 | } 9 | if (!Directory.Exists(folder)) { 10 | Directory.CreateDirectory(folder); 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Assets/Runtime/Files.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d42b679f91d4541836303fcd1e39db3 3 | timeCreated: 1644195020 -------------------------------------------------------------------------------- /Assets/Runtime/GUIStyles.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Events; 3 | namespace Lunari.Tsuki { 4 | public static class GUIStyles { 5 | public static GUIStyle CopyWith(this GUIStyle style, UnityAction action) { 6 | var other = new GUIStyle(style); 7 | action(other); 8 | return other; 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Runtime/GUIStyles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59499297bd654fafa7f46649a9bb29b4 3 | timeCreated: 1651859338 -------------------------------------------------------------------------------- /Assets/Runtime/GameObjects.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc499d97f2be943c0b2da401e2e7218e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Gizmos2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08c8d03b67d440139ef66cf93a7cf2ad 3 | timeCreated: 1607726430 -------------------------------------------------------------------------------- /Assets/Runtime/GizmosScheduler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Lunari.Tsuki.Singletons; 3 | namespace Lunari.Tsuki { 4 | public delegate void GizmosAction(); 5 | 6 | public class GizmosScheduler : StaticSingleton { 7 | public List Actions { get; } = new List(); 8 | 9 | public void Schedule(GizmosAction action) { 10 | Actions.Add(action); 11 | } 12 | 13 | public void DeSchedule(GizmosAction action) { 14 | Actions.Remove(action); 15 | } 16 | 17 | 18 | private void OnDrawGizmos() { 19 | foreach (var gizmosAction in Actions) { 20 | gizmosAction(); 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Runtime/GizmosScheduler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d64b85d795404b0fa534bcba03438829 3 | timeCreated: 1607726625 -------------------------------------------------------------------------------- /Assets/Runtime/Indexing.cs: -------------------------------------------------------------------------------- 1 | namespace Lunari.Tsuki { 2 | public static class Indexing { 3 | public static int IndexOf(int x, int y, int width) { 4 | return x + y * width; 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /Assets/Runtime/Indexing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b20d8dd5c285441d6adcfd79d72374ce 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Logging.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65ef58772bd43f487b2182de57109283 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Runtime/Logging/UnityLogger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | namespace Lunari.Tsuki.Logging { 3 | public class UnityLogger { 4 | public UnityLogger(string name) { 5 | this.Name = name; 6 | } 7 | 8 | public string Name { 9 | get; 10 | private set; 11 | } 12 | 13 | public void Log(string message) { 14 | Debug.Log(FormatMessage(message)); 15 | } 16 | 17 | public void LogWarning(string warning) { 18 | Debug.LogWarning(FormatMessage(warning)); 19 | } 20 | 21 | public void LogError(string error) { 22 | Debug.LogWarning(FormatMessage(error)); 23 | } 24 | 25 | protected virtual string FormatMessage(string message) => $"[{Name}] {message}"; 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Runtime/Logging/UnityLogger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86f36006700768e7a8e6093d4aff2c3a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Maths.cs: -------------------------------------------------------------------------------- 1 | namespace Lunari.Tsuki { 2 | public static class Maths { 3 | public static int Clamp(int value, int min, int max) { 4 | if (value > max) { 5 | return max; 6 | } 7 | 8 | if (value < min) { 9 | return min; 10 | } 11 | 12 | return value; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/Runtime/Maths.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd4abe7bdf1d448e88d231fb2a02a6d7 3 | timeCreated: 1608589156 -------------------------------------------------------------------------------- /Assets/Runtime/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc96e62f9c9352fb990f59fe09d0e1b5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Axis.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki.Misc { 3 | [Flags] 4 | public enum Axis : byte{ 5 | X = 1 << 0, 6 | Y = 1 << 1, 7 | Z = 1 << 2 8 | } 9 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Axis.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9071fbad6e692cc4f92b79c00dc4e47a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Bounds2D.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Misc { 4 | [Serializable] 5 | public struct Bounds2D { 6 | public Vector2 center; 7 | 8 | public Vector2 size; 9 | 10 | private Bounds2D(Vector2 center, Vector2 size) { 11 | this.center = center; 12 | this.size = size; 13 | } 14 | 15 | public void Expand(float amount) { 16 | Expand(new Vector2(amount, amount)); 17 | } 18 | 19 | public void Expand(Vector2 amount) { 20 | size += amount; 21 | } 22 | 23 | public Vector2 Min { 24 | get => center - size / 2f; 25 | set => SetMinMax(value, Max); 26 | } 27 | 28 | public Vector2 Max { 29 | get => center + size / 2f; 30 | set => SetMinMax(Min, value); 31 | } 32 | 33 | public void SetMinMax(Vector2 min, Vector2 max) { 34 | size = max - min; 35 | center = min + size / 2f; 36 | } 37 | 38 | public static implicit operator Bounds2D(Bounds bounds) { 39 | return new Bounds2D(bounds.center, bounds.size); 40 | } 41 | 42 | public static implicit operator Bounds(Bounds2D b) { 43 | return new Bounds(b.center, b.size); 44 | } 45 | 46 | public override string ToString() { 47 | return $"Bounds2D(Center: {center}, Size: {size}, Min: {Min}, Max: {Max})"; 48 | } 49 | 50 | public Vector2 BottomLeft => Min; 51 | 52 | public Vector2 TopRight => new Vector2(Min.x, Max.y); 53 | 54 | public Vector2 TopLeft => Max; 55 | 56 | public Vector2 BottomRight => new Vector2(Max.x, Min.y); 57 | } 58 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Bounds2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f600b658283c64ddfb792fc6dbe7f09b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/CategoryAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki.Misc { 3 | public class CategoryAttribute : Attribute { 4 | public string Category { get; } 5 | 6 | public CategoryAttribute(string category) { 7 | Category = category; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/CategoryAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b897ab46d4cfb0f8cb9c8b7702ba085b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Clock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Misc { 4 | [Serializable] 5 | public struct Clock { 6 | public float cooldown; 7 | 8 | public float TickRate { 9 | get => 1 / cooldown; 10 | set => cooldown = 1 / value; 11 | } 12 | 13 | private float currentTime; 14 | 15 | public float CurrentTime { 16 | get => currentTime; 17 | set => currentTime = value; 18 | } 19 | 20 | public void Reset() { 21 | currentTime = cooldown; 22 | } 23 | 24 | public bool Tick() { 25 | return Tick(Time.deltaTime); 26 | } 27 | 28 | public bool Tick(float elapsedTime) { 29 | var completed = (currentTime -= elapsedTime) <= 0; 30 | if (completed) { 31 | currentTime = cooldown; 32 | } 33 | 34 | return completed; 35 | } 36 | 37 | public static implicit operator Clock(float cooldown) => 38 | new Clock { 39 | cooldown = cooldown 40 | }; 41 | } 42 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Clock.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fd6b676fa97489abbf0e439a387c004 3 | timeCreated: 1607725377 -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Cooldown.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | namespace Lunari.Tsuki.Misc { 5 | [Serializable] 6 | public class Cooldown { 7 | private float _currentTime = 0; 8 | public float cooldown = 1; 9 | 10 | public void Use() { 11 | _currentTime = cooldown; 12 | } 13 | 14 | public bool Tick() { 15 | _currentTime -= Time.deltaTime; 16 | if (_currentTime < 0) { 17 | _currentTime = 0; 18 | return true; 19 | } 20 | return Available; 21 | } 22 | 23 | public bool Available => _currentTime <= 0; 24 | 25 | public WaitUntil WaitUntilReady() { 26 | return new WaitUntil(Tick); 27 | } 28 | public IEnumerator UseAndWait() { 29 | Use(); 30 | yield return WaitUntilReady(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Cooldown.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 763b5c5053731db4f814f99d02ec0425 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Direction2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3ae1420ba79872d1b35e336ddd2753d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Historic.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if ODIN_INSPECTOR 4 | using Sirenix.OdinInspector; 5 | 6 | #endif 7 | 8 | namespace Lunari.Tsuki.Misc { 9 | /// 10 | /// Container for a value that also stores the last set value; 11 | /// 12 | [Serializable] 13 | public class Historic { 14 | [SerializeField, NonSerialized] protected T current; 15 | protected T last; 16 | #if ODIN_INSPECTOR 17 | [ShowInInspector] 18 | #endif 19 | public T Current { 20 | get => current; 21 | set { 22 | last = current; 23 | current = value; 24 | } 25 | } 26 | 27 | public T Last => last; 28 | 29 | public static implicit operator T(Historic value) { 30 | return value.current; 31 | } 32 | } 33 | public class UnityHistoric : Historic where T : UnityEngine.Object { 34 | public bool JustChanged => current != last; 35 | } 36 | [Serializable] 37 | public class BooleanHistoric : Historic { 38 | public bool JustActivated => current && !last; 39 | public bool JustDeactivated => !current && last; 40 | } 41 | 42 | public static class Historics { 43 | public static void CopyCurrentToLast(this Historic historic) { 44 | historic.Current = historic.Current; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Historic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcdf12e3d0fd5eb4eb73d90503c55925 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/OnGUIHook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | 5 | namespace Lunari.Tsuki.Misc { 6 | public class OnGUIHook : MonoBehaviour { 7 | public UnityEvent onGUI = new UnityEvent(); 8 | 9 | private void OnGUI() { 10 | onGUI.Invoke(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/OnGUIHook.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9320432658cc4873be1b508a02e61a89 3 | timeCreated: 1657045641 -------------------------------------------------------------------------------- /Assets/Runtime/Misc/SerializableInterface.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | using Object = UnityEngine.Object; 5 | 6 | namespace Lunari.Tsuki.Misc { 7 | public abstract class SerializableInterface { 8 | public abstract Object GetObject(); 9 | public abstract void SetObject(Object value); 10 | } 11 | [Serializable] 12 | public class SerializableInterface : SerializableInterface where T : class { 13 | public T Value { 14 | get => managed as T; 15 | set => managed = value as Object; 16 | } 17 | 18 | public override Object GetObject() { 19 | return managed; 20 | } 21 | public override void SetObject(Object value) { 22 | Value = value as T; 23 | } 24 | 25 | [SerializeField, HideInInspector] 26 | private Object managed; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/SerializableInterface.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3aa95ddbfd8ac2db8ae2eef9539d3384 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Tracker.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | namespace Lunari.Tsuki.Misc { 5 | public sealed class Tracker where T : Object { 6 | private readonly List objects = new List(); 7 | 8 | public Tracker( 9 | UnityEvent awakeEvent, 10 | UnityEvent destroyEvent 11 | ) { 12 | awakeEvent.AddListener(OnAwake); 13 | destroyEvent.AddListener(OnDestroy); 14 | objects.AddRange(Object.FindObjectsOfType()); 15 | } 16 | 17 | public IEnumerable Objects => objects; 18 | 19 | private void OnDestroy(T arg0) { 20 | objects.Remove(arg0); 21 | } 22 | 23 | private void OnAwake(T arg0) { 24 | objects.Add(arg0); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/Tracker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 212522959b360918d8487ef65b20bc9b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Misc/UnitValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Misc { 4 | [Serializable] 5 | public struct UnitValue { 6 | public static readonly UnitValue One = new UnitValue(1); 7 | public static readonly UnitValue Zero = new UnitValue(0); 8 | public static readonly UnitValue MinusOne = new UnitValue(-1); 9 | 10 | [SerializeField] 11 | private sbyte value; 12 | 13 | private UnitValue(sbyte value) { 14 | this.value = value; 15 | } 16 | 17 | public static implicit operator UnitValue(int i) { 18 | if (i > 0) { 19 | return One; 20 | } 21 | 22 | return i < 0 ? MinusOne : Zero; 23 | } 24 | 25 | public static implicit operator UnitValue(float f) { 26 | if (f > 0) { 27 | return One; 28 | } 29 | 30 | return f < 0 ? MinusOne : Zero; 31 | } 32 | 33 | public static UnitValue FromFloat(float val, float limit = 0) { 34 | if (val > limit) { 35 | return One; 36 | } 37 | 38 | return val < -limit ? MinusOne : Zero; 39 | } 40 | 41 | public static implicit operator sbyte(UnitValue val) => val.value; 42 | 43 | public static implicit operator int(UnitValue val) => val.value; 44 | } 45 | } -------------------------------------------------------------------------------- /Assets/Runtime/Misc/UnitValue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1d9f632761d02935a026a1ddb046032 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Numbers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki { 3 | public static class Numbers { 4 | public static string ToHex(this float value) { 5 | return BitConverter.ToString(BitConverter.GetBytes(value)); 6 | } 7 | 8 | public static string ToHex(this double value) { 9 | return BitConverter.ToString(BitConverter.GetBytes(value)); 10 | } 11 | 12 | public static string ToHex(this int value) { 13 | return BitConverter.ToString(BitConverter.GetBytes(value)); 14 | } 15 | 16 | public static string ToHex(this uint value) { 17 | return BitConverter.ToString(BitConverter.GetBytes(value)); 18 | } 19 | 20 | public static string ToHex(this short value) { 21 | return BitConverter.ToString(BitConverter.GetBytes(value)); 22 | } 23 | 24 | public static string ToHex(this ushort value) { 25 | return BitConverter.ToString(BitConverter.GetBytes(value)); 26 | } 27 | 28 | public static string ToHex(this byte value) { 29 | return BitConverter.ToString(new[] {value}); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Assets/Runtime/Numbers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a6aedc72bbea4346bc4d03a283ff12b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Objects.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcd0eb31266d017adbe4b67b8c707719 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Paths.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki { 3 | public static class Paths { 4 | public static string RelativeTo(string path, string relativeTo) { 5 | var second = new Uri(path); 6 | var first = new Uri(relativeTo); 7 | return first.MakeRelativeUri(second).ToString(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Runtime/Paths.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7efe9bb14473479f871dce76788d7afc 3 | timeCreated: 1646191318 -------------------------------------------------------------------------------- /Assets/Runtime/Randomization.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d52bbb79b2351b11a512ca0681040c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Rectangles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c42033ef9c7610c45b810765c0b240a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Scopes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26d634c4c047b3b0ea67e5dd24a7906d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Runtime/Scopes/GUIColorScope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Scopes { 4 | public class GUIColorScope : IDisposable { 5 | public enum ColorTarget { 6 | Normal, 7 | Content, 8 | Background 9 | } 10 | 11 | private readonly Color color; 12 | private readonly ColorTarget target; 13 | 14 | public GUIColorScope( 15 | bool condition, 16 | Color color, 17 | ColorTarget target = ColorTarget.Normal 18 | ) : this(condition ? color : GUI.color, target) { 19 | } 20 | 21 | public GUIColorScope(Color color, ColorTarget target = ColorTarget.Normal) { 22 | this.target = target; 23 | switch (target) { 24 | case ColorTarget.Normal: 25 | this.color = GUI.color; 26 | GUI.color = color; 27 | break; 28 | case ColorTarget.Content: 29 | this.color = GUI.contentColor; 30 | GUI.contentColor = color; 31 | break; 32 | case ColorTarget.Background: 33 | this.color = GUI.backgroundColor; 34 | GUI.backgroundColor = color; 35 | break; 36 | default: 37 | throw new ArgumentOutOfRangeException(nameof(target), target, null); 38 | } 39 | } 40 | 41 | public void Dispose() { 42 | switch (target) { 43 | case ColorTarget.Normal: 44 | GUI.color = color; 45 | break; 46 | case ColorTarget.Content: 47 | GUI.contentColor = color; 48 | break; 49 | case ColorTarget.Background: 50 | GUI.backgroundColor = color; 51 | break; 52 | default: 53 | throw new ArgumentOutOfRangeException(nameof(target), target, null); 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /Assets/Runtime/Scopes/GUIColorScope.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9536718aaaad3155ad48ff72f3feb2e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Scopes/GUIEnabledScope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Scopes { 4 | public class GUIEnabledScope : IDisposable { 5 | private bool before; 6 | 7 | public GUIEnabledScope(bool enabled) { 8 | before = GUI.enabled; 9 | GUI.enabled = enabled; 10 | } 11 | 12 | public void Dispose() { 13 | GUI.enabled = before; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Runtime/Scopes/GUIEnabledScope.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce0e452d6f8608e66a19ca3d289c896c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Scopes/GizmosColorScope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Scopes { 4 | public class GizmosColorScope : IDisposable { 5 | private Color fallback; 6 | 7 | public GizmosColorScope(Color newColor) { 8 | fallback = Gizmos.color; 9 | Gizmos.color = newColor; 10 | } 11 | 12 | public void Dispose() { 13 | Gizmos.color = fallback; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Runtime/Scopes/GizmosColorScope.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cbcbe5081044df28f2c40e9b8880fda 3 | timeCreated: 1607623429 -------------------------------------------------------------------------------- /Assets/Runtime/SerializableDictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | namespace Lunari.Tsuki { 6 | [Serializable] 7 | public class SerializableDictionary : Dictionary, ISerializationCallbackReceiver { 8 | [SerializeField, HideInInspector] 9 | private List keys; 10 | 11 | [SerializeField, HideInInspector] 12 | private List values; 13 | 14 | public void OnBeforeSerialize() { 15 | Copy(Keys, ref keys); 16 | Copy(Values, ref values); 17 | } 18 | 19 | private void Copy(IEnumerable from, ref List to) { 20 | var collection = from.ToArray(); 21 | if (to == null) { 22 | to = new List(collection.Length); 23 | } else { 24 | to.Clear(); 25 | to.Capacity = collection.Length; 26 | } 27 | 28 | to.AddRange(collection); 29 | } 30 | 31 | public void OnAfterDeserialize() { 32 | for (var i = 0; i < keys.Count; i++) { 33 | this[keys[i]] = values[i]; 34 | } 35 | 36 | // Free memory 37 | keys.Clear(); 38 | values.Clear(); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/Runtime/SerializableDictionary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abdc6f8eea414fb0b8832052ac759942 3 | timeCreated: 1605885272 -------------------------------------------------------------------------------- /Assets/Runtime/Singletons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d320eb3b46b041ed1a694896a0690596 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Runtime/Singletons/Manager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | namespace Lunari.Tsuki.Singletons { 4 | public abstract class Manager : MonoBehaviour where TSelf : Manager { 5 | 6 | private static string ManagerName = typeof(TSelf).Name; 7 | protected static void LoadManager() { 8 | Debug.Log($"Loading manager {typeof(TSelf).GetLegibleName()}"); 9 | Instance = Resources.Load(ManagerName); 10 | if (Instance != null) { 11 | DontDestroyOnLoad(Instance.gameObject); 12 | } 13 | } 14 | 15 | public static TSelf Instance { 16 | get; 17 | private set; 18 | } 19 | #if UNITY_EDITOR 20 | private void OnValidate() { 21 | gameObject.name = ManagerName; 22 | } 23 | #endif 24 | } 25 | } -------------------------------------------------------------------------------- /Assets/Runtime/Singletons/Manager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ace59b19413c413c876e400ddf7c5fc1 3 | timeCreated: 1656782894 -------------------------------------------------------------------------------- /Assets/Runtime/Singletons/ScriptableSingleton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | namespace Lunari.Tsuki.Singletons { 3 | /// 4 | /// version of 5 | ///
6 | /// Represents a of which there is only one instance ever. 7 | /// Useful for config files or data that you want to access globally. 8 | ///
9 | /// 10 | /// Usage would be something among the lines of: 11 | /// 12 | /// // Singleton declaration 13 | /// public class MySingleton : ScriptableSingleton<MySingleton> { 14 | /// public LayerMask EnemyMask; 15 | /// } 16 | /// // Usage 17 | /// MySingleton s = MySingleton.Instance; 18 | /// LayerMask toUse = s.EnemyMask; 19 | /// 20 | ///
21 | /// The singleton's own type, as specified in the example. 22 | public abstract class ScriptableSingleton : ScriptableObject where T : ScriptableObject { 23 | /// 24 | /// The path on which a instance of this singleton is searched for 25 | /// 26 | public static readonly string Path = typeof(T).Name; 27 | 28 | private static T instance; 29 | 30 | /// 31 | /// The found instance of this singleton. 32 | ///
33 | /// If none is found, returns null. 34 | ///
35 | /// Unlike , there is no way to ensure a to be 36 | /// returned, as we cannot store it using . 37 | ///
38 | public static T Instance => instance ? instance : instance = Resources.Load(Path); 39 | } 40 | } -------------------------------------------------------------------------------- /Assets/Runtime/Singletons/ScriptableSingleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fedcba2fefbd84518c17f913793af4f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Singletons/Singleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7a0d783a58b63109afb480ab2b30958 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Slot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor.UIElements; 3 | using UnityEngine.Events; 4 | #if ODIN_INSPECTOR 5 | using Sirenix.OdinInspector; 6 | #endif 7 | namespace Lunari.Tsuki { 8 | [Serializable] 9 | public class Slot where T : class { 10 | private T _value = default; 11 | 12 | public UnityEvent Changed { get; } = new UnityEvent(); 13 | 14 | public static implicit operator T(Slot slot) => slot._value; 15 | 16 | #if ODIN_INSPECTOR 17 | [ShowInInspector] 18 | #endif 19 | public T Value { 20 | get => _value; 21 | set { 22 | if (_value != null && _value.Equals(value)) { 23 | return; 24 | } 25 | _value = value; 26 | Changed.Invoke(); 27 | } 28 | } 29 | 30 | public Slot OnChanged(UnityAction onChanged) { 31 | Changed.AddListener(onChanged); 32 | return this; 33 | } 34 | 35 | public Slot OnChanged(UnityAction onChanged) { 36 | OnChanged(() => { 37 | onChanged(_value); 38 | }); 39 | return this; 40 | } 41 | public Slot OnChanged(UnityAction onChanged) { 42 | var last = Value; 43 | OnChanged(() => { 44 | onChanged(last, Value); 45 | last = Value; 46 | }); 47 | return this; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Assets/Runtime/Slot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a6ad9121b7e435094359e4995567189 3 | timeCreated: 1654374984 -------------------------------------------------------------------------------- /Assets/Runtime/SlotExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef667598373e4d7c8d9c5c587c931df1 3 | timeCreated: 1655657410 -------------------------------------------------------------------------------- /Assets/Runtime/Stacking.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5201d424f6fd4a5f849797ef6b126406 3 | timeCreated: 1612211153 -------------------------------------------------------------------------------- /Assets/Runtime/Stacking/BooleanStackable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki.Stacking { 3 | [Serializable] 4 | public class BooleanStackable : Stackable { 5 | public Mode mode; 6 | public enum Mode { 7 | /// 8 | /// If any modifier allows it, return true 9 | /// 10 | Any, 11 | /// 12 | /// If any modifier disallow it, return false 13 | /// 14 | All, 15 | /// 16 | /// If any modifier allow it, return false 17 | /// 18 | None 19 | } 20 | public BooleanStackable(bool value, Mode mode) { 21 | this.mode = mode; 22 | } 23 | private BooleanStackable() : this(false, Mode.Any) { } 24 | 25 | public override bool Value { 26 | get { 27 | if (modifiers != null) { 28 | return EvaluateModifiers(); 29 | } 30 | return baseValue; 31 | } 32 | } 33 | 34 | private bool EvaluateModifiers() { 35 | switch (mode) { 36 | case Mode.Any: 37 | foreach (var modifier in modifiers) { 38 | if (modifier.value) { 39 | return true; 40 | } 41 | } 42 | break; 43 | case Mode.All: 44 | foreach (var modifier in modifiers) { 45 | if (!modifier.value) { 46 | return false; 47 | } 48 | } 49 | break; 50 | case Mode.None: 51 | foreach (var modifier in modifiers) { 52 | if (modifier.value) { 53 | return false; 54 | } 55 | } 56 | break; 57 | default: 58 | throw new ArgumentOutOfRangeException(); 59 | } 60 | return baseValue; 61 | } 62 | 63 | public static implicit operator bool(BooleanStackable property) { 64 | return property.Value; 65 | } 66 | 67 | public static implicit operator BooleanStackable(bool value) { 68 | return new BooleanStackable { 69 | baseValue = value 70 | }; 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /Assets/Runtime/Stacking/BooleanStackable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d21b69f021c49c89b5ab0ca37eb4add 3 | timeCreated: 1612211373 -------------------------------------------------------------------------------- /Assets/Runtime/Stacking/FloatStackable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Lunari.Tsuki.Stacking { 3 | [Serializable] 4 | public class FloatStackable : Stackable { 5 | public float masterMultiplier = 1; 6 | public override float Value => baseValue * Multiplier; 7 | 8 | public float Multiplier { 9 | get { 10 | var result = masterMultiplier; 11 | if (modifiers != null) { 12 | foreach (var multiplierHandle in modifiers) { 13 | result *= multiplierHandle.value; 14 | } 15 | } 16 | 17 | return result; 18 | } 19 | } 20 | 21 | public static implicit operator float(FloatStackable property) { 22 | return property.Value; 23 | } 24 | 25 | public static implicit operator FloatStackable(float value) { 26 | return new FloatStackable { 27 | baseValue = value 28 | }; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Assets/Runtime/Stacking/FloatStackable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e642fb6945584cb4b6a535d956440a34 3 | timeCreated: 1612211289 -------------------------------------------------------------------------------- /Assets/Runtime/Stacking/Stackable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | #if ODIN_INSPECTOR 4 | using Sirenix.OdinInspector; 5 | #endif 6 | 7 | namespace Lunari.Tsuki.Stacking { 8 | [Serializable] 9 | public class Modifier { 10 | public T value; 11 | } 12 | [Serializable] 13 | public abstract class Stackable { 14 | public T baseValue; 15 | 16 | public abstract T Value { 17 | get; 18 | } 19 | #if ODIN_INSPECTOR 20 | [ShowInInspector, ReadOnly] 21 | #endif 22 | protected List> modifiers; 23 | public Modifier AddModifier(T value) { 24 | modifiers ??= new List>(); 25 | 26 | var handle = new Modifier { 27 | value = value 28 | }; 29 | modifiers.Add(handle); 30 | return handle; 31 | } 32 | 33 | public void RemoveModifier(Modifier handle) { 34 | modifiers?.Remove(handle); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/Runtime/Stacking/Stackable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84845210fc814ba0aa24b37912545163 3 | timeCreated: 1612211158 -------------------------------------------------------------------------------- /Assets/Runtime/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e6214bda0fc4e418bdc25903058de86 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Runtime/Tests/RingBufferTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9cba409f75d497c9eebc4c7538f6042 3 | timeCreated: 1620164547 -------------------------------------------------------------------------------- /Assets/Runtime/Tests/Tsuki.Runtime.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Runtime.Tests", 3 | "rootNamespace": "Tsuki.Runtime.Tests", 4 | "references": [ 5 | "UnityEngine.TestRunner", 6 | "UnityEditor.TestRunner", 7 | "Tsuki.Runtime" 8 | ], 9 | "includePlatforms": [ 10 | "Editor" 11 | ], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": true, 15 | "precompiledReferences": [ 16 | "nunit.framework.dll" 17 | ], 18 | "autoReferenced": false, 19 | "defineConstraints": [ 20 | "UNITY_INCLUDE_TESTS" 21 | ], 22 | "versionDefines": [], 23 | "noEngineReferences": false 24 | } -------------------------------------------------------------------------------- /Assets/Runtime/Tests/Tsuki.Runtime.Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0325af1a74c4d9ababccf0824d27ea7 3 | timeCreated: 1620164507 -------------------------------------------------------------------------------- /Assets/Runtime/Textures.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | namespace Lunari.Tsuki { 3 | public static class Textures { 4 | public static readonly Texture2D WhiteTexture = Pixel(UnityEngine.Color.white); 5 | public static readonly Texture2D BlackTexture = Pixel(UnityEngine.Color.black); 6 | public static readonly Texture2D RedTexture = Pixel(UnityEngine.Color.red); 7 | public static readonly Texture2D GreenTexture = Pixel(UnityEngine.Color.green); 8 | public static readonly Texture2D BlueTexture = Pixel(UnityEngine.Color.blue); 9 | public static readonly Texture2D CyanTexture = Pixel(UnityEngine.Color.cyan); 10 | public static readonly Texture2D MagentaTexture = Pixel(UnityEngine.Color.magenta); 11 | public static readonly Texture2D YellowTexture = Pixel(UnityEngine.Color.yellow); 12 | public static readonly Texture2D GreyTexture = Pixel(UnityEngine.Color.grey); 13 | public static readonly Texture2D TransparentTexture = Pixel(UnityEngine.Color.clear); 14 | 15 | /// 16 | /// Create a 1x1 texture of the provided color 17 | /// 18 | /// The color of the texture 19 | /// A 1x1 texture of the provided color 20 | public static Texture2D Pixel(Color32 color) { 21 | return Color(color, 1, 1); 22 | } 23 | 24 | /// 25 | /// Creates a texture of the provided size and fills it with the provided color 26 | /// 27 | /// The color of the texture 28 | /// The width of the texture 29 | /// The height of the texture 30 | /// A 1x1 texture of the provided color 31 | public static Texture2D Color(Color32 color, int width, int height) { 32 | var texture2D = new Texture2D(width, height); 33 | var pixels = new Color32[width * height]; 34 | for (var i = 0; i < pixels.Length; i++) { 35 | pixels[i] = color; 36 | } 37 | 38 | texture2D.SetPixels32(pixels); 39 | texture2D.Apply(); 40 | return texture2D; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Assets/Runtime/Textures.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 607ee6559917e21e2a1e0d46077cd906 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Tsuki.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tsuki.Runtime", 3 | "rootNamespace": "Lunari.Tsuki" 4 | } 5 | -------------------------------------------------------------------------------- /Assets/Runtime/Tsuki.Runtime.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c0668d2c90a58d40a31bb673f8cde7d 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Runtime/Types.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5360bd3f765202a49b0fbdf6341dd2c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/UI.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UI; 2 | namespace Lunari.Tsuki { 3 | public static class UI { 4 | public static void SetAlpha(this Graphic graphic, float alpha) { 5 | var c = graphic.color; 6 | c.a = alpha; 7 | graphic.color = c; 8 | } 9 | 10 | public static void SetRed(this Graphic graphic, float red) { 11 | var c = graphic.color; 12 | c.r = red; 13 | graphic.color = c; 14 | } 15 | 16 | public static void SetGreen(this Graphic graphic, float green) { 17 | var c = graphic.color; 18 | c.g = green; 19 | graphic.color = c; 20 | } 21 | 22 | public static void SetBlue(this Graphic graphic, float blue) { 23 | var c = graphic.color; 24 | c.b = blue; 25 | graphic.color = c; 26 | } 27 | 28 | public static void SetHue(this Graphic graphic, float hue) { 29 | var c = graphic.color; 30 | Colors.SetHue(ref c, hue); 31 | graphic.color = c; 32 | } 33 | 34 | public static void SetSaturation(this Graphic graphic, float saturation) { 35 | var c = graphic.color; 36 | Colors.SetSaturation(ref c, saturation); 37 | graphic.color = c; 38 | } 39 | 40 | public static void SetBrightness(this Graphic graphic, float brightness) { 41 | var c = graphic.color; 42 | Colors.SetBrightness(ref c, brightness); 43 | graphic.color = c; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/Runtime/UI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a539cc78e528ccce867c29c9b7ba73e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Runtime/Vectors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34afb26db02614b5ba3f771f3855687c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54296097552ca32408475b1926b6b99d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Entities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d5eda3ffe9495d4fb379a522df08d2b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Entities/AITraitThatDoStuff.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | 3 | namespace Lunari.Tsuki.Samples.Entities { 4 | [TraitLocation(CommonLocation.AI)] 5 | public class AITraitThatDoStuff : Trait { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/AITraitThatDoStuff.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5632c9b1ee0d48adb5b04f6a77bbe568 3 | timeCreated: 1619100061 -------------------------------------------------------------------------------- /Assets/Samples/Entities/Basic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54515f49f4271c245b0f306ff3ceb19c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Entities/Basic/BasicController.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: BasicController 10 | serializedVersion: 5 11 | m_AnimatorParameters: 12 | - m_Name: Float 13 | m_Type: 1 14 | m_DefaultFloat: 0 15 | m_DefaultInt: 0 16 | m_DefaultBool: 0 17 | m_Controller: {fileID: 0} 18 | - m_Name: Int 19 | m_Type: 3 20 | m_DefaultFloat: 0 21 | m_DefaultInt: 0 22 | m_DefaultBool: 0 23 | m_Controller: {fileID: 0} 24 | - m_Name: Bool 25 | m_Type: 4 26 | m_DefaultFloat: 0 27 | m_DefaultInt: 0 28 | m_DefaultBool: 0 29 | m_Controller: {fileID: 0} 30 | - m_Name: Trigger 31 | m_Type: 9 32 | m_DefaultFloat: 0 33 | m_DefaultInt: 0 34 | m_DefaultBool: 0 35 | m_Controller: {fileID: 0} 36 | m_AnimatorLayers: 37 | - serializedVersion: 5 38 | m_Name: Base Layer 39 | m_StateMachine: {fileID: 8281324529383160549} 40 | m_Mask: {fileID: 0} 41 | m_Motions: [] 42 | m_Behaviours: [] 43 | m_BlendingMode: 0 44 | m_SyncedLayerIndex: -1 45 | m_DefaultWeight: 0 46 | m_IKPass: 0 47 | m_SyncedLayerAffectsTiming: 0 48 | m_Controller: {fileID: 9100000} 49 | --- !u!1107 &8281324529383160549 50 | AnimatorStateMachine: 51 | serializedVersion: 6 52 | m_ObjectHideFlags: 1 53 | m_CorrespondingSourceObject: {fileID: 0} 54 | m_PrefabInstance: {fileID: 0} 55 | m_PrefabAsset: {fileID: 0} 56 | m_Name: Base Layer 57 | m_ChildStates: [] 58 | m_ChildStateMachines: [] 59 | m_AnyStateTransitions: [] 60 | m_EntryTransitions: [] 61 | m_StateMachineTransitions: {} 62 | m_StateMachineBehaviours: [] 63 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 64 | m_EntryPosition: {x: 50, y: 120, z: 0} 65 | m_ExitPosition: {x: 800, y: 120, z: 0} 66 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 67 | m_DefaultState: {fileID: 0} 68 | -------------------------------------------------------------------------------- /Assets/Samples/Entities/Basic/BasicController.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9909cb8860757e047a926257ce8971c2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 9100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Entities/Basic/Entities.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b2cf911b1c1b634d9f3dafb208c7e49 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Entities/Dummy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Lunari.Tsuki.Entities; 3 | using Lunari.Tsuki.Entities.Common; 4 | using UnityEngine; 5 | namespace Lunari.Tsuki.Samples.Entities { 6 | public class Dummy : Trait { 7 | private Gauge gauge; 8 | public override void Describe(TraitDescriptor descriptor) { 9 | descriptor.DependsOn(out gauge); 10 | descriptor.RequiresComponent(TraitLocations.View); 11 | descriptor.RequiresComponent(TraitLocations.Root); 12 | foreach (AnimatorControllerParameterType value in Enum.GetValues(typeof(AnimatorControllerParameterType))) { 13 | descriptor.RequiresAnimatorParameter(value.ToString(), value); 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/Dummy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa21efd450cc552479ec4b56510fcd85 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5aa177ec70cf498ca02a4cb4e3b2bda5 3 | timeCreated: 1639419776 -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health/Combatant.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | namespace Lunari.Tsuki.Samples.Entities.Health { 3 | public enum Alignment { 4 | Ally, 5 | Enemy, 6 | Neutral 7 | } 8 | 9 | [TraitLocation(CommonLocation.Combat)] 10 | public class Combatant : Trait { 11 | 12 | public Alignment alignment; 13 | 14 | private Living living; 15 | 16 | public override void Describe(TraitDescriptor descriptor) { 17 | descriptor.DependsOn(out living); 18 | } 19 | 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health/Combatant.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ab24b08b3aa411d9d6a7b5071dec724 3 | timeCreated: 1619100061 -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health/Health.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d44792e50515d6b4d8b56f76bc55b629 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health/Living.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | namespace Lunari.Tsuki.Samples.Entities.Health { 3 | public class Living : Trait { 4 | public uint health; 5 | public uint maxHealth; 6 | } 7 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health/Living.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d02b9afcf054ed594fee688df1285a8 3 | timeCreated: 1639419788 -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health/SquadMember.cs: -------------------------------------------------------------------------------- 1 | namespace Lunari.Tsuki.Samples.Entities.Health { 2 | public class SquadMember { 3 | 4 | } 5 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/Health/SquadMember.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eebebb98eaf6405a94a53b728f36a5c0 3 | timeCreated: 1639428490 -------------------------------------------------------------------------------- /Assets/Samples/Entities/SpriteFlipper.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | 3 | namespace Lunari.Tsuki.Samples.Entities { 4 | [TraitLocation(CommonLocation.View)] 5 | public class SpriteFlipper : Trait { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/SpriteFlipper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7be48ac487643b3937fdb7034705e25 3 | timeCreated: 1619100061 -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitA.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | 3 | namespace Lunari.Tsuki.Samples.Entities { 4 | [TraitLocation(CommonLocation.View)] 5 | public class TraitA : Trait { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitA.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 001d9fcc3c854d0fb368d3ccfe4cd89f 3 | timeCreated: 1619013285 -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitB.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | 3 | namespace Lunari.Tsuki.Samples.Entities { 4 | [TraitLocation(CommonLocation.Attack)] 5 | public class TraitB : Trait { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitB.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a294d9d075b14415b3b1080a06e81854 3 | timeCreated: 1619100048 -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitC.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | 3 | namespace Lunari.Tsuki.Samples.Entities { 4 | [TraitLocation(CommonLocation.AI)] 5 | public class TraitC : Trait { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitC.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8b922ef637541eaab140a1b2af0e8da 3 | timeCreated: 1619100061 -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitD.cs: -------------------------------------------------------------------------------- 1 | using Lunari.Tsuki.Entities; 2 | 3 | namespace Lunari.Tsuki.Samples.Entities { 4 | [TraitLocation(CommonLocation.FX)] 5 | public class TraitD : Trait { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Samples/Entities/TraitD.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5295c8bec6b842e7bb087803fcd2f0f5 3 | timeCreated: 1619100333 -------------------------------------------------------------------------------- /Assets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.lunari.tsuki", 3 | "displayName": "Tsuki Suite", 4 | "author": "Lunari Studios", 5 | "version": "2.2.1", 6 | "description": "A tool suite created to make Unity development easier", 7 | "unity": "2018.1", 8 | "repository": "https://github.com/LunariStudios/TsukiSuite", 9 | "keywords": [ 10 | "Component", 11 | "Utility", 12 | "Graphs" 13 | ], 14 | "contributors": [ 15 | "Bruno \"DDevil\" Silva Freire" 16 | ], 17 | "samples": [ 18 | { 19 | "displayName": "Basic Entity", 20 | "description": "Displays how you can setup an entity with basic traits", 21 | "path": "Samples~/Entities/Basic" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /Assets/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8762d5805aa6be465934caf4623a3a9f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Bruno "DDevil" Silva Freire 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.rider": "3.0.34", 4 | "com.unity.test-framework": "1.1.33", 5 | "com.unity.ugui": "1.0.0", 6 | "com.unity.modules.ai": "1.0.0", 7 | "com.unity.modules.animation": "1.0.0", 8 | "com.unity.modules.assetbundle": "1.0.0", 9 | "com.unity.modules.imageconversion": "1.0.0", 10 | "com.unity.modules.imgui": "1.0.0", 11 | "com.unity.modules.jsonserialize": "1.0.0", 12 | "com.unity.modules.physics": "1.0.0", 13 | "com.unity.modules.physics2d": "1.0.0", 14 | "com.unity.modules.ui": "1.0.0", 15 | "com.unity.modules.uielements": "1.0.0", 16 | "com.unity.modules.umbra": "1.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 2 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerPaddingPower: 1 14 | m_EtcTextureCompressorBehavior: 1 15 | m_EtcTextureFastCompressor: 1 16 | m_EtcTextureNormalCompressor: 2 17 | m_EtcTextureBestCompressor: 4 18 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref;tt; 19 | m_ProjectGenerationRootNamespace: Lunari.Tsuki 20 | m_EnableTextureStreamingInEditMode: 1 21 | m_EnableTextureStreamingInPlayMode: 1 22 | m_AsyncShaderCompilation: 1 23 | m_CachingShaderPreprocessor: 0 24 | m_EnterPlayModeOptionsEnabled: 0 25 | m_EnterPlayModeOptions: 3 26 | m_GameObjectNamingDigits: 1 27 | m_GameObjectNamingScheme: 0 28 | m_AssetNamingUsesSpace: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_SerializeInlineMappingsOnOneLine: 0 31 | m_DisableCookiesInLightmapper: 1 32 | m_AssetPipelineMode: 1 33 | m_CacheServerMode: 0 34 | m_CacheServerEndpoint: 35 | m_CacheServerNamespacePrefix: default 36 | m_CacheServerEnableDownload: 1 37 | m_CacheServerEnableUpload: 1 38 | m_CacheServerEnableAuth: 0 39 | m_CacheServerEnableTls: 0 40 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 1 16 | m_EnablePackageDependencies: 1 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 1 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_ErrorMessage: 32 | m_Original: 33 | m_Id: 34 | m_Name: 35 | m_Url: 36 | m_Scopes: [] 37 | m_IsDefault: 0 38 | m_Capabilities: 0 39 | m_Modified: 0 40 | m_Name: 41 | m_Url: 42 | m_Scopes: 43 | - 44 | m_SelectedScopeIndex: 0 45 | m_LoadAssets: 0 46 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2022.3.19f1 2 | m_EditorVersionWithRevision: 2022.3.19f1 (244b723c30a6) 3 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/TimelineSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | assetDefaultFramerate: 60 16 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Static/Installation_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Static/Installation_1.png -------------------------------------------------------------------------------- /Static/Installation_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LunariStudios/TsukiSuite/bb3465c52f6965c6cf9a10a241fa7c6d36e2d4e3/Static/Installation_2.png -------------------------------------------------------------------------------- /Tsuki.Graphs.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | CSharp71 -------------------------------------------------------------------------------- /Tsuki.Runtime.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | Default -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedScenePath-0: 9 | value: 2242470311464678020018271e3710351803113e252d357e38271427fb 10 | flags: 0 11 | RecentlyUsedScenePath-1: 12 | value: 22424703114646680c031c2e153010351803113e252d357f0f280e3ae1af1136f6ee22e0e2297129370bfb25 13 | flags: 0 14 | RecentlyUsedScenePath-2: 15 | value: 22424703114646680c031c2e153010351803113e252d357f052c1c3ff6e87b10e7e63afdef742a323016f6 16 | flags: 0 17 | UIBuilder.EditorExtensionModeKey: 18 | value: 37434103 19 | flags: 0 20 | UIBuilder.HideNotificationAboutMissingUITKPackage: 21 | value: 37434103 22 | flags: 0 23 | vcSharedLogLevel: 24 | value: 0d5e400f0650 25 | flags: 0 26 | m_VCAutomaticAdd: 1 27 | m_VCDebugCom: 0 28 | m_VCDebugCmd: 0 29 | m_VCDebugOut: 0 30 | m_SemanticMergeMode: 2 31 | m_VCShowFailedCheckout: 1 32 | m_VCOverwriteFailedCheckoutAssets: 1 33 | m_VCProjectOverlayIcons: 1 34 | m_VCHierarchyOverlayIcons: 1 35 | m_VCOtherOverlayIcons: 1 36 | m_VCAllowAsyncUpdate: 0 37 | -------------------------------------------------------------------------------- /UserSettings/Search.settings: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /push.bat: -------------------------------------------------------------------------------- 1 | git subtree split -b upm -P Assets 2 | git checkout upm 3 | git push 4 | git checkout master 5 | git push 6 | --------------------------------------------------------------------------------