Category : 06. Attributes

Attribute that can be used to make class member that follows the attribute be shown as disabled (read-only) when a predicate statement is true. DisableIf(string classMemberName, object requiredValue) When this constructor is used, the target is disabled if the class member with the given name has the specified value. DisableIf(string classMemberName, Is comparison, object requiredValue) ..

Read more

When added before a class member causes a help box to be shown above the control of the class member it in the inspector. It is also possible to only show the help box when a specified predicate is true. Attribute Target Field, property, method or indexer. Example using UnityEngine; using Sisus.Attributes; public class HelpPuzzleBox ..

Read more

Attribute that can be used to make class member that follows the attribute only be shown in the inspector when a predicate statement is true. ShowIf(string classMemberName, object requiredValue) When this constructor is used, the target is only shown if the class member with the given name has the specified value. ShowIf(string classMemberName, Is comparison, ..

Read more

Interface for attributes that can be added to component classes to receive callbacks when components of a certain type are added or modified through the inspector. OnComponentAdded is called whenever a new component of type TComponent is added to the GameObject that contains the component with this attribute. OnComponentModified is called whenever an existing component ..

Read more

When added before a component class will make sure that whenever the component with the attribute is added to GameObjects, a collider will also be present on the same GameObject. In addition makes sure that the isTrigger property of the collider will match your desired value (default: True). Attribute Target Component class Example using System; ..

Read more

When added before a component class will make sure that whenever the component with the attribute is added to GameObjects, a 2D collider will also be present on the same GameObject. Attribute Target Component class   See also: Requi..

Read more

When added before a component class will make sure that whenever the component with the attribute is added to GameObjects, a collider will also be present on the same GameObject. Attribute Target Component class Example using UnityEngine; using Sisus.Attributes; using JetBrains.Annotations; [RequireCollider, RequireComponent(typeof(Rigidbody)), DisallowMultipleComponent] public class CollisionSoundEmitter : MonoBehaviour { [NotNull] public AudioClip audioClip; [Range(0f, ..

Read more

When added before a component class will make sure that whenever the component with the attribute is added to GameObjects, all components matching the specified types are also present on the same GameObject. Attribute Target Component class Example using System; using UnityEngine; using Sisus.Attributes; [RequireComponents(typeof(Camera), typeof(AudioListener)), DisallowMultipleComponent] public class MainCamera : MonoBehaviour { public static ..

Read more

When added before a method causes the method to be shown inside the inspector view as a button. By default the button is shown expanded to the full width of the inspector view with no prefix label, and with the button text auto-generated from the method name. You can customize the button text by using the ..

Read more

A base class for attributes that enables them to specify whether they target a collection or the members of the collection, when the attribute is added before a collection class member. Implements the ITargetableAttribute interface. Attribute Target Field, property, indexer, method return value or method parameter. Example using System; namespace Sisus.Attributes { /// <summary> /// ..

Read more