├── CHANGELOG.md ├── CHANGELOG.md.meta ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── Attributes.meta ├── Attributes │ ├── Expose.cs │ ├── Expose.cs.meta │ ├── NotEditable.cs │ ├── NotEditable.cs.meta │ ├── TypeFilter.cs │ └── TypeFilter.cs.meta ├── EditorGUIUtils.cs ├── EditorGUIUtils.cs.meta ├── InterfaceReference.cs ├── InterfaceReference.cs.meta ├── com.CippSharpCore.Interfaces.asmdef └── com.CippSharpCore.Interfaces.asmdef.meta ├── Samples.meta ├── Samples ├── Runtime.meta ├── Runtime │ ├── ComponentImplementingCustomInterface.cs │ ├── ComponentImplementingCustomInterface.cs.meta │ ├── ComponentWithReference.cs │ ├── ComponentWithReference.cs.meta │ ├── ExposedInterfaceReference.cs │ ├── ExposedInterfaceReference.cs.meta │ ├── ICustomInterfaceExample.cs │ ├── ICustomInterfaceExample.cs.meta │ ├── INFOS.txt │ ├── INFOS.txt.meta │ ├── TypeFilterReference.cs │ ├── TypeFilterReference.cs.meta │ ├── com.CippSharpCore.Interfaces.Samples.asmdef │ └── com.CippSharpCore.Interfaces.Samples.asmdef.meta ├── Scenes.meta ├── Scenes │ ├── Examples.unity │ └── Examples.unity.meta ├── Screenshots.meta └── Screenshots │ ├── TwoInspectors.PNG │ └── TwoInspectors.PNG.meta ├── package.json └── package.json.meta /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## Version 1.0.X 2 | - minor changes and bug fixing 3 | 4 | ## Version 1.0.6 5 | - fixed readme.md typo 6 | 7 | ## Version 1.0.5 8 | - updated readme with tip jar (instead of patreon) 9 | - updated changelog and package.json 10 | 11 | ## Version 1.0.4 12 | - fixed an error (a script wasn't correctly #if#deffed with UNITY_EDITOR) 13 | 14 | ## Version 1.0.3 15 | - #if#deffed samples with UNITY_EDITOR 16 | 17 | ## Version 1.0.2 18 | - edited readme and package.json 19 | 20 | ## Version 1.0.1 21 | - updated readme 22 | 23 | ## Version 1.0.0 24 | - Added support for UnityPackageManager 25 | - Added support for AssemblyDefinitions 26 | - Foldering 27 | 28 | ## Prior Versions 29 | - Added and improved main scripts 30 | -------------------------------------------------------------------------------- /CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 877329b14735b1b4fb5af46cd5508b8e 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Cippman 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 | -------------------------------------------------------------------------------- /LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d49fdf8a4fcbbd45a96a0bd8c0c9448 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity-InterfaceReference 2 | Create your custom serializable class that 3 | holds the reference to an UnityEngine.Object 4 | that implements an interface I. 5 | 6 | ### Purpose: 7 | The main purpose of InterfaceReference is to present 8 | a code friendly solution to reference UnityEngine.Objects 9 | with Interface I in Inspector. 10 | 11 | ### Contents: 12 | The repository comes with main class InterfaceReference'I; 13 | support scripts and few attributes. 14 | 15 | ### How to Install: 16 | - Option 1 (readonly) now it supports Unity Package Manager so you can download by copy/paste the git url in 'Package Manager Window + Install From Git'. 17 | As said this is a readonly solution so you cannot access all files this way. 18 | - Option 2 (classic) download this repository as .zip; Extract the files; Drag 'n' drop the extracted folder in your unity project (where you prefer). 19 | - Option 3 (alternative) add this as submodule / separate repo in your project 20 | - Option 4 (vintage) use the old ".unitypackage" 21 | 22 | 23 | ### Notes: 24 | Multiple Components: 25 | - For multiple components with T implementation 26 | on same gameObject by defult only the first is 27 | retrived. To assign another component that is not 28 | the first you should open [two inspectors](https://photos.app.goo.gl/Pw8Hq1o3qnCGoica6): 29 | with one locked on the object with the interface 30 | reference you can use the other to manually assign 31 | the appointed component 32 | 33 | Code: 34 | * The process to create your custom reference to your 35 | interface is similar to create custom events 36 | with UnityEvents. 37 | Just inherit from InterfaceReference'I with your custom 38 | serializable class where I is the interface. 39 | * By code you can access to the interface by implicitly 40 | casting the class to T "(I)interfaceReference" or just type "interfaceReference.Interface". 41 | (see also the examples) 42 | - Alternatively you can declare a UnityEngine.Object and 43 | use the TypeFilterAttribute (another solution). 44 | Then at runtime cast it to the interface 45 | 46 | ### History: 47 | Inspired by (IUnified [asset store](https://assetstore.unity.com/packages/tools/iunified-12117) 48 | and [forum](https://forum.unity.com/threads/released-iunified-c-interfaces-for-unity.206988/)) 49 | (an useful asset that I bought years ago) I'd like to put me on try 50 | and present my solution to the question of how to 51 | serialize interfaces held by components (or other objects)? 52 | What is the best plug 'n' play workflow/compromises to do this? 53 | 54 | This version is completely free and different (as implementation). 55 | 56 | ### Links: 57 | - [forum](https://forum.unity.com/threads/repository-interface-reference.672535/) 58 | - [repo](https://github.com/Cippman/Unity-InterfaceReference.git) 59 | 60 | ### Support: 61 | - [tip jar](https://www.amazon.it/photos/share/Gbg3FN0k6pjG6F5Ln3dqQEmwO0u4nSkNIButm3EGtit) 62 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a0861dc40bdb4c4ea88a8d4b2fc966a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 908c5eb5f75636340ac648a3d47882a4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Attributes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f61ac6248ebb8314eae643dd21be1bd3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Attributes/Expose.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | using System; 6 | using UnityEngine; 7 | 8 | #if UNITY_EDITOR 9 | using UnityEditor; 10 | #endif 11 | 12 | namespace CippSharp.Core.Interfaces 13 | { 14 | /// 15 | /// Purpose: after declaring a custom Interface Reference you can directly expose the target 16 | /// in inspector without have the 'foldout'. 17 | /// 18 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] 19 | public class ExposeAttribute : PropertyAttribute 20 | { 21 | 22 | } 23 | } 24 | 25 | #if UNITY_EDITOR 26 | namespace CippSharp.Core.Interfaces.Editor 27 | { 28 | /// 29 | /// Custom drawer of ExposeAttribute. 30 | /// 31 | [CustomPropertyDrawer(typeof(ExposeAttribute))] 32 | public class ExposeAttributeDrawer : PropertyDrawer 33 | { 34 | private SerializedProperty ser_target = null; 35 | 36 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 37 | { 38 | return EditorGUI.GetPropertyHeight(property, label, property.isExpanded && property.hasChildren); 39 | } 40 | 41 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 42 | { 43 | ExposeAttribute exposeAttribute = attribute as ExposeAttribute; 44 | if (property.propertyType == SerializedPropertyType.Generic) 45 | { 46 | if (ser_target == null) 47 | { 48 | ser_target = property.FindPropertyRelative("target"); 49 | } 50 | 51 | if (ser_target != null) 52 | { 53 | if (exposeAttribute != null) 54 | { 55 | EditorGUIUtils.DrawProperty(position, ser_target, label); 56 | } 57 | else 58 | { 59 | Debug.LogError("Failed to assign the attribute."); 60 | } 61 | } 62 | else 63 | { 64 | Debug.LogWarning("Expose Attribute supports only Interface Reference fields. (Or fields with a sub-"+typeof(SerializedProperty).Name+" with name target"); 65 | } 66 | } 67 | else 68 | { 69 | Debug.LogWarning("Serialized Property is not of Generic type."); 70 | } 71 | } 72 | } 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /Runtime/Attributes/Expose.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 722a876119e976c439f3c23d7d5492d2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Attributes/NotEditable.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | using System; 6 | using UnityEngine; 7 | 8 | #if UNITY_EDITOR 9 | using UnityEditor; 10 | #endif 11 | 12 | namespace CippSharp.Core.Interfaces 13 | { 14 | /// 15 | /// Generic attribute to make a property NotEditable in inspector. 16 | /// It doesn't work in inspector's debug view. 17 | /// 18 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] 19 | public class NotEditableAttribute : PropertyAttribute 20 | { 21 | 22 | } 23 | } 24 | 25 | #if UNITY_EDITOR 26 | namespace CippSharp.Core.Interfaces.Editor 27 | { 28 | /// 29 | /// Custom drawer of NotEditableAttribute. 30 | /// 31 | [CustomPropertyDrawer(typeof(NotEditableAttribute))] 32 | public class NotEditableDrawer : PropertyDrawer 33 | { 34 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 35 | { 36 | return EditorGUI.GetPropertyHeight(property, label, property.isExpanded && property.hasChildren); 37 | } 38 | 39 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 40 | { 41 | EditorGUIUtils.DrawNotEditableProperty(position, property, new GUIContent(property.displayName)); 42 | } 43 | } 44 | } 45 | #endif 46 | -------------------------------------------------------------------------------- /Runtime/Attributes/NotEditable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60266495de9809d4980b4acf0a686451 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Attributes/TypeFilter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | 6 | using System; 7 | #if UNITY_EDITOR 8 | using System.Linq; 9 | using UnityEditor; 10 | #endif 11 | using UnityEngine; 12 | #if UNITY_EDITOR 13 | using Object = UnityEngine.Object; 14 | #endif 15 | 16 | 17 | namespace CippSharp.Core.Interfaces 18 | { 19 | /// 20 | /// Generic attribute to make a property of Object type to filter types. 21 | /// 22 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)] 23 | public class TypeFilterAttribute : PropertyAttribute 24 | { 25 | public Type[] types; 26 | 27 | public TypeFilterAttribute(Type[] types) 28 | { 29 | this.types = types; 30 | } 31 | } 32 | } 33 | 34 | #if UNITY_EDITOR 35 | namespace CippSharp.Core.Interfaces.Editor 36 | { 37 | /// 38 | /// Custom drawer of TypeFilterAttribute. 39 | /// 40 | [CustomPropertyDrawer(typeof(TypeFilterAttribute))] 41 | public class TypeFilterAttributeDrawer : PropertyDrawer 42 | { 43 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 44 | { 45 | return EditorGUI.GetPropertyHeight(property, label, property.isExpanded && property.hasChildren); 46 | } 47 | 48 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 49 | { 50 | TypeFilterAttribute typeFilterAttribute = attribute as TypeFilterAttribute; 51 | if (property.propertyType == SerializedPropertyType.ObjectReference) 52 | { 53 | EditorGUIUtils.DrawProperty(position, property, label); 54 | 55 | if (typeFilterAttribute != null) 56 | { 57 | Type[] requiredTypes = typeFilterAttribute.types; 58 | 59 | #region Preliminary Check 60 | 61 | PreliminaryCheck(property, requiredTypes); 62 | 63 | #endregion 64 | 65 | #region Default Check 66 | 67 | DefaultCheck(property, requiredTypes); 68 | 69 | #endregion 70 | } 71 | else 72 | { 73 | Debug.LogError("Failed to assign the attribute."); 74 | } 75 | } 76 | else 77 | { 78 | Debug.LogWarning("Type Filter Attribute supports only Object Reference fields."); 79 | } 80 | } 81 | 82 | #region Preliminary Check 83 | 84 | /// 85 | /// For a comfy Drag n drop of a GameObject. 86 | /// It takes the first component that match with one of the required types. 87 | /// 88 | /// 89 | /// 90 | private void PreliminaryCheck(SerializedProperty property, Type[] requiredTypes) 91 | { 92 | Object target = property.objectReferenceValue; 93 | if (target == null) 94 | { 95 | return; 96 | } 97 | 98 | if (target is GameObject) 99 | { 100 | GameObject gameObject = (GameObject) target; 101 | Component comp = null; 102 | 103 | if (!IsNullOrEmpty(requiredTypes)) 104 | { 105 | foreach (var requiredType in requiredTypes) 106 | { 107 | if (requiredType == null) 108 | { 109 | continue; 110 | } 111 | 112 | comp = gameObject.GetComponent(requiredType); 113 | if (comp != null) 114 | { 115 | break; 116 | } 117 | } 118 | } 119 | 120 | if (comp != null) 121 | { 122 | property.objectReferenceValue = comp; 123 | } 124 | else 125 | { 126 | Debug.LogWarning("You must assign a GameObject that has at least one component of the required types that you have specified."); 127 | } 128 | } 129 | } 130 | 131 | #endregion 132 | 133 | #region Default Check 134 | 135 | /// 136 | /// Check if property object reference match with one of the required types otherwise set it to null. 137 | /// 138 | /// 139 | /// 140 | private void DefaultCheck(SerializedProperty property, Type[] requiredTypes) 141 | { 142 | Object target = property.objectReferenceValue; 143 | if (target == null) 144 | { 145 | return; 146 | } 147 | 148 | if (!IsNullOrEmpty(requiredTypes)) 149 | { 150 | Type objectType = target.GetType(); 151 | bool check = requiredTypes.Where(requiredType => requiredType != null).Any(requiredType => requiredType.IsAssignableFrom(objectType)); 152 | 153 | if (!check) 154 | { 155 | property.objectReferenceValue = null; 156 | } 157 | } 158 | } 159 | 160 | #endregion 161 | 162 | /// 163 | /// Retrieve if an array is null or empty. 164 | /// This method is also usually used as extension method for check arrays without re-writing the same condition many times. 165 | /// Here is just a static method 'cause I need it only here for now. 166 | /// 167 | /// 168 | /// 169 | /// 170 | private static bool IsNullOrEmpty(T[] array) 171 | { 172 | return array == null || array.Length < 1; 173 | } 174 | } 175 | } 176 | #endif -------------------------------------------------------------------------------- /Runtime/Attributes/TypeFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bcbd7b6f8633df418d73093ae167492 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/EditorGUIUtils.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | #if UNITY_EDITOR 6 | using UnityEngine; 7 | using UnityEditor; 8 | 9 | namespace CippSharp.Core.Interfaces.Editor 10 | { 11 | public static class EditorGUIUtils 12 | { 13 | /// 14 | /// It draws the property only if its different from null. 15 | /// 16 | /// 17 | /// 18 | /// 19 | public static void DrawProperty(Rect rect, SerializedProperty property, GUIContent label) 20 | { 21 | if (property != null) 22 | { 23 | EditorGUI.PropertyField(rect, property, label, property.hasChildren); 24 | } 25 | } 26 | 27 | /// 28 | /// It draws the property only if its different from null. 29 | /// 30 | /// 31 | /// 32 | /// 33 | public static void DrawNotEditableProperty(Rect rect, SerializedProperty property, GUIContent label) 34 | { 35 | bool guiEnabled = GUI.enabled; 36 | GUI.enabled = false; 37 | if (property != null) 38 | { 39 | EditorGUI.PropertyField(rect, property, label, property.hasChildren); 40 | } 41 | GUI.enabled = guiEnabled; 42 | } 43 | } 44 | } 45 | #endif 46 | -------------------------------------------------------------------------------- /Runtime/EditorGUIUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae886ca884ab7ff48a11cb53f4f6623f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/InterfaceReference.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | using System; 6 | using UnityEngine; 7 | using Object = UnityEngine.Object; 8 | 9 | namespace CippSharp.Core.Interfaces 10 | { 11 | /// 12 | /// Create a custom serializable class that inherit from this class to reference an interface of type I 13 | /// I must be an interface. 14 | /// Useful to hold reference to components/objects of type t; 15 | /// 16 | /// 17 | [Serializable] 18 | public abstract class InterfaceReference : ISerializationCallbackReceiver where I : class 19 | { 20 | private const string None = "None"; 21 | 22 | [SerializeField, NotEditable] private string name = null; 23 | 24 | /// 25 | /// Exposed field assignable from inspector 26 | /// 27 | [SerializeField] private Object target = null; 28 | 29 | /// 30 | /// The target. 31 | /// 32 | public Object Target 33 | { 34 | get { return target; } 35 | set 36 | { 37 | SetTarget(value); 38 | SetName(target); 39 | } 40 | } 41 | 42 | private void SetTarget(Object value) 43 | { 44 | if (value == null) 45 | { 46 | target = null; 47 | return; 48 | } 49 | 50 | if (value is I) 51 | { 52 | target = value; 53 | } 54 | else 55 | { 56 | target = null; 57 | Debug.LogWarning(string.Format("You should set an Object that implements {0}.", typeof(I).FullName)); 58 | } 59 | } 60 | 61 | private void SetName(Object obj) 62 | { 63 | name = obj != null ? string.Format("{0} ({1})", obj.name, typeof(I).Name) : None; 64 | } 65 | 66 | 67 | /// 68 | /// The interface. 69 | /// 70 | public I Interface 71 | { 72 | get 73 | { 74 | return Target != null ? (I)(object)Target : null; 75 | } 76 | } 77 | 78 | #region ISerializationCallbackReceiver Implementation 79 | 80 | public void OnBeforeSerialize() 81 | { 82 | CheckTarget(); 83 | SetName(Target); 84 | } 85 | 86 | private void CheckTarget() 87 | { 88 | if (Target == null) 89 | { 90 | return; 91 | } 92 | 93 | //For a comfy Drag n drop of a GameObject 94 | if (Target is GameObject) 95 | { 96 | GameObject gameObject = (GameObject) target; 97 | Target = gameObject.GetComponent(typeof(I)); 98 | 99 | if (Target == null) 100 | { 101 | Debug.LogWarning(string.Format("You must assign a gameObject that have at least one component of type {0}.", typeof(I).FullName)); 102 | return; 103 | } 104 | } 105 | 106 | if (!(Target is I)) 107 | { 108 | //skip assignment by property during edit mode. 109 | target = null; 110 | Debug.LogWarning(string.Format("You must assign an Object that implements {0}.", typeof(I).FullName)); 111 | } 112 | } 113 | 114 | public void OnAfterDeserialize() 115 | { 116 | 117 | } 118 | 119 | #endregion 120 | 121 | #region Operators 122 | 123 | public static implicit operator I(InterfaceReference interfaceReference) 124 | { 125 | return interfaceReference.Interface; 126 | } 127 | 128 | #endregion 129 | 130 | public override string ToString() 131 | { 132 | return typeof(InterfaceReference).Name + " " + name; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Runtime/InterfaceReference.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80cee91214c5d1e40af1317b3952002b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/com.CippSharpCore.Interfaces.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.CippSharpCore.Interfaces" 3 | } 4 | -------------------------------------------------------------------------------- /Runtime/com.CippSharpCore.Interfaces.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f59bdebc7b435ab4981d4cf8dcbc1eca 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ea844be7c03a2e4c949a31557aa249a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 403d5c5407928784ba84aa8a029f4b3b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples/Runtime/ComponentImplementingCustomInterface.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | #if UNITY_EDITOR 6 | using UnityEngine; 7 | 8 | namespace CippSharp.Core.Interfaces.Samples 9 | { 10 | public class ComponentImplementingCustomInterface : MonoBehaviour, ICustomInterfaceExample 11 | { 12 | 13 | } 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /Samples/Runtime/ComponentImplementingCustomInterface.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccd30b2131b8f914f8d4673f35bc40a7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Samples/Runtime/ComponentWithReference.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | #if UNITY_EDITOR 6 | using System; 7 | using UnityEngine; 8 | 9 | namespace CippSharp.Core.Interfaces.Samples 10 | { 11 | public class ComponentWithReference : MonoBehaviour 12 | { 13 | [Serializable] 14 | public class CustomInterfaceReference : InterfaceReference 15 | { 16 | 17 | } 18 | 19 | [Header("Interface:")] 20 | public CustomInterfaceReference customInterfaceReference = new CustomInterfaceReference(); 21 | } 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /Samples/Runtime/ComponentWithReference.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f878579644bfbf44bc89b57fe513139 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Samples/Runtime/ExposedInterfaceReference.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | #if UNITY_EDITOR 6 | using System; 7 | using UnityEngine; 8 | 9 | namespace CippSharp.Core.Interfaces.Samples 10 | { 11 | public class ExposedInterfaceReference : MonoBehaviour 12 | { 13 | [Serializable] 14 | public class CustomInterfaceReference : InterfaceReference 15 | { 16 | 17 | } 18 | 19 | 20 | [Header("Interface:")] 21 | [Expose] public CustomInterfaceReference customInterfaceReference = new CustomInterfaceReference(); 22 | 23 | } 24 | } 25 | #endif -------------------------------------------------------------------------------- /Samples/Runtime/ExposedInterfaceReference.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d7b9862a7a50ed478a95fe23ae1a3c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Samples/Runtime/ICustomInterfaceExample.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | 5 | #if UNITY_EDITOR 6 | namespace CippSharp.Core.Interfaces.Samples 7 | { 8 | public interface ICustomInterfaceExample 9 | { 10 | 11 | } 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /Samples/Runtime/ICustomInterfaceExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9f8a9a5460340a409aa02b89852f0bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Samples/Runtime/INFOS.txt: -------------------------------------------------------------------------------- 1 | "when we're building, we don't need these!" 2 | So Samples are #if#deffed with UNITY_EDITOR -------------------------------------------------------------------------------- /Samples/Runtime/INFOS.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7023c295aba73c94ba2f226844b58374 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples/Runtime/TypeFilterReference.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Alessandro Salani (Cippman) 3 | */ 4 | #if UNITY_EDITOR 5 | using UnityEngine; 6 | 7 | namespace CippSharp.Core.Interfaces.Samples 8 | { 9 | public class TypeFilterReference : MonoBehaviour 10 | { 11 | [TypeFilter(new [] {typeof(ICustomInterfaceExample)})] 12 | public Object reference = null; 13 | 14 | #pragma warning disable 414 15 | private ICustomInterfaceExample interfaceExample = null; 16 | #pragma warning restore 414 17 | 18 | private void Awake() 19 | { 20 | interfaceExample = reference != null ? (ICustomInterfaceExample)reference : null; 21 | } 22 | } 23 | } 24 | #endif -------------------------------------------------------------------------------- /Samples/Runtime/TypeFilterReference.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8fba42a6d4b7944ab5b95ba8b0fff1c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Samples/Runtime/com.CippSharpCore.Interfaces.Samples.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.CippSharpCore.Interfaces.Samples", 3 | "references": [ 4 | "GUID:f59bdebc7b435ab4981d4cf8dcbc1eca" 5 | ], 6 | "includePlatforms": [], 7 | "excludePlatforms": [], 8 | "allowUnsafeCode": false, 9 | "overrideReferences": false, 10 | "precompiledReferences": [], 11 | "autoReferenced": false, 12 | "defineConstraints": [], 13 | "versionDefines": [], 14 | "noEngineReferences": false 15 | } -------------------------------------------------------------------------------- /Samples/Runtime/com.CippSharpCore.Interfaces.Samples.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca61a90ce630b9146a8b8f9a074814a9 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d85e54fe7e626354481511608c8413c6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples/Scenes/Examples.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 0 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 1 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 500 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &122467412 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 122467413} 124 | m_Layer: 0 125 | m_Name: '--------------------------' 126 | m_TagString: Untagged 127 | m_Icon: {fileID: 0} 128 | m_NavMeshLayer: 0 129 | m_StaticEditorFlags: 0 130 | m_IsActive: 1 131 | --- !u!4 &122467413 132 | Transform: 133 | m_ObjectHideFlags: 0 134 | m_CorrespondingSourceObject: {fileID: 0} 135 | m_PrefabInstance: {fileID: 0} 136 | m_PrefabAsset: {fileID: 0} 137 | m_GameObject: {fileID: 122467412} 138 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 139 | m_LocalPosition: {x: 0, y: 0, z: 0} 140 | m_LocalScale: {x: 1, y: 1, z: 1} 141 | m_Children: [] 142 | m_Father: {fileID: 0} 143 | m_RootOrder: 9 144 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 145 | --- !u!1 &257792216 146 | GameObject: 147 | m_ObjectHideFlags: 0 148 | m_CorrespondingSourceObject: {fileID: 0} 149 | m_PrefabInstance: {fileID: 0} 150 | m_PrefabAsset: {fileID: 0} 151 | serializedVersion: 6 152 | m_Component: 153 | - component: {fileID: 257792219} 154 | - component: {fileID: 257792218} 155 | - component: {fileID: 257792217} 156 | m_Layer: 0 157 | m_Name: Main Camera 158 | m_TagString: MainCamera 159 | m_Icon: {fileID: 0} 160 | m_NavMeshLayer: 0 161 | m_StaticEditorFlags: 0 162 | m_IsActive: 1 163 | --- !u!81 &257792217 164 | AudioListener: 165 | m_ObjectHideFlags: 0 166 | m_CorrespondingSourceObject: {fileID: 0} 167 | m_PrefabInstance: {fileID: 0} 168 | m_PrefabAsset: {fileID: 0} 169 | m_GameObject: {fileID: 257792216} 170 | m_Enabled: 1 171 | --- !u!20 &257792218 172 | Camera: 173 | m_ObjectHideFlags: 0 174 | m_CorrespondingSourceObject: {fileID: 0} 175 | m_PrefabInstance: {fileID: 0} 176 | m_PrefabAsset: {fileID: 0} 177 | m_GameObject: {fileID: 257792216} 178 | m_Enabled: 1 179 | serializedVersion: 2 180 | m_ClearFlags: 1 181 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 182 | m_projectionMatrixMode: 1 183 | m_SensorSize: {x: 36, y: 24} 184 | m_LensShift: {x: 0, y: 0} 185 | m_GateFitMode: 2 186 | m_FocalLength: 50 187 | m_NormalizedViewPortRect: 188 | serializedVersion: 2 189 | x: 0 190 | y: 0 191 | width: 1 192 | height: 1 193 | near clip plane: 0.3 194 | far clip plane: 1000 195 | field of view: 60 196 | orthographic: 1 197 | orthographic size: 5 198 | m_Depth: -1 199 | m_CullingMask: 200 | serializedVersion: 2 201 | m_Bits: 4294967295 202 | m_RenderingPath: -1 203 | m_TargetTexture: {fileID: 0} 204 | m_TargetDisplay: 0 205 | m_TargetEye: 3 206 | m_HDR: 1 207 | m_AllowMSAA: 1 208 | m_AllowDynamicResolution: 0 209 | m_ForceIntoRT: 0 210 | m_OcclusionCulling: 1 211 | m_StereoConvergence: 10 212 | m_StereoSeparation: 0.022 213 | --- !u!4 &257792219 214 | Transform: 215 | m_ObjectHideFlags: 0 216 | m_CorrespondingSourceObject: {fileID: 0} 217 | m_PrefabInstance: {fileID: 0} 218 | m_PrefabAsset: {fileID: 0} 219 | m_GameObject: {fileID: 257792216} 220 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 221 | m_LocalPosition: {x: 0, y: 0, z: -10} 222 | m_LocalScale: {x: 1, y: 1, z: 1} 223 | m_Children: [] 224 | m_Father: {fileID: 0} 225 | m_RootOrder: 0 226 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 227 | --- !u!1 &358149321 228 | GameObject: 229 | m_ObjectHideFlags: 0 230 | m_CorrespondingSourceObject: {fileID: 0} 231 | m_PrefabInstance: {fileID: 0} 232 | m_PrefabAsset: {fileID: 0} 233 | serializedVersion: 6 234 | m_Component: 235 | - component: {fileID: 358149322} 236 | m_Layer: 0 237 | m_Name: '--------------------------' 238 | m_TagString: Untagged 239 | m_Icon: {fileID: 0} 240 | m_NavMeshLayer: 0 241 | m_StaticEditorFlags: 0 242 | m_IsActive: 1 243 | --- !u!4 &358149322 244 | Transform: 245 | m_ObjectHideFlags: 0 246 | m_CorrespondingSourceObject: {fileID: 0} 247 | m_PrefabInstance: {fileID: 0} 248 | m_PrefabAsset: {fileID: 0} 249 | m_GameObject: {fileID: 358149321} 250 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 251 | m_LocalPosition: {x: 0, y: 0, z: 0} 252 | m_LocalScale: {x: 1, y: 1, z: 1} 253 | m_Children: [] 254 | m_Father: {fileID: 0} 255 | m_RootOrder: 1 256 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 257 | --- !u!1 &506120582 258 | GameObject: 259 | m_ObjectHideFlags: 0 260 | m_CorrespondingSourceObject: {fileID: 0} 261 | m_PrefabInstance: {fileID: 0} 262 | m_PrefabAsset: {fileID: 0} 263 | serializedVersion: 6 264 | m_Component: 265 | - component: {fileID: 506120583} 266 | m_Layer: 0 267 | m_Name: '--------------------------' 268 | m_TagString: Untagged 269 | m_Icon: {fileID: 0} 270 | m_NavMeshLayer: 0 271 | m_StaticEditorFlags: 0 272 | m_IsActive: 1 273 | --- !u!4 &506120583 274 | Transform: 275 | m_ObjectHideFlags: 0 276 | m_CorrespondingSourceObject: {fileID: 0} 277 | m_PrefabInstance: {fileID: 0} 278 | m_PrefabAsset: {fileID: 0} 279 | m_GameObject: {fileID: 506120582} 280 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 281 | m_LocalPosition: {x: 0, y: 0, z: 0} 282 | m_LocalScale: {x: 1, y: 1, z: 1} 283 | m_Children: [] 284 | m_Father: {fileID: 0} 285 | m_RootOrder: 4 286 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 287 | --- !u!1 &793930333 288 | GameObject: 289 | m_ObjectHideFlags: 0 290 | m_CorrespondingSourceObject: {fileID: 0} 291 | m_PrefabInstance: {fileID: 0} 292 | m_PrefabAsset: {fileID: 0} 293 | serializedVersion: 6 294 | m_Component: 295 | - component: {fileID: 793930335} 296 | - component: {fileID: 793930334} 297 | m_Layer: 0 298 | m_Name: Component with Type Filter Attribute 299 | m_TagString: Untagged 300 | m_Icon: {fileID: 0} 301 | m_NavMeshLayer: 0 302 | m_StaticEditorFlags: 0 303 | m_IsActive: 1 304 | --- !u!114 &793930334 305 | MonoBehaviour: 306 | m_ObjectHideFlags: 0 307 | m_CorrespondingSourceObject: {fileID: 0} 308 | m_PrefabInstance: {fileID: 0} 309 | m_PrefabAsset: {fileID: 0} 310 | m_GameObject: {fileID: 793930333} 311 | m_Enabled: 1 312 | m_EditorHideFlags: 0 313 | m_Script: {fileID: 11500000, guid: b8fba42a6d4b7944ab5b95ba8b0fff1c, type: 3} 314 | m_Name: 315 | m_EditorClassIdentifier: 316 | reference: {fileID: 1308923936} 317 | --- !u!4 &793930335 318 | Transform: 319 | m_ObjectHideFlags: 0 320 | m_CorrespondingSourceObject: {fileID: 0} 321 | m_PrefabInstance: {fileID: 0} 322 | m_PrefabAsset: {fileID: 0} 323 | m_GameObject: {fileID: 793930333} 324 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 325 | m_LocalPosition: {x: 0, y: 0, z: 0} 326 | m_LocalScale: {x: 1, y: 1, z: 1} 327 | m_Children: [] 328 | m_Father: {fileID: 0} 329 | m_RootOrder: 6 330 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 331 | --- !u!1 &908261137 332 | GameObject: 333 | m_ObjectHideFlags: 0 334 | m_CorrespondingSourceObject: {fileID: 0} 335 | m_PrefabInstance: {fileID: 0} 336 | m_PrefabAsset: {fileID: 0} 337 | serializedVersion: 6 338 | m_Component: 339 | - component: {fileID: 908261138} 340 | - component: {fileID: 908261139} 341 | m_Layer: 0 342 | m_Name: Component that has Interface Reference 343 | m_TagString: Untagged 344 | m_Icon: {fileID: 0} 345 | m_NavMeshLayer: 0 346 | m_StaticEditorFlags: 0 347 | m_IsActive: 1 348 | --- !u!4 &908261138 349 | Transform: 350 | m_ObjectHideFlags: 0 351 | m_CorrespondingSourceObject: {fileID: 0} 352 | m_PrefabInstance: {fileID: 0} 353 | m_PrefabAsset: {fileID: 0} 354 | m_GameObject: {fileID: 908261137} 355 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 356 | m_LocalPosition: {x: 0, y: 0, z: 0} 357 | m_LocalScale: {x: 1, y: 1, z: 1} 358 | m_Children: [] 359 | m_Father: {fileID: 0} 360 | m_RootOrder: 3 361 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 362 | --- !u!114 &908261139 363 | MonoBehaviour: 364 | m_ObjectHideFlags: 0 365 | m_CorrespondingSourceObject: {fileID: 0} 366 | m_PrefabInstance: {fileID: 0} 367 | m_PrefabAsset: {fileID: 0} 368 | m_GameObject: {fileID: 908261137} 369 | m_Enabled: 1 370 | m_EditorHideFlags: 0 371 | m_Script: {fileID: 11500000, guid: 7f878579644bfbf44bc89b57fe513139, type: 3} 372 | m_Name: 373 | m_EditorClassIdentifier: 374 | customInterfaceReference: 375 | name: Component that Implements Interface (ICustomInterfaceExample) 376 | target: {fileID: 1308923936} 377 | --- !u!1 &1007650329 378 | GameObject: 379 | m_ObjectHideFlags: 19 380 | m_CorrespondingSourceObject: {fileID: 0} 381 | m_PrefabInstance: {fileID: 0} 382 | m_PrefabAsset: {fileID: 0} 383 | serializedVersion: 6 384 | m_Component: 385 | - component: {fileID: 1007650331} 386 | - component: {fileID: 1007650330} 387 | m_Layer: 0 388 | m_Name: DescriptionHelperObject 389 | m_TagString: Untagged 390 | m_Icon: {fileID: 0} 391 | m_NavMeshLayer: 0 392 | m_StaticEditorFlags: 0 393 | m_IsActive: 1 394 | --- !u!114 &1007650330 395 | MonoBehaviour: 396 | m_ObjectHideFlags: 19 397 | m_CorrespondingSourceObject: {fileID: 0} 398 | m_PrefabInstance: {fileID: 0} 399 | m_PrefabAsset: {fileID: 0} 400 | m_GameObject: {fileID: 1007650329} 401 | m_Enabled: 1 402 | m_EditorHideFlags: 0 403 | m_Script: {fileID: 11500000, guid: b2456740db25f46459a541a36ec8878a, type: 3} 404 | m_Name: 405 | m_EditorClassIdentifier: 406 | Hash1: [] 407 | Hash1_Fix2_0: [] 408 | Hash2: [] 409 | Hash3: 410 | - FavParams: 0 411 | FavString: [] 412 | list: 413 | - {fileID: 1968288553} 414 | ActiveGameObject: {fileID: 1968288553} 415 | GUIDsList: [] 416 | GUIDsActiveGameObject: 417 | PATHsList: [] 418 | PATHsActiveGameObject: 419 | InstanceID: 0 420 | wasInit: 0 421 | CashedBool: 0 422 | - FavParams: 0 423 | FavString: [] 424 | list: 425 | - {fileID: 793930333} 426 | ActiveGameObject: {fileID: 793930333} 427 | GUIDsList: [] 428 | GUIDsActiveGameObject: 429 | PATHsList: [] 430 | PATHsActiveGameObject: 431 | InstanceID: 0 432 | wasInit: 0 433 | CashedBool: 0 434 | - FavParams: 0 435 | FavString: [] 436 | list: 437 | - {fileID: 122467412} 438 | ActiveGameObject: {fileID: 122467412} 439 | GUIDsList: [] 440 | GUIDsActiveGameObject: 441 | PATHsList: [] 442 | PATHsActiveGameObject: 443 | InstanceID: 0 444 | wasInit: 0 445 | CashedBool: 0 446 | - FavParams: 0 447 | FavString: [] 448 | list: 449 | - {fileID: 1824733537} 450 | ActiveGameObject: {fileID: 1824733537} 451 | GUIDsList: [] 452 | GUIDsActiveGameObject: 453 | PATHsList: [] 454 | PATHsActiveGameObject: 455 | InstanceID: 0 456 | wasInit: 0 457 | CashedBool: 0 458 | - FavParams: 0 459 | FavString: [] 460 | list: 461 | - {fileID: 506120582} 462 | ActiveGameObject: {fileID: 506120582} 463 | GUIDsList: [] 464 | GUIDsActiveGameObject: 465 | PATHsList: [] 466 | PATHsActiveGameObject: 467 | InstanceID: 0 468 | wasInit: 0 469 | CashedBool: 0 470 | - FavParams: 0 471 | FavString: [] 472 | list: 473 | - {fileID: 1308923934} 474 | ActiveGameObject: {fileID: 1308923934} 475 | GUIDsList: [] 476 | GUIDsActiveGameObject: 477 | PATHsList: [] 478 | PATHsActiveGameObject: 479 | InstanceID: 0 480 | wasInit: 0 481 | CashedBool: 0 482 | - FavParams: 0 483 | FavString: [] 484 | list: 485 | - {fileID: 358149321} 486 | ActiveGameObject: {fileID: 358149321} 487 | GUIDsList: [] 488 | GUIDsActiveGameObject: 489 | PATHsList: [] 490 | PATHsActiveGameObject: 491 | InstanceID: 0 492 | wasInit: 0 493 | CashedBool: 0 494 | - FavParams: 0 495 | FavString: [] 496 | list: 497 | - {fileID: 908261137} 498 | ActiveGameObject: {fileID: 908261137} 499 | GUIDsList: [] 500 | GUIDsActiveGameObject: 501 | PATHsList: [] 502 | PATHsActiveGameObject: 503 | InstanceID: 0 504 | wasInit: 0 505 | CashedBool: 0 506 | Hash4: [] 507 | Hash5: [] 508 | Hash5_Fix2_0: [] 509 | Hash6: [] 510 | Hash7: [] 511 | Hash7_Fix2_0: [] 512 | Hash8: [] 513 | Hash9: [] 514 | Hash10: [] 515 | _enableRegistrator: 0 516 | _saveInFolder: SCENE 517 | Hash_HierarchyCache: [] 518 | Hash_BookMarks: 519 | - ColorValue_R: 0.18431373 520 | ColorValue_G: 0.29411766 521 | ColorValue_B: 0.44705883 522 | ColorValue_A: 0.18431373 523 | SKIP_COLOR: 0 524 | NO_EXPAND_ITEMS: 0 525 | name: Default 526 | array: [] 527 | FavParams: 0 528 | InstanceID: -1509717018 529 | Hierarchy_ScrollY: 0 530 | Window_ScrollY: 0 531 | ColabsedItems: 532 | Windows_ColabsedItems: 533 | _mFavoritCategorySelected: 0 534 | m_GetHash_IconImageKey: [] 535 | m_GetHash_IconImageValue: [] 536 | --- !u!4 &1007650331 537 | Transform: 538 | m_ObjectHideFlags: 19 539 | m_CorrespondingSourceObject: {fileID: 0} 540 | m_PrefabInstance: {fileID: 0} 541 | m_PrefabAsset: {fileID: 0} 542 | m_GameObject: {fileID: 1007650329} 543 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 544 | m_LocalPosition: {x: 0, y: 0, z: 0} 545 | m_LocalScale: {x: 1, y: 1, z: 1} 546 | m_Children: [] 547 | m_Father: {fileID: 0} 548 | m_RootOrder: 5 549 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 550 | --- !u!1 &1308923934 551 | GameObject: 552 | m_ObjectHideFlags: 0 553 | m_CorrespondingSourceObject: {fileID: 0} 554 | m_PrefabInstance: {fileID: 0} 555 | m_PrefabAsset: {fileID: 0} 556 | serializedVersion: 6 557 | m_Component: 558 | - component: {fileID: 1308923935} 559 | - component: {fileID: 1308923936} 560 | m_Layer: 0 561 | m_Name: Component that Implements Interface 562 | m_TagString: Untagged 563 | m_Icon: {fileID: 0} 564 | m_NavMeshLayer: 0 565 | m_StaticEditorFlags: 0 566 | m_IsActive: 1 567 | --- !u!4 &1308923935 568 | Transform: 569 | m_ObjectHideFlags: 0 570 | m_CorrespondingSourceObject: {fileID: 0} 571 | m_PrefabInstance: {fileID: 0} 572 | m_PrefabAsset: {fileID: 0} 573 | m_GameObject: {fileID: 1308923934} 574 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 575 | m_LocalPosition: {x: 0, y: 0, z: 0} 576 | m_LocalScale: {x: 1, y: 1, z: 1} 577 | m_Children: [] 578 | m_Father: {fileID: 0} 579 | m_RootOrder: 2 580 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 581 | --- !u!114 &1308923936 582 | MonoBehaviour: 583 | m_ObjectHideFlags: 0 584 | m_CorrespondingSourceObject: {fileID: 0} 585 | m_PrefabInstance: {fileID: 0} 586 | m_PrefabAsset: {fileID: 0} 587 | m_GameObject: {fileID: 1308923934} 588 | m_Enabled: 1 589 | m_EditorHideFlags: 0 590 | m_Script: {fileID: 11500000, guid: ccd30b2131b8f914f8d4673f35bc40a7, type: 3} 591 | m_Name: 592 | m_EditorClassIdentifier: 593 | --- !u!1 &1824733537 594 | GameObject: 595 | m_ObjectHideFlags: 0 596 | m_CorrespondingSourceObject: {fileID: 0} 597 | m_PrefabInstance: {fileID: 0} 598 | m_PrefabAsset: {fileID: 0} 599 | serializedVersion: 6 600 | m_Component: 601 | - component: {fileID: 1824733538} 602 | m_Layer: 0 603 | m_Name: '--------------------------' 604 | m_TagString: Untagged 605 | m_Icon: {fileID: 0} 606 | m_NavMeshLayer: 0 607 | m_StaticEditorFlags: 0 608 | m_IsActive: 1 609 | --- !u!4 &1824733538 610 | Transform: 611 | m_ObjectHideFlags: 0 612 | m_CorrespondingSourceObject: {fileID: 0} 613 | m_PrefabInstance: {fileID: 0} 614 | m_PrefabAsset: {fileID: 0} 615 | m_GameObject: {fileID: 1824733537} 616 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 617 | m_LocalPosition: {x: 0, y: 0, z: 0} 618 | m_LocalScale: {x: 1, y: 1, z: 1} 619 | m_Children: [] 620 | m_Father: {fileID: 0} 621 | m_RootOrder: 7 622 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 623 | --- !u!1 &1968288553 624 | GameObject: 625 | m_ObjectHideFlags: 0 626 | m_CorrespondingSourceObject: {fileID: 0} 627 | m_PrefabInstance: {fileID: 0} 628 | m_PrefabAsset: {fileID: 0} 629 | serializedVersion: 6 630 | m_Component: 631 | - component: {fileID: 1968288555} 632 | - component: {fileID: 1968288554} 633 | m_Layer: 0 634 | m_Name: Component with Expose Attribute 635 | m_TagString: Untagged 636 | m_Icon: {fileID: 0} 637 | m_NavMeshLayer: 0 638 | m_StaticEditorFlags: 0 639 | m_IsActive: 1 640 | --- !u!114 &1968288554 641 | MonoBehaviour: 642 | m_ObjectHideFlags: 0 643 | m_CorrespondingSourceObject: {fileID: 0} 644 | m_PrefabInstance: {fileID: 0} 645 | m_PrefabAsset: {fileID: 0} 646 | m_GameObject: {fileID: 1968288553} 647 | m_Enabled: 1 648 | m_EditorHideFlags: 0 649 | m_Script: {fileID: 11500000, guid: 5d7b9862a7a50ed478a95fe23ae1a3c7, type: 3} 650 | m_Name: 651 | m_EditorClassIdentifier: 652 | customInterfaceReference: 653 | name: Component that Implements Interface (ICustomInterfaceExample) 654 | target: {fileID: 1308923936} 655 | --- !u!4 &1968288555 656 | Transform: 657 | m_ObjectHideFlags: 0 658 | m_CorrespondingSourceObject: {fileID: 0} 659 | m_PrefabInstance: {fileID: 0} 660 | m_PrefabAsset: {fileID: 0} 661 | m_GameObject: {fileID: 1968288553} 662 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 663 | m_LocalPosition: {x: 0, y: 0, z: 0} 664 | m_LocalScale: {x: 1, y: 1, z: 1} 665 | m_Children: [] 666 | m_Father: {fileID: 0} 667 | m_RootOrder: 8 668 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 669 | -------------------------------------------------------------------------------- /Samples/Scenes/Examples.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc7f0b44553575944b2d2ab2c848cb5d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples/Screenshots.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 636a19ce35991864683f9d63855e7506 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples/Screenshots/TwoInspectors.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cippman/Unity-InterfaceReference/2cc2cd42ab75eed8c16bcfd14ba6679a3bf1c0af/Samples/Screenshots/TwoInspectors.PNG -------------------------------------------------------------------------------- /Samples/Screenshots/TwoInspectors.PNG.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f6f983808a669f43a094df280dfb2dc 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 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: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 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: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 1 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 512 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 2 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | - serializedVersion: 3 75 | buildTarget: Standalone 76 | maxTextureSize: 512 77 | resizeAlgorithm: 0 78 | textureFormat: -1 79 | textureCompression: 2 80 | compressionQuality: 50 81 | crunchedCompression: 0 82 | allowsAlphaSplitting: 0 83 | overridden: 0 84 | androidETC2FallbackOverride: 0 85 | forceMaximumCompressionQuality_BC6H_BC7: 1 86 | - serializedVersion: 3 87 | buildTarget: Android 88 | maxTextureSize: 512 89 | resizeAlgorithm: 0 90 | textureFormat: -1 91 | textureCompression: 2 92 | compressionQuality: 50 93 | crunchedCompression: 0 94 | allowsAlphaSplitting: 0 95 | overridden: 0 96 | androidETC2FallbackOverride: 0 97 | forceMaximumCompressionQuality_BC6H_BC7: 1 98 | spriteSheet: 99 | serializedVersion: 2 100 | sprites: [] 101 | outline: [] 102 | physicsShape: [] 103 | bones: [] 104 | spriteID: 3e0567aeeef73b64b8a8e0d0792ae373 105 | internalID: 0 106 | vertices: [] 107 | indices: 108 | edges: [] 109 | weights: [] 110 | secondaryTextures: [] 111 | spritePackingTag: 112 | pSDRemoveMatte: 0 113 | pSDShowRemoveMatteOption: 0 114 | userData: 115 | assetBundleName: 116 | assetBundleVariant: 117 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.cippsharpcore.interfaces", 3 | "version": "1.0.6", 4 | "displayName": "CippSharp.Interfaces", 5 | "description": "Create your custom serializable class that holds the reference to an UnityEngine.Object that implements an interface I.", 6 | "unity":"2019.4", 7 | "unityRelease":"10f1", 8 | "keywords": [ 9 | "cippsharp", 10 | "interface", 11 | "reference" 12 | ], 13 | "license": "MIT", 14 | "author" : { 15 | "name" : "Alessandro Salani (Cippman)", 16 | "url" : "https://github.com/Cippman/Unity-InterfaceReference.git" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f92b97ff715f25e4a9a918c8799bb13b 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------