├── Editor
├── SidekickIcon.png
├── d_SidekickIcon.png
├── Dropdowns.meta
├── ECSContext.cs.meta
├── SelectionInfo.cs.meta
├── ECSAccess
│ ├── ECSAccessInner
│ │ ├── Sidekick.ECSAccess.asmref
│ │ ├── Sidekick.ECSAccess.asmref.meta
│ │ ├── ECSAccess.cs.meta
│ │ └── ECSAccess.cs
│ ├── ECSAccessInner.meta
│ ├── Sidekick.ECSAccess.MissingFallback.asmdef.meta
│ └── Sidekick.ECSAccess.MissingFallback.asmdef
├── Helpers
│ ├── ClassUtilities.cs.meta
│ ├── TypeUtility.cs.meta
│ ├── AttributeHelper.cs.meta
│ ├── CollectionUtility.cs.meta
│ ├── SidekickExtensions.cs.meta
│ ├── AnimationHelper.cs.meta
│ ├── SidekickEditorGUI.cs.meta
│ ├── SidekickUtility.cs.meta
│ ├── AnimationHelper.cs
│ ├── SidekickExtensions.cs
│ ├── AttributeHelper.cs
│ ├── CollectionUtility.cs
│ ├── SidekickUtility.cs
│ ├── ClassUtilities.cs
│ ├── SidekickEditorGUI.cs
│ └── TypeUtility.cs
├── Dropdowns
│ ├── TypeSelectDropdown.cs.meta
│ ├── ECSSystemSelectDropdown.cs.meta
│ ├── UnityObjectSelectDropdown.cs.meta
│ ├── ECSSystemSelectDropdown.cs
│ ├── UnityObjectSelectDropdown.cs
│ └── TypeSelectDropdown.cs
├── ECSAccess.meta
├── Sidekick.Editor.asmdef.meta
├── Panes.meta
├── Helpers.meta
├── SidekickWindow.cs.meta
├── Panes
│ ├── BasePane.cs.meta
│ ├── EventPane.cs.meta
│ ├── FieldPane.cs.meta
│ ├── MethodPane.cs.meta
│ ├── PropertyPane.cs.meta
│ ├── VariablePane.cs.meta
│ ├── BasePane.cs
│ ├── EventPane.cs
│ ├── FieldPane.cs
│ ├── PropertyPane.cs
│ ├── MethodPane.cs
│ └── VariablePane.cs
├── PersistentData.cs.meta
├── ECSContext.cs
├── SidekickSettings.cs.meta
├── InspectionExclusions.cs.meta
├── Sidekick.Editor.asmdef
├── SidekickIcon.png.meta
├── InspectionExclusions.cs
├── PersistentData.cs
├── SelectionInfo.cs
├── SidekickSettings.cs
├── d_SidekickIcon.png.meta
└── SidekickWindow.cs
├── package.json.meta
├── Editor.meta
├── LICENSE.md.meta
├── README.md.meta
├── package.json
├── LICENSE.md
└── README.md
/Editor/SidekickIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sabresaurus/Sidekick/HEAD/Editor/SidekickIcon.png
--------------------------------------------------------------------------------
/Editor/d_SidekickIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sabresaurus/Sidekick/HEAD/Editor/d_SidekickIcon.png
--------------------------------------------------------------------------------
/Editor/Dropdowns.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0bcc3d25e0e34d0b9531cd826241a7b1
3 | timeCreated: 1626105095
--------------------------------------------------------------------------------
/Editor/ECSContext.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: af9aeea6c86940cd9a057788c1d05b7d
3 | timeCreated: 1628962703
--------------------------------------------------------------------------------
/Editor/SelectionInfo.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c2df7b1eefb44f33bdfeefeb604bae18
3 | timeCreated: 1628189891
--------------------------------------------------------------------------------
/Editor/ECSAccess/ECSAccessInner/Sidekick.ECSAccess.asmref:
--------------------------------------------------------------------------------
1 | {
2 | "reference": "GUID:734d92eba21c94caba915361bd5ac177"
3 | }
--------------------------------------------------------------------------------
/Editor/Helpers/ClassUtilities.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e3b1a10009aa4d0594aefc4e69c9c0d5
3 | timeCreated: 1626516372
--------------------------------------------------------------------------------
/Editor/Dropdowns/TypeSelectDropdown.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 74653a401d9849d69a9be9e29639cce7
3 | timeCreated: 1626101774
--------------------------------------------------------------------------------
/Editor/Dropdowns/ECSSystemSelectDropdown.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0af951b9382042a0a1f29801d3c4fe3c
3 | timeCreated: 1630093114
--------------------------------------------------------------------------------
/Editor/Dropdowns/UnityObjectSelectDropdown.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9bb9cd3c74824e2ab85b0398bebbeac5
3 | timeCreated: 1626105114
--------------------------------------------------------------------------------
/package.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d3e9a3ecc70f2734596c8c95a0f5e372
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor/ECSAccess.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4b13fbd7b242d694cbed626cab3b3111
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Sidekick.Editor.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a86b36e67faf9df4db004558524f5e6c
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor/ECSAccess/ECSAccessInner.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0af1c8c39f3b941c58f7b378b6bba803
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c4b0530859219488fba5a3cfeb0904e2
3 | folderAsset: yes
4 | timeCreated: 1453304050
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Editor/ECSAccess/Sidekick.ECSAccess.MissingFallback.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bf6a2e0c2c9ea48ec8a1a87e4d2a8882
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor/Panes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dbcb1de1736e94fbda76cffe81a38402
3 | folderAsset: yes
4 | timeCreated: 1464966494
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/LICENSE.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 25408219fbd644e9f9f39c26377c59a1
3 | timeCreated: 1532215304
4 | licenseType: Free
5 | DefaultImporter:
6 | externalObjects: {}
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 271516f7e079645bc93a84bb8bb972f2
3 | timeCreated: 1532215316
4 | licenseType: Free
5 | TextScriptImporter:
6 | externalObjects: {}
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Editor/ECSAccess/ECSAccessInner/Sidekick.ECSAccess.asmref.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9c1985e42eb4b2a4d84d792a7eb58329
3 | AssemblyDefinitionReferenceImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor/Helpers.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fc020cfd712644fcdb60b827b6f74558
3 | folderAsset: yes
4 | timeCreated: 1520685499
5 | licenseType: Free
6 | DefaultImporter:
7 | externalObjects: {}
8 | userData:
9 | assetBundleName:
10 | assetBundleVariant:
11 |
--------------------------------------------------------------------------------
/Editor/SidekickWindow.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2f7f686a9fc17c447986570906bc0b83
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/ECSAccess/ECSAccessInner/ECSAccess.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8e407b4924a0fce459c2fa9f8e6558d0
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Editor/Panes/BasePane.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1e30e047e66b049d7bd71c58da1b9ec2
3 | timeCreated: 1464968052
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/PersistentData.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bfa6987ec63f048e380d284136141d5c
3 | timeCreated: 1466785766
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Helpers/TypeUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 807a5f7a394194f168859a023bbb09dd
3 | timeCreated: 1463333952
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Panes/EventPane.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3d4ea97621609494eb2aae353778783e
3 | timeCreated: 1465316356
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Panes/FieldPane.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e86164037f63849f180c954892bbb1c6
3 | timeCreated: 1464966500
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Panes/MethodPane.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5d01fa019787b46edab261486d02c6a1
3 | timeCreated: 1464968052
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Panes/PropertyPane.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 96eb2defafbed4ba9b08e93feef6ee61
3 | timeCreated: 1464968052
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Panes/VariablePane.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a4da56c8de9614637b0d5a8241fd120d
3 | timeCreated: 1464968052
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Helpers/AttributeHelper.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a2c0272b3dd1444ea9b6a280e3c2e262
3 | timeCreated: 1465576649
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/ECSContext.cs:
--------------------------------------------------------------------------------
1 | #if ECS_EXISTS
2 | using Unity.Entities;
3 | #endif
4 |
5 | namespace Sabresaurus.Sidekick
6 | {
7 | public class ECSContext
8 | {
9 | #if ECS_EXISTS
10 | public EntityManager EntityManager;
11 | public Entity Entity;
12 | public ComponentType ComponentType;
13 | #endif
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Editor/Helpers/CollectionUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3e257ae7ee0d34673b4adc146773a891
3 | timeCreated: 1468345689
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/Helpers/SidekickExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a486b3b2dfe614879bef2e28a4116a12
3 | timeCreated: 1465575908
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/SidekickSettings.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ec45aad77bb964429a06151381e44e5e
3 | timeCreated: 1523822122
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Editor/InspectionExclusions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: af22039572a534245a5b2fb195768983
3 | timeCreated: 1529799703
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Editor/Helpers/AnimationHelper.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b4cd3d64691d14594905daa16ac78b14
3 | timeCreated: 1525301524
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Editor/Helpers/SidekickEditorGUI.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c3f16ca8c4f10b246b10a98ef2aab076
3 | timeCreated: 1524569927
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Editor/Helpers/SidekickUtility.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 158917bcfc6d84eb1a7fafc3968b806c
3 | timeCreated: 1522626776
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.sabresaurus.sidekick",
3 | "version": "1.0.0-preview.10",
4 | "displayName": "Sidekick",
5 | "description": "Inspect private fields, properties, fire methods and more",
6 | "unity": "2020.3",
7 | "documentationUrl": "https://github.com/sabresaurus/Sidekick",
8 | "changelogUrl": "https://github.com/sabresaurus/Sidekick/commits/main",
9 | "author": {
10 | "name": "sabresaurus",
11 | "url": "https://github.com/sabresaurus"
12 | }
13 | }
--------------------------------------------------------------------------------
/Editor/ECSAccess/Sidekick.ECSAccess.MissingFallback.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Sidekick.ECSAccess.MissingFallback",
3 | "rootNamespace": "",
4 | "references": [],
5 | "includePlatforms": [],
6 | "excludePlatforms": [],
7 | "allowUnsafeCode": false,
8 | "overrideReferences": false,
9 | "precompiledReferences": [],
10 | "autoReferenced": true,
11 | "defineConstraints": [
12 | "ECS_EXISTS"
13 | ],
14 | "versionDefines": [],
15 | "noEngineReferences": false
16 | }
--------------------------------------------------------------------------------
/Editor/Panes/BasePane.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Sabresaurus.Sidekick
4 | {
5 | public abstract class BasePane
6 | {
7 | protected static bool SearchMatches(string searchTerm, string candidateName)
8 | {
9 | if (string.IsNullOrEmpty(searchTerm)) return true;
10 |
11 | string[] split = searchTerm.Split(new[]{' '}, StringSplitOptions.RemoveEmptyEntries);
12 |
13 | foreach (string searchTermPart in split)
14 | {
15 | if (!candidateName.Contains(searchTermPart, StringComparison.InvariantCultureIgnoreCase))
16 | return false;
17 | }
18 | return true;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/Editor/Panes/EventPane.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Reflection;
4 | using UnityEditor;
5 | using UnityEngine;
6 |
7 | namespace Sabresaurus.Sidekick
8 | {
9 | public class EventPane : BasePane
10 | {
11 | // string methodOutput = "";
12 |
13 | public void DrawEvents(Type componentType, object component, string searchTerm, FieldInfo[] events)//EventInfo[] events)
14 | {
15 | foreach (FieldInfo eventInfo in events)
16 | {
17 | if(!SearchMatches(searchTerm, eventInfo.Name))
18 | {
19 | // Does not match search term, skip it
20 | continue;
21 | }
22 |
23 | if(eventInfo.FieldType.IsSubclassOf(typeof(Delegate)))
24 | {
25 | Delegate targetDelegate = (Delegate)eventInfo.GetValue(component);
26 | if(GUILayout.Button(eventInfo.Name))
27 | {
28 | if(targetDelegate != null)
29 | {
30 | targetDelegate.DynamicInvoke();
31 | }
32 | }
33 | }
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Editor/Sidekick.Editor.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Sidekick.Editor",
3 | "rootNamespace": "",
4 | "references": [
5 | "GUID:d442c42f779284647ade94a5568b6139",
6 | "GUID:734d92eba21c94caba915361bd5ac177",
7 | "GUID:c38fb62397af04c51b143415e1db6d90",
8 | "GUID:a5baed0c9693541a5bd947d336ec7659",
9 | "GUID:d8b63aba1907145bea998dd612889d6b"
10 | ],
11 | "includePlatforms": [
12 | "Editor"
13 | ],
14 | "excludePlatforms": [],
15 | "allowUnsafeCode": false,
16 | "overrideReferences": false,
17 | "precompiledReferences": [],
18 | "autoReferenced": true,
19 | "defineConstraints": [],
20 | "versionDefines": [
21 | {
22 | "name": "com.unity.entities",
23 | "expression": "",
24 | "define": "ECS_EXISTS"
25 | },
26 | {
27 | "name": "com.unity.mathematics",
28 | "expression": "",
29 | "define": "UNITY_MATH_EXISTS"
30 | }
31 | ],
32 | "noEngineReferences": false
33 | }
--------------------------------------------------------------------------------
/Editor/Helpers/AnimationHelper.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System;
3 |
4 | namespace Sabresaurus.Sidekick
5 | {
6 | public static class AnimationHelper
7 | {
8 | private static float currentFrameTimestamp = 0;
9 | private static float currentFrameDelta = 0;
10 |
11 | private static bool animationActive = false;
12 |
13 | public static void UpdateTime()
14 | {
15 | currentFrameDelta = Time.realtimeSinceStartup - currentFrameTimestamp;
16 | currentFrameTimestamp = Time.realtimeSinceStartup;
17 | }
18 |
19 | public static float DeltaTime
20 | {
21 | get
22 | {
23 | // Cap delta time in case there's a long frame
24 | return Mathf.Min(currentFrameDelta, 0.1f);
25 | }
26 | }
27 |
28 |
29 | public static bool AnimationActive
30 | {
31 | get
32 | {
33 | return animationActive;
34 | }
35 | }
36 |
37 | public static void SetAnimationActive()
38 | {
39 | animationActive = true;
40 | }
41 |
42 | public static void ClearAnimationActive()
43 | {
44 | animationActive = false;
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Sabresaurus
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, 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,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Editor/SidekickIcon.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a042d66b200724c508b2783e69b8e163
3 | timeCreated: 1464792571
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | linearTexture: 1
12 | correctGamma: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: 0.25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 7
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -3
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: 1
33 | aniso: 1
34 | mipBias: -1
35 | wrapMode: 1
36 | nPOTScale: 0
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | allowsAlphaSplitting: 0
41 | spriteMode: 0
42 | spriteExtrude: 1
43 | spriteMeshType: 1
44 | alignment: 0
45 | spritePivot: {x: 0.5, y: 0.5}
46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
47 | spritePixelsToUnits: 100
48 | alphaIsTransparency: 1
49 | spriteTessellationDetail: -1
50 | textureType: 2
51 | buildTargetSettings: []
52 | spriteSheet:
53 | sprites: []
54 | outline: []
55 | spritePackingTag:
56 | userData:
57 | assetBundleName:
58 | assetBundleVariant:
59 |
--------------------------------------------------------------------------------
/Editor/ECSAccess/ECSAccessInner/ECSAccess.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | using Unity.Entities;
4 |
5 | namespace Sabresaurus.Sidekick
6 | {
7 | public unsafe class ECSAccess
8 | {
9 | public static object GetComponentData(EntityManager entityManager, Entity entity, ComponentType componentType)
10 | {
11 | EntityDataAccess* dataAccess = entityManager.GetCheckedEntityDataAccess();
12 | EntityComponentStore* entityComponentStore = dataAccess->EntityComponentStore;
13 | byte* ptr = entityComponentStore->GetComponentDataWithTypeRO(entity, componentType.TypeIndex);
14 |
15 | return Marshal.PtrToStructure((IntPtr) ptr, componentType.GetManagedType());
16 | }
17 |
18 | public static void SetComponentData(EntityManager entityManager, Entity entity, ComponentType componentType, object componentData)
19 | => SetComponentData(entityManager, entity, componentType.TypeIndex, componentData);
20 |
21 | public static void SetComponentData(EntityManager entityManager, Entity entity, int typeIndex, object componentData)
22 | {
23 | EntityDataAccess* dataAccess = entityManager.GetCheckedEntityDataAccess();
24 |
25 | if (!dataAccess->IsInExclusiveTransaction)
26 | dataAccess->DependencyManager->CompleteReadAndWriteDependency(typeIndex);
27 |
28 | EntityComponentStore* entityComponentStore = dataAccess->EntityComponentStore;
29 |
30 | byte* ptr = entityComponentStore->GetComponentDataWithTypeRW(entity, typeIndex, entityComponentStore->GlobalSystemVersion);
31 |
32 | Marshal.StructureToPtr(componentData, (IntPtr) ptr, false);
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/Editor/Helpers/SidekickExtensions.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 | using System;
4 |
5 | namespace Sabresaurus.Sidekick
6 | {
7 | public static class SidekickExtensions
8 | {
9 | public static RectOffset SetLeft(this RectOffset rectOffset, int newValue)
10 | {
11 | rectOffset.left = newValue;
12 | return rectOffset;
13 | }
14 |
15 | public static RectOffset SetRight(this RectOffset rectOffset, int newValue)
16 | {
17 | rectOffset.right = newValue;
18 | return rectOffset;
19 | }
20 |
21 | public static bool Contains(this string source, string value, StringComparison comparison)
22 | {
23 | return source.IndexOf(value, comparison) >= 0;
24 | }
25 |
26 | public static bool HasFlagByte(this Enum mask, Enum flags) // Same behavior than Enum.HasFlag in .NET 4
27 | {
28 | return ((byte)(IConvertible)mask & (byte)(IConvertible)flags) == (byte)(IConvertible)flags;
29 | }
30 |
31 | public static string RemoveStart(this string input, string toRemove)
32 | {
33 | if(input.StartsWith(toRemove, StringComparison.InvariantCultureIgnoreCase))
34 | {
35 | input = input.Remove(0, toRemove.Length);
36 | }
37 |
38 | return input;
39 | }
40 |
41 | public static string RemoveEnd(this string input, string toRemove)
42 | {
43 | if(input.EndsWith(toRemove, StringComparison.InvariantCultureIgnoreCase))
44 | {
45 | input = input.Remove(input.Length - toRemove.Length, toRemove.Length);
46 | }
47 |
48 | return input;
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/Editor/InspectionExclusions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Reflection;
4 | #if ECS_EXISTS
5 | using Unity.Entities;
6 | #endif
7 | using UnityEngine;
8 |
9 | namespace Sabresaurus.Sidekick
10 | {
11 | ///
12 | /// Specifies types for Sidekick to ignore when inspecting objects
13 | ///
14 | public static class InspectionExclusions
15 | {
16 | public static List GetExcludedTypes()
17 | {
18 | return new List()
19 | {
20 | // Built in exclusions
21 | typeof(System.Object),
22 | typeof(UnityEngine.Object),
23 | typeof(UnityEngine.Component),
24 | typeof(UnityEngine.Behaviour),
25 | typeof(UnityEngine.MonoBehaviour),
26 | typeof(UnityEngine.ScriptableObject),
27 | #if ECS_EXISTS
28 | typeof(ValueType),
29 | #endif
30 | // Add any custom exclusions here
31 | };
32 | }
33 |
34 | public static bool IsPropertyExcluded(Type componentType, PropertyInfo property)
35 | {
36 | // Will instantiate at edit time
37 | if (componentType == typeof(MeshFilter) && property.Name == "mesh") return true;
38 | if ((componentType == typeof(Renderer) || componentType.IsSubclassOf(typeof(Renderer))) && property.Name == "material") return true;
39 | if ((componentType == typeof(Renderer) || componentType.IsSubclassOf(typeof(Renderer))) && property.Name == "materials") return true;
40 |
41 | // Will result in assertions if the matrix fails ValidTRS
42 | if (componentType == typeof(Matrix4x4) && property.Name == "rotation") return true;
43 | if (componentType == typeof(Matrix4x4) && property.Name == "lossyScale") return true;
44 | return false;
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/Editor/Helpers/AttributeHelper.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 |
4 | namespace Sabresaurus.Sidekick
5 | {
6 | public static class AttributeHelper
7 | {
8 | public static bool IsSerializable(object[] customAttributes)
9 | {
10 | if(customAttributes == null || customAttributes.Length == 0)
11 | {
12 | return false;
13 | }
14 | // Find any attributes that are SerializeField
15 | for (int i = 0; i < customAttributes.Length; i++)
16 | {
17 | if(customAttributes[i] is SerializeField)
18 | {
19 | return true;
20 | }
21 | }
22 | // No attributes found, assume it can't be serialized
23 | return false;
24 | }
25 |
26 | public static bool IsObsolete(object[] customAttributes)
27 | {
28 | if (customAttributes == null || customAttributes.Length == 0)
29 | {
30 | return false;
31 | }
32 | // Find any attributes that are Obsolete
33 | for (int i = 0; i < customAttributes.Length; i++)
34 | {
35 | if (customAttributes[i] is System.ObsoleteAttribute)
36 | {
37 | return true;
38 | }
39 | }
40 | // No attributes found, assume it's ok
41 | return false;
42 | }
43 |
44 | public static bool IsObsoleteWithError(object[] customAttributes)
45 | {
46 | if(customAttributes == null || customAttributes.Length == 0)
47 | {
48 | return false;
49 | }
50 | // Find any attributes that are Obsolete
51 | for (int i = 0; i < customAttributes.Length; i++)
52 | {
53 | if(customAttributes[i] is System.ObsoleteAttribute)
54 | {
55 | // If the attribute is marked to trigger an error
56 | if(((System.ObsoleteAttribute)customAttributes[i]).IsError)
57 | {
58 | return true;
59 | }
60 | }
61 | }
62 | // No attributes found, assume it's ok
63 | return false;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Editor/PersistentData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Reflection;
4 | using UnityEngine;
5 |
6 | namespace Sabresaurus.Sidekick
7 | {
8 | [Serializable]
9 | public class MethodSetup : ISerializationCallbackReceiver
10 | {
11 | public string MethodIdentifier = "";
12 |
13 | public object[] Values = new object[0];
14 |
15 | public Type[] GenericArguments = new Type[0];
16 |
17 | private string[] GenericArgumentsString;
18 |
19 | public void OnBeforeSerialize()
20 | {
21 | // Only simple types can be serialised, so convert the type to an assembly-qualified type name
22 | GenericArgumentsString = new string[GenericArguments.Length];
23 | for (int i = 0; i < GenericArguments.Length; i++)
24 | {
25 | if (GenericArguments[i] != null)
26 | {
27 | GenericArgumentsString[i] = GenericArguments[i].AssemblyQualifiedName;
28 | }
29 | }
30 | }
31 |
32 | public void OnAfterDeserialize()
33 | {
34 | GenericArguments = new Type[GenericArgumentsString.Length];
35 | for (int i = 0; i < GenericArgumentsString.Length; i++)
36 | {
37 | if (!string.IsNullOrEmpty(GenericArgumentsString[i]))
38 | {
39 | // Convert the assembly-qualified type name back to a proper type
40 | GenericArguments[i] = Type.GetType(GenericArgumentsString[i]);
41 | }
42 | }
43 | }
44 | }
45 |
46 | ///
47 | /// This class allows various utilities to store data that will persist through recompiles
48 | ///
49 | [Serializable]
50 | public class PersistentData
51 | {
52 | // MethodPane
53 | public List ExpandedMethods = new List();
54 | public HashSet ExpandedFields = new HashSet();
55 | }
56 | }
--------------------------------------------------------------------------------
/Editor/Dropdowns/ECSSystemSelectDropdown.cs:
--------------------------------------------------------------------------------
1 | #if ECS_EXISTS
2 | using System;
3 | using Unity.Entities;
4 | using UnityEditor.IMGUI.Controls;
5 | using UnityEngine;
6 |
7 | namespace Sabresaurus.Sidekick
8 | {
9 | public class ECSSystemSelectDropdown : AdvancedDropdown
10 | {
11 | private readonly Action