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; }
static bool IsCustomToolContext(EditorToolContext context) { return(context != null && context.GetType() != typeof(GameObjectToolContext)); }