コード例 #1
0
        protected virtual void SetId(string id, bool andEnable = false)
        {
            ID = id;

            if (!string.IsNullOrEmpty(id))
            {
                string spriteName = GetSpriteResourceName();
                _image.sprite = SpriteResource.GetSprite(spriteName);

                if (andEnable)                  // if we are turned off, then something else has to turn us back on. we can't make that decision.
                {
                    gameObject.SetActive(true);
                }
            }
            else
            {
                _image.sprite = null;
                gameObject.SetActive(false);                    // our view state is now invalid, so turn off
            }
        }
コード例 #2
0
 private void OnDestroy()
 {
     SceneController.UnregisterTransitioner(this);
     Level.StopListeningForLevelEvents(ReceiveLevelEvents);
     SpriteResource.ClearCache();
 }