Пример #1
0
        public bool Process()
        {
            if (this.ContentState == Unity3DTileContentState.PROCESSING)
            {
                this.ContentState = Unity3DTileContentState.READY;
                this.Content.Initialize(this.Tileset.TilesetOptions.CreateColliders);

                var indexMode = this.Tileset.TilesetOptions.LoadIndices;
                if (indexMode != IndexMode.Default && indexMode != IndexMode.None)
                {
                    Action <IndexMode, string, string> fail = (mode, url, msg) =>
                    {
                        //we could log a warning here, but if indices are expected but not available
                        //that might not actually be a true error condition
                        //and this would spam the log
                        //Debug.LogWarning("failed to load " + mode + " index for " + this.ContentUrl + ": " + msg);
                    };
                    Action <Unity3DTileIndex> success = index => { this.Content.Index = index; };
                    this.Tileset.Behaviour
                    .StartCoroutine(Unity3DTileIndex.Load(indexMode, this.ContentUrl, success, fail));
                }

                return(true);
            }
            return(false);
        }
Пример #2
0
        public bool Process()
        {
            if (ContentState == Unity3DTileContentState.PROCESSING)
            {
                ContentState = Unity3DTileContentState.READY;

                Content.SetShadowMode(Tileset.TilesetOptions.ShadowCastingMode,
                                      Tileset.TilesetOptions.RecieveShadows);

                Content.Initialize(Tileset.TilesetOptions.CreateColliders);

                var indexMode = Tileset.TilesetOptions.LoadIndices;
                if (indexMode != IndexMode.Default && indexMode != IndexMode.None)
                {
                    Action <IndexMode, string, string> fail = (mode, url, msg) =>
                    {
                        //we could log a warning here, but if indices are expected but not available
                        //that might not actually be a true error condition
                        //and this would spam the log
                        if (Unity3DTileIndex.EnableLoadWarnings)
                        {
#pragma warning disable 0162
                            Debug.LogWarning("failed to load " + mode + " index for " + ContentUrl + ": " + msg);
#pragma warning restore 0162
                        }
                    };
                    Action <Unity3DTileIndex> success = index => { Content.Index = index; };
                    Tileset.Behaviour.StartCoroutine(Unity3DTileIndex.Load(indexMode, ContentUrl, success, fail));
                }

                return(true);
            }
            return(false);
        }