Universe.Framework.SceneInfo.UuidGatherer.GetScriptAssetUuids C# (CSharp) Method

GetScriptAssetUuids() protected method

Record the asset uuids embedded within the given script.
protected GetScriptAssetUuids ( UUID scriptUuid, AssetType>.IDictionary assetUuids ) : void
scriptUuid UUID
assetUuids AssetType>.IDictionary Dictionary in which to record the references
return void
        protected void GetScriptAssetUuids (UUID scriptUuid, IDictionary<UUID, AssetType> assetUuids)
        {
            AssetBase scriptAsset = GetAsset (scriptUuid);

            if (null != scriptAsset) {
                string script = Utils.BytesToString (scriptAsset.Data);
                //MainConsole.Instance.DebugFormat("[Archiver]: Script {0}", script);
                MatchCollection uuidMatches = Util.UUIDPattern.Matches (script);
                //MainConsole.Instance.DebugFormat("[Archiver]: Found {0} matches in script", uuidMatches.Count);

                foreach (UUID uuid in from Match uuidMatch in uuidMatches select new UUID (uuidMatch.Value)) {
                    //MainConsole.Instance.DebugFormat("[Archiver]: Recording {0} in script", uuid);

                    // Assume AssetIDs embedded in scripts are textures
                    assetUuids [uuid] = AssetType.Texture;
                }
            }
        }