public void Perform(Material[] targets) { switch (type) { case DefineableActionType.URL: Application.OpenURL(data); break; case DefineableActionType.SET_PROPERTY: string[] set = Regex.Split(data, @"="); if (set.Length > 1) { MaterialHelper.SetMaterialValue(set[0].Trim(), set[1].Trim()); } break; case DefineableActionType.SET_TAG: string[] keyValue = Regex.Split(data, @"="); foreach (Material m in targets) { m.SetOverrideTag(keyValue[0].Trim(), keyValue[1].Trim()); } break; case DefineableActionType.SET_SHADER: Shader shader = Shader.Find(data); if (shader != null) { foreach (Material m in targets) { m.shader = shader; } } break; case DefineableActionType.OPEN_EDITOR: System.Type t = Helper.FindTypeByFullName(data); if (t != null) { try { EditorWindow window = EditorWindow.GetWindow(t); window.titleContent = new GUIContent("TPS Setup Wizard"); window.Show(); }catch (System.Exception e) { Debug.LogError("[Thry] Couldn't open Editor Window of type" + data); Debug.LogException(e); } } break; } }