kwnetzwelt / unity-build-system

MIT License
59 stars 11 forks source link

Development #10

Closed en-ospiewok closed 7 years ago

en-ospiewok commented 7 years ago

Created a new build step option, which can contain UnityObjects. They will be assigned by using the common unity UnityObject dialog and have to be "converted" inside their actual buildstep "BuildStepStart(BuildConfiguration pConfiguration)" method

Sample:

namespace UBSExtension { [BuildStepTypeFilter(EBuildStepType.PreBuildStep)] [BuildStepDescription("Sets the vr daydream icon, which you can normally specify inside the playersettings.")] [BuildStepParameterFilterAttribute(EBuildStepParameterType.UnityObject)] public class SetVRDaydreamIcon : IBuildStepProvider { public void BuildStepStart(BuildConfiguration pConfiguration) { Texture2D texture; var succeeded = UBS.Helpers.TryGetUnityObjectTypeFromBuildConfigurationParameter(pConfiguration, out texture); if (succeeded) { PlayerSettings.VRDaydream.daydreamIcon = texture; AssetDatabase.SaveAssets(); } else { pConfiguration.Cancel("Could not convert assigned object to needed texture2D"); } } public void BuildStepUpdate() { } public bool IsBuildStepDone() { return true; } } }