Exemplo n.º 1
0
        void drawAssetScope()
        {
            if (SRWindow.Instance.Compact())
            {
                GUILayout.BeginHorizontal();
            }
            else
            {
                GUILayout.BeginHorizontal();
            }

            string[]   scopeLabels   = new string[] { "Prefabs", "Scenes", "Scriptable Objects", "Materials", "Animations", "Animators", "Textures", "AudioClips" };
            AssetScope newAssetScope = (AssetScope)EditorGUILayout.MaskField("Assets:", (int)assetScope, scopeLabels);

            if (newAssetScope != assetScope)
            {
                assetScope = newAssetScope;
                SRWindow.Instance.PersistCurrentSearch();
            }

            if (SRWindow.Instance.Compact())
            {
                GUILayout.EndHorizontal();
            }
            else
            {
                // GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
            }
        }
Exemplo n.º 2
0
        public VFSIndex CreateIndexReader(AssetScope scope)
        {
            var indexDatabaseName = scope == AssetScope.Global ? "globals.idx" : "locals.idx";
            var indexDbPath       = Path.Combine(_prefixFolderPath, indexDatabaseName);

            return(new VFSIndex(indexDbPath, scope));
        }
Exemplo n.º 3
0
        public VFSDataFile CreateDataFileReader(AssetScope scope)
        {
            var dataDatabaseName = scope == AssetScope.Global ? "globals.data" : "locals.data";
            var dataDbPath       = Path.Combine(_prefixFolderPath, dataDatabaseName);

            return(new VFSDataFile(dataDbPath));
        }
Exemplo n.º 4
0
 void addObjectsInLocation(ObjectID scopeObj, string[] allAssets, AssetScope jobScope)
 {
     string[] addedPaths = new string[0];
     if (scopeObj.isDirectory)
     {
         if ((jobScope & assetScope) == assetScope)
         {
             string scopePath = scopeObj.assetPath;
             addedPaths = allAssets.Where(asset => suffixes.Any(suffix => asset.EndsWith(suffix, System.StringComparison.OrdinalIgnoreCase))).ToArray();
             addedPaths = addedPaths.Where(asset => asset.StartsWith(scopePath)).ToArray();
             // Debug.Log("[SearchSubJob"+GetType()+"] Found "+addedPaths.Length + " things in "+scopePath);
             // foreach(string path in addedPaths)
             // {
             //   Debug.Log("[SearchSubJob] found:"+path);
             // }
         }
         else
         {
             // Debug.Log("[SearchSubJob] Ignoring, not in scope.");
         }
     }
     else
     {
         if (suffixes.Any(suffix => scopeObj.assetPath.EndsWith(suffix)))
         {
             // Debug.Log("[SearchSubJob] searching object:"+scopeObj.assetPath);
             addedPaths    = new string[1];
             addedPaths[0] = scopeObj.assetPath;
         }
     }
     addItems(addedPaths);
     // Debug.Log("[SearchSubJob] added:"+addedPaths.Length);
 }
Exemplo n.º 5
0
 public SearchScopeData(ProjectScope ep, AssetScope s, ObjectID oid, bool sd)
 {
     projectScope       = ep;
     assetScope         = s;
     scopeObj           = oid;
     searchDependencies = sd;
     searchDependencies = false;
 }
Exemplo n.º 6
0
 public SearchScopeData(ProjectScope ep, AssetScope s, ObjectID oid, bool sd, bool lp)
 {
     projectScope       = ep;
     assetScope         = s;
     scopeObj           = oid;
     searchDependencies = sd;
     loadPrefab         = lp;
 }
Exemplo n.º 7
0
 public Material(String name, Texture2D texture, AssetScope scope)
 {
     this.Name = name;
     this._texture = texture;
     this.Filename = "";
     this.AreasDefinitionFilename = "";
     this.Scope = scope;
     this.Areas = new Dictionary<String, Rectangle>();
 }
Exemplo n.º 8
0
 public Material(String name, Texture2D texture, AssetScope scope)
 {
     this.Name     = name;
     this._texture = texture;
     this.Filename = "";
     this.AreasDefinitionFilename = "";
     this.Scope = scope;
     this.Areas = new Dictionary <String, Rectangle>();
 }
Exemplo n.º 9
0
 public SceneSubJob(SearchJob j, AssetScope sc, string[] allAssets, string[] s) : base(j, sc, allAssets, s, false)
 {
     sceneSetups = EditorSceneManager.GetSceneManagerSetup();
     foreach (SceneSetup sceneSetup in sceneSetups)
     {
         loadScenesHash[sceneSetup.path] = sceneSetup;
         // Debug.Log("[SceneSubJob] scene:"+sceneSetup.path);
     }
 }
Exemplo n.º 10
0
 public SearchSubJob(SearchJob j, AssetScope sc, string[] allAssets, string[] s, bool ari)
 {
     job                   = j;
     suffixes              = s;
     assetScope            = sc;
     assetRequiresImporter = ari;
     foreach (string ss in s)
     {
         job.supportedFileTypes.Add(ss);
     }
     filterAssetPaths(allAssets);
 }
Exemplo n.º 11
0
        internal VFSIndex(string indexDbPath, AssetScope scope)
        {
            Contract.Requires(indexDbPath != null);
            Contract.Requires(Directory.Exists(indexDbPath), "Specified indexDbPath does not exist!");             // Still might not later, but an upfront check is not unreasonable.

            _indexDbPath = indexDbPath;

            LOG.Debug($"Initializing connection to Index DB '{_indexDbPath}'");

            _indexDbConnection = new SqliteConnection($"Data Source={_indexDbPath};Version=3;");

            _scope = scope;
        }
Exemplo n.º 12
0
        public HashSet <string> GetSuffixesForScope(AssetScope scope)
        {
            HashSet <string> retVal = new HashSet <string>();

            foreach (var kvp in suffixesForScope)
            {
                if ((scope & kvp.Key) == kvp.Key)
                {
                    foreach (string suffix in kvp.Value)
                    {
                        retVal.Add(suffix);
                    }
                }
            }
            return(retVal);
        }
Exemplo n.º 13
0
 public override void OnSearchBegin()
 {
     UnityEngine.Object o = objID.obj;
     if (o is Component || o is GameObject)
     {
         searchScope = AssetScope.Prefabs | AssetScope.Scenes;
     }
     else if (o is MonoScript)
     {
         //This could be better but for now we just search anything that can have a monoscript.
         searchScope = AssetScope.Prefabs | AssetScope.Scenes | AssetScope.ScriptableObjects;
     }
     else if (o is ScriptableObject)
     {
         searchScope = AssetScope.ScriptableObjects;
     }
     else if (o is Material)
     {
         searchScope = AssetScope.Materials;
     }
     else if (o is AnimationClip)
     {
         searchScope = AssetScope.Animations;
     }
     else if (o is UnityEditor.Animations.AnimatorController)
     {
         searchScope = AssetScope.Animators;
     }
     else if (o is Texture)
     {
         searchScope = AssetScope.Textures;
     }
     else if (o is AudioClip)
     {
         searchScope = AssetScope.AudioClips;
     }
     else
     {
         // Debug.Log("[SearchItemProperty] Unknown! Setting to all");
         searchScope = (AssetScope) ~0; //All!
     }
 }
Exemplo n.º 14
0
        AssetScope DrawAssetScopeButton(AssetScope val, AssetScope currentMask, GUIContent content)
        {
            bool selected = GUILayout.Toggle((currentMask & val) == val, content, SRWindow.toolbarButton, GUILayout.MinWidth(30));

            if (selected)
            {
                if ((currentMask & val) == 0)
                {
                    currentMask |= val;
                }
            }
            else
            {
                if ((currentMask & val) == val)
                {
                    currentMask &= ~val;
                }
            }
            return(currentMask);
        }
Exemplo n.º 15
0
 public SceneObjectSubJob(SearchJob j, AssetScope sc, string[] allAssets, string[] s) : base(j, sc, allAssets, s, false)
 {
 }
Exemplo n.º 16
0
 public IceEffect(AssetScope scope, string name)
 {
     this.Scope = scope;
     this.Name  = name;
 }
Exemplo n.º 17
0
 public IceEffect(AssetScope scope, string name)
 {
     this.Scope = scope;
     this.Name = name;
 }
Exemplo n.º 18
0
 public IceFont(String name, SpriteFont font, AssetScope scope)
 {
     this.Name  = name;
     this._font = font;
     this.Scope = scope;
 }
Exemplo n.º 19
0
 public IceFont(String name, SpriteFont font, AssetScope scope)
 {
     this.Name = name;
     this._font= font;
     this.Scope = scope;
 }
Exemplo n.º 20
0
        public ActionResult GetRoleItems(AssetScope scope, int iDisplayStart, int iDisplayLength, string sEcho)
        {
            using (var context = new DatabaseContext())
            {
                var query = context.Roles.Where(x => x.ScopeValue == (int)scope)
                                         .OrderByDescending(x => x.Name);

                var totalRecords = query.Count();

                var page = query.Skip(iDisplayStart).Take(iDisplayLength).ToList();

                var model = new DataTablePage
                {
                    sEcho = sEcho,
                    iTotalRecords = totalRecords,
                    iTotalDisplayRecords = totalRecords
                };

                var roles = (from x in page
                             select new RoleModel
                             {
                                 Id = x.Id,
                                 Name = x.Name
                             }).ToList();

                foreach (var role in roles)
                {
                    var item = new Dictionary<string, string>
                    {
                        {"Name", role.Name},
                        {"DT_RowId", "roleItem_" + role.Id}
                    };

                    model.aaData.Add(item);
                }

                return Json(model, JsonRequestBehavior.AllowGet);
            }
        }