AutoPopulate() public static method

public static AutoPopulate ( ) : bool
return bool
Esempio n. 1
0
    void OnEnable()
    {
        if (string.IsNullOrEmpty(WwiseSettings.LoadSettings().WwiseProjectPath))
        {
            return;
        }

        treeView.SaveExpansionStatus();
        if (AkWwiseWWUBuilder.AutoPopulate())
        {
            PopulateTreeview();
        }
    }
Esempio n. 2
0
    void OnEnable()
    {
        if (string.IsNullOrEmpty(WwiseSettings.LoadSettings().WwiseProjectPath))
        {
            return;
        }

        string[] dir = { "Events", "States", "Switches", "Master-Mixer Hierarchy", "SoundBanks" };
        string   wwiseProjectPath = Path.GetDirectoryName(AkUtilities.GetFullPath(Application.dataPath, WwiseSettings.LoadSettings().WwiseProjectPath));

        try
        {
            for (int i = 0; i < dir.Length; i++)
            {
                DirectoryInfo dirInfo = new DirectoryInfo(Path.Combine(wwiseProjectPath, dir[i]));
                FileInfo[]    files   = dirInfo.GetFiles("*.wwu", SearchOption.AllDirectories);

                ArrayList     list     = AkWwiseProjectInfo.GetData().GetWwuListByString(dir[i]);
                List <string> pathList = new List <string>(list.Count);
                for (int j = 0; j < list.Count; j++)
                {
                    pathList.Add(Path.Combine(wwiseProjectPath, (list[j] as AkWwiseProjectData.WorkUnit).PhysicalPath));
                }

                foreach (FileInfo file in files)
                {
                    if (file.LastWriteTime.CompareTo(AkWwiseProjectInfo.GetData().GetLastPopulateTime()) > 0)
                    {
                        AkWwiseWWUBuilder.s_createdWwu.Add(file.FullName);
                    }

                    pathList.Remove(file.FullName);
                }

                AkWwiseWWUBuilder.s_deletedWwu.AddRange(pathList);
            }
            if (AkWwiseWWUBuilder.s_createdWwu.Count != 0 || AkWwiseWWUBuilder.s_deletedWwu.Count != 0)
            {
                treeView.SaveExpansionStatus();
                AkWwiseWWUBuilder.AutoPopulate();
                PopulateTreeview();
            }
        }
        catch (Exception)
        {
            WwiseProjectFound = false;
        }
    }