Skip to content
Strée Eloi edited this page Oct 16, 2018 · 34 revisions

Le développement d’outils visuels pour faciliter le travail des artistes et designers

-Look for: How to edit Unity Editor
-Manuel

Overview

Useful Class

  • Debug.DrawRay()
  • Debug.DrawLine()
  • Camera.Viewport

UnityEvent

Attributes

Manuel Unity- Script Info - Unity Learn video - Manuel C#

Connaissez-vous ..

  • ..*AddComponentMenu ? M
  • ..AssemblyIsEditorAssembly ? M
  • ..ColorUsageAttribute ? M, V:Demo
  • ..*ContextMenu ? M
  • ..ContextMenuItemAttribute ? M
  • ..CreateAssetMenuAttribute ? M
  • ..DelayedAttribute ? M
  • ..DisallowMultipleComponent ? M
  • ..*ExecuteInEditMode ? M
  • ..GUITargetAttribute ? M
  • ..*HeaderAttribute ? M
  • ..*HelpURLAttribute ? M
  • ..*HideInInspector ? M
  • ..ImageEffectAllowedInSceneView ? M
  • ..ImageEffectOpaque ? M
  • ..ImageEffectTransformsToLDR ? M
  • ..*MultilineAttribute ? M
  • ..PreferBinarySerialization ? M
  • ..PropertyAttribute ? M
  • ..*RangeAttribute ? M
  • ..*RequireComponent ? M
  • ..RuntimeInitializeOnLoadMethodAttribute ? M
  • ..SelectionBaseAttribute ? M
  • ..*SerializeField ? M
  • ..SharedBetweenAnimatorsAttribute ? M
  • ..*SpaceAttribute ? M
  • ..*TextAreaAttribute ? M
  • ..*TooltipAttribute ? M
  • ..UnityAPICompatibilityVersionAttribute ? M
  • ..CallbackOrderAttribute ? M
  • ..*CanEditMultipleObjects ? M
  • ..*CustomEditor ? M
  • ..CustomPreviewAttribute ? M
  • ..CustomPropertyDrawer ? M
  • ..DrawGizmo ? M
  • ..InitializeOnLoadAttribute ? M
  • ..InitializeOnLoadMethodAttribute ? M
  • ..*MenuItem ? M
  • ..PreferenceItem ? M

Enumeration

System.Serializable

Manuel

MonoBehaviour Edition

  • OnValidate()
  • OnReset()

ExecuteInEditMode

Manuel - Unity Learn Video

Menu Edition

Manuel Shortcut: % (ctrl on Windows, cmd on macOS), # (shift), & (alt)
Special: Assets - Assets/Create - CONTEXT/ScriptMono [MenuItem("MyMenu/Do Something")]

Inspector Edition

Manuel - Unity Tutorial - W:Example

Window Edition

Manuel -TreeView

  • Change Window Name ?
  • Choose Window Size ?

OnGUI

M:Script - M:IMGUI

Scene Edition

Exemple

Gizmo Edition

Manuel

Scriptable Object

Scriptable Objects are amazing data containers. They don't need to be attached to a GameObject in a scene. They can be saved as assets in our project. Most often, they are used as assets which are only meant to store data, but can also be used to help serialize objects and can be instantiated in our scenes. Manual - Unity Learn Video

Editor Camera Rotation/Position

Extension Methode

Exemple

  • Can we extend from static class like Debug ? W:No :(

C# et la réflexion

Manuel - C# Basic: Reflection

  • Lock the inspector

Platform Compilation / precompiled code

Manuel

Online Video

Youtube

Udemy

Bonus

  • Set up Script Icon: 1, 2 Créer un Fichier au chemain suivant "Assets/Gizmos/MonNomClass icon.png" avec un espace dans le nom du fichier
    PS: Do not work with namespace

Add later

  • Lancer un script
    • Avant/Après le PlayMode
    • Avant/Après un Build
    • A l'ouverture de Unity
    • A l'ajout d'un fichier
  • Dessiner par dessus le gizmo
  • Utiliser des threads dans l'éditeur
  • Récupérer des fichiers selectionnés
  • Récupérer des informations sur la caméra
  • Récupérer les informations de l'utilisateur
  • Editer des tags des fichiers créés au moment de leur création.

Hummm...

  • UnityEvent don't work at runtime :(

// Camera c = SceneView.lastActiveSceneView.camera;
// Transform t = SceneView.lastActiveSceneView.camera.transform;
// t.position = t.position + t.forward ;
// SceneView.lastActiveSceneView.AlignViewToObject(t);

To add

Clone this wiki locally