public override void OnImportAsset(AssetImportContext context)
        {
            var asset = BuildSettings.CreateInstance();

            if (BuildSettings.DeserializeFromPath(asset, context.assetPath))
            {
                context.AddObjectToAsset("asset", asset /*, icon*/);
                context.SetMainObject(asset);
            }
        }
예제 #2
0
        internal BuildContext(BuildPipeline pipeline, BuildSettings settings, BuildProgress progress, Action <BuildContext> mutator = null)
        {
            BuildPipeline       = pipeline ?? throw new NullReferenceException(nameof(pipeline));
            BuildSettings       = settings ?? BuildSettings.CreateInstance();
            BuildProgress       = progress;
            BuildPipelineStatus = BuildPipelineResult.Success(pipeline, BuildSettings);

            mutator?.Invoke(this);

            // Work-around for assets that can be garbage collected during a build
            BuildSettings.GCPin();
            BuildPipeline.GCPin();
        }