Inheritance: UnityEngine.MonoBehaviour
示例#1
0
        private ImageMessage(JSONObject configuration, string name, int depth)
        {
            GameObject gameObject = new GameObject(name);
            SpriteMap spriteMap = gameObject.AddComponent<SpriteMap>();
            spriteMap.Build(configuration);

            this.configuration = configuration;
            this.gameObject = gameObject;
            this.spriteMap = spriteMap;
            this.depth = depth;
        }
示例#2
0
        public void Prepare(Dictionary<string, object> configuration)
        {
            try {
                if (BeforePrepare != null) {
                    BeforePrepare(this, new EventArgs());
                }

                _gameObject = new GameObject(_name);
                SpriteMap spriteMap = _gameObject.AddComponent<SpriteMap>();
                spriteMap.Init(configuration);
                spriteMap.LoadResource(() => {
                    IsReady = true;
                    if (AfterPrepare != null) {
                        AfterPrepare(this, new EventArgs());
                    }
                });

                _spritemap = spriteMap;
                Configuration = configuration;

            } catch (Exception ex) {
                Logger.LogError("Preparing popup configuration failed: "+ex.Message);
            }
        }