예제 #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();
            }
        }
예제 #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));
        }
예제 #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));
        }
예제 #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);
 }
예제 #5
0
 public SearchScopeData(ProjectScope ep, AssetScope s, ObjectID oid, bool sd)
 {
     projectScope       = ep;
     assetScope         = s;
     scopeObj           = oid;
     searchDependencies = sd;
     searchDependencies = false;
 }
예제 #6
0
 public SearchScopeData(ProjectScope ep, AssetScope s, ObjectID oid, bool sd, bool lp)
 {
     projectScope       = ep;
     assetScope         = s;
     scopeObj           = oid;
     searchDependencies = sd;
     loadPrefab         = lp;
 }
예제 #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>();
 }
예제 #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>();
 }
예제 #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);
     }
 }
예제 #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);
 }
예제 #11
0
파일: VFSIndex.cs 프로젝트: kf6kjg/WHIPtoCF
        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;
        }
예제 #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);
        }
예제 #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!
     }
 }
예제 #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);
        }
예제 #15
0
 public SceneObjectSubJob(SearchJob j, AssetScope sc, string[] allAssets, string[] s) : base(j, sc, allAssets, s, false)
 {
 }
예제 #16
0
 public IceEffect(AssetScope scope, string name)
 {
     this.Scope = scope;
     this.Name  = name;
 }
예제 #17
0
 public IceEffect(AssetScope scope, string name)
 {
     this.Scope = scope;
     this.Name = name;
 }
예제 #18
0
 public IceFont(String name, SpriteFont font, AssetScope scope)
 {
     this.Name  = name;
     this._font = font;
     this.Scope = scope;
 }
예제 #19
0
 public IceFont(String name, SpriteFont font, AssetScope scope)
 {
     this.Name = name;
     this._font= font;
     this.Scope = scope;
 }
예제 #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);
            }
        }