Пример #1
0
        public void GetSourceAssetDependencies(AssetCollection assetCollection)
        {
            var guidString = m_Cubemap.guid;

            if (!string.IsNullOrEmpty(guidString) && GUID.TryParse(guidString, out var guid))
            {
                assetCollection.AddAssetDependency(guid, AssetCollection.Flags.IncludeInExportPackage);
            }
        }
Пример #2
0
            public void GetSourceAssetDependencies(AssetCollection assetCollection)
            {
                var    assetReference = JsonUtility.FromJson <SubGraphAssetReference>(m_SerializedSubGraph);
                string guidString     = assetReference?.subGraph?.guid;

                if (!string.IsNullOrEmpty(guidString) && GUID.TryParse(guidString, out GUID guid))
                {
                    // subgraphs are read as artifacts
                    // they also should be pulled into .unitypackages
                    assetCollection.AddAssetDependency(
                        guid,
                        AssetCollection.Flags.ArtifactDependency |
                        AssetCollection.Flags.IsSubGraph |
                        AssetCollection.Flags.IncludeInExportPackage);
                }
            }
Пример #3
0
 public void GetSourceAssetDependencies(AssetCollection assetCollection)
 {
     if (m_SourceType == HlslSourceType.File)
     {
         m_FunctionSource = UpgradeFunctionSource(m_FunctionSource);
         if (IsValidFunction(m_SourceType, m_FunctionName, m_FunctionSource, null))
         {
             if (GUID.TryParse(m_FunctionSource, out GUID guid))
             {
                 // as this is just #included into the generated .shader file
                 // it doesn't actually need to be a dependency, other than for export package
                 assetCollection.AddAssetDependency(guid, AssetCollection.Flags.IncludeInExportPackage);
             }
         }
     }
 }
            public void ProcessTemplateFile(string filePath)
            {
                if (File.Exists(filePath) &&
                    !includedFiles.Contains(filePath))
                {
                    includedFiles.Add(filePath);

                    if (assetCollection != null)
                    {
                        GUID guid = AssetDatabase.GUIDFromAssetPath(filePath);
                        if (!guid.Empty())
                        {
                            assetCollection.AddAssetDependency(guid, AssetCollection.Flags.SourceDependency);
                        }
                    }

                    string[] templateLines = File.ReadAllLines(filePath);
                    foreach (string line in templateLines)
                    {
                        ProcessTemplateLine(line, 0, line.Length);
                    }
                }
            }