docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CinemachineTool

    This is a generic Tool class for Cinemachine tools. To create a new tool, inherit from CinemachineTool and implement GetIcon(). Your new tool will need to have the [EditorTool("tool-name", typeof(CinemachineVirtualCameraBase))] attribute.

    A tool will be drawn iff it has been registered using CinemachineSceneToolUtility.RegisterTool. This is generally done in the OnEnable function of the editor script of the cinemachine component (CinemachineVirtualCamera, CinemachineComponentBase), for which the tool was meant. To unregister, call CinemachineSceneToolUtility.UnregisterTool in the same script's OnDisable function.

    To draw the handles related to the tool, you need to implement your drawing function and call it in the editor script's OnSceneGUI function. An alternative for drawing handles is to override this function's OnToolGUI or OnDrawHandles functions (see EditorTool or IDrawSelectedHandles docs for more information).

    To check, if a tool has been enabled/disabled in the editor script, use CinemachineSceneToolUtility.IsToolActive.

    Inheritance
    object
    Object
    ScriptableObject
    EditorTool
    CinemachineTool
    Implements
    IDrawSelectedHandles
    Inherited Members
    EditorTool.OnToolGUI(EditorWindow)
    EditorTool.targets
    EditorTool.target
    EditorTool.gridSnapEnabled
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Cinemachine.Editor
    Assembly: solution.dll
    Syntax
    public abstract class CinemachineTool : EditorTool, IDrawSelectedHandles

    Properties

    Name Description
    toolbarIcon

    This lets the editor find the icon of the tool.

    Methods

    Name Description
    GetIcon()

    Implement this to set your Tool's icon and tooltip.

    IsAvailable()

    This checks whether this tool should be displayed or not.

    OnActivated()

    This is called when the Tool is selected in the editor.

    OnDrawHandles()

    Implement IDrawSelectedHandles to draw gizmos for this tool even if it is not the active tool.

    OnWillBeDeactivated()

    This is called when the Tool is deselected in the editor.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)