public CopyComponents <T> GetOrAdd <T>(
            Type contextType,
            Type modelType,
            CopyComponents <T> copyComponents)
        {
            var modelsOfContext = _contextModelsPairs
                                  .GetOrAdd(contextType, new ConcurrentDictionary <Type, object>());

            return((CopyComponents <T>)modelsOfContext
                   .GetOrAdd(modelType, _ => copyComponents));
        }
Beispiel #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        CopyComponents components = target as CopyComponents;

        GUILayout.BeginVertical("Box");
        if (GUILayout.Button("Copy Components"))
        {
            components.copyScriptsOfComponents();
        }

        if (GUILayout.Button("Attach Scripts"))
        {
            components.addScripts();
        }
        GUILayout.EndHorizontal();
    }
Beispiel #3
0
 public Copy(CopyComponents <T> components, NpgsqlConnection conn)
 {
     _conn  = conn;
     _sql   = components.Sql;
     _write = components.Write;
 }
    static void Init()
    {
        CopyComponents window = (CopyComponents)EditorWindow.GetWindow(typeof(CopyComponents));

        window.Show();
    }