コード例 #1
0
        private void SetTool()
        {
            if (_tool == null)
            {
                return;
            }

            var current = _tools[_currentTool];

            _tool.UseSound           = current.Sound;
            _tool.UseSoundCollection = current.SoundCollection;
            _tool.Qualities          = current.Behavior;

            if (_sprite == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(current.Texture))
            {
                if (!string.IsNullOrEmpty(current.Sprite))
                {
                    _sprite.LayerSetState(0, current.State, current.Sprite);
                }
                else
                {
                    _sprite.LayerSetState(0, current.State);
                }
            }
            else
            {
                _sprite.LayerSetTexture(0, current.Texture);
            }

            Dirty();
        }
コード例 #2
0
 public void Open()
 {
     Opened = true;
     collidableComponent.IsHardCollidable = false;
     spriteComponent.LayerSetTexture(0, OpenSprite);
 }