Ejemplo n.º 1
0
            public ComponentToolCache(EditorToolContext context, EditorTool tool)
            {
                bool customTool    = IsCustomEditorTool(tool);
                bool customContext = IsCustomToolContext(context);

                if (customTool || customContext)
                {
                    toolType      = customTool ? tool.GetType() : null;
                    contextType   = customContext ? context.GetType() : null;
                    targetObject  = tool.target;
                    targetObjects = tool.targets.ToArray();
                }
                else
                {
                    toolType      = null;
                    contextType   = null;
                    targetObject  = null;
                    targetObjects = null;
                }

                m_ToolType    = null;
                m_ContextType = null;
            }
Ejemplo n.º 2
0
 static bool IsCustomToolContext(EditorToolContext context)
 {
     return(context != null && context.GetType() != typeof(GameObjectToolContext));
 }