コード例 #1
0
        public BuildApp(Dictionary <string, string> args)
        {
            _args          = args;
            Name           = GetArg("Name");
            OutputDir      = GetArg("OutputDir");
            BuildTarget    = GetArg("BuildTarget");
            Scenes         = GetArg("Scenes")?.Split(',').ToList();
            ReportFile     = GetArg("ReportFile");
            Version        = GetArg("Version");
            Commit         = GetArg("Commit");
            AndroidSdkRoot = GetArg("AndroidSdkRoot");
            JdkPath        = GetArg("JdkPath");

            if (string.IsNullOrEmpty(Name))
            {
                throw new ArgumentNullException(nameof(Name));
            }
            if (string.IsNullOrEmpty(BuildTarget))
            {
                throw new ArgumentNullException(nameof(BuildTarget));
            }
            if (string.IsNullOrEmpty(OutputDir))
            {
                OutputDir = "bin/";
            }
            if (!(Scenes?.Any() ?? false))
            {
                throw new ArgumentNullException(nameof(Scenes));
            }
            if (string.IsNullOrEmpty(Version))
            {
                throw new ArgumentNullException(nameof(Version));
            }
            _version = SemVersion.Parse(Version);
        }
コード例 #2
0
        private void SetExportData(IExportContainer container)
        {
            // if < 3.0.0 this asset doesn't exist

            // 3.0.0 to 5.5.0 this asset is created by culling settings so it has set data already
            if (OcclusionCullingSettings.IsReadPVSData(container.Version))
            {
                return;
            }

            // if >= 5.5.0 and !Release this asset containts renderer data
            if (IsReadStaticRenderers(container.Flags))
            {
                return;
            }

            // if >= 5.5.0 and Release this asset doesn't containt renderers data so we need to create it
            List <OcclusionCullingSettings> cullingSettings = new List <OcclusionCullingSettings>();

            foreach (ISerializedFile file in File.Collection.Files)
            {
                foreach (Object asset in file.FetchAssets())
                {
                    if (asset.ClassID == ClassIDType.OcclusionCullingSettings)
                    {
                        OcclusionCullingSettings cullingSetting = (OcclusionCullingSettings)asset;
                        if (Scenes.Any(t => t.Scene == cullingSetting.SceneGUID))
                        {
                            cullingSettings.Add(cullingSetting);
                        }
                    }
                }
            }

            int            maxRenderer = Scenes.Max(j => j.IndexRenderers);
            OcclusionScene rscene      = Scenes.First(t => t.IndexRenderers == maxRenderer);

            m_staticRenderers = new SceneObjectIdentifier[rscene.IndexRenderers + rscene.SizeRenderers];

            int            maxPortal = Scenes.Max(j => j.IndexPortals);
            OcclusionScene pscene    = Scenes.First(t => t.IndexPortals == maxPortal);

            m_portals = new SceneObjectIdentifier[pscene.IndexPortals + pscene.SizePortals];

            foreach (OcclusionCullingSettings cullingSetting in cullingSettings)
            {
                OcclusionScene scene = Scenes.First(t => t.Scene == cullingSetting.SceneGUID);
                if (scene.SizeRenderers != cullingSetting.StaticRenderers.Count)
                {
                    throw new Exception($"Scene renderer count {scene.SizeRenderers} doesn't match with given {cullingSetting.StaticRenderers.Count}");
                }
                if (scene.SizePortals != cullingSetting.Portals.Count)
                {
                    throw new Exception($"Scene portal count {scene.SizePortals} doesn't match with given {cullingSetting.Portals.Count}");
                }
                SetIDs(container, cullingSetting, scene);
            }
        }
コード例 #3
0
        public bool CanForward()
        {
            if (Currrent == null)
            {
                return(false);
            }

            if (Currrent.PrevScene == null)
            {
                return(false);
            }

            return(Scenes.Any(i => i.PrevScene == Currrent));
        }