• 大小: 2.25M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-01
  • 语言: C#
  • 标签: unity  2d  

资源简介

unity 2d-extras-master插件

资源截图

代码片段和文件信息

using UnityEngine;

namespace UnityEditor.Tilemaps
{
    /// 
    /// This Brush displays the cell coordinates it is targeting in the SceneView.
    /// Use this as an example to create brushes which have extra visualization features when painting onto a Tilemap.
    /// 

    [CustomGridBrush(true false false “Coordinate Brush“)]
    public class CoordinateBrush : GridBrush 
    {
    }

    /// 
    /// The Brush Editor for a Coordinate Brush.
    /// 

    [CustomEditor(typeof(CoordinateBrush))]
    public class CoordinateBrushEditor : GridBrushEditor
    {
        /// 
        /// Callback for painting the GUI for the GridBrush in the Scene View.
        /// The CoordinateBrush Editor overrides this to draw the current coordinates of the brush.
        /// 

        /// Grid that the brush is being used on.
        /// Target of the GridBrushbase::ref::Tool operation. By default the currently selected Gameobject.
        /// Current selected location of the brush.
        /// Current GridBrushbase::ref::Tool selected.
        /// Whether brush is being used.
        public override void OnPaintSceneGUI(GridLayout grid Gameobject brushTarget BoundsInt position GridBrushbase.Tool tool bool executing)
        {
            base.OnPaintSceneGUI(grid brushTarget position tool executing);

            var labelText = “Pos: “ + position.position;
            if (position.size.x > 1 || position.size.y > 1) {
                labelText += “ Size: “ + position.size;
            }

            Handles.Label(grid.CellToWorld(position.position) labelText);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         123  2020-10-05 14:45  2d-extras-master\.npmignore
     文件        4467  2020-10-05 14:45  2d-extras-master\CHANGELOG.md
     文件         158  2020-10-05 14:45  2d-extras-master\CHANGELOG.md.meta
     文件         478  2020-10-05 14:45  2d-extras-master\CONTRIBUTING.md
     文件         158  2020-10-05 14:45  2d-extras-master\CONTRIBUTING.md.meta
     目录           0  2020-10-05 14:45  2d-extras-master\Documentation~\
     文件        1655  2020-10-05 14:45  2d-extras-master\Documentation~\AnimatedTile.md
     文件         636  2020-10-05 14:45  2d-extras-master\Documentation~\Brushes.md
     文件        1144  2020-10-05 14:45  2d-extras-master\Documentation~\Contributors.md
     文件         445  2020-10-05 14:45  2d-extras-master\Documentation~\CoordinateBrush.md
     文件        2785  2020-10-05 14:45  2d-extras-master\Documentation~\CustomRulesForRuleTile.md
     文件        1516  2020-10-05 14:45  2d-extras-master\Documentation~\GameobjectBrush.md
     文件        1763  2020-10-05 14:45  2d-extras-master\Documentation~\GridInformation.md
     文件        1178  2020-10-05 14:45  2d-extras-master\Documentation~\GroupBrush.md
     目录           0  2020-10-05 14:45  2d-extras-master\Documentation~\images\
     文件       83562  2020-10-05 14:45  2d-extras-master\Documentation~\images\AnimatedTile.png
     文件      154660  2020-10-05 14:45  2d-extras-master\Documentation~\images\AnimatedTileEditor.png
     文件       49727  2020-10-05 14:45  2d-extras-master\Documentation~\images\BrushDropdown.png
     文件       12065  2020-10-05 14:45  2d-extras-master\Documentation~\images\CoordinateBrush.png
     文件       15081  2020-10-05 14:45  2d-extras-master\Documentation~\images\GameobjectBrush.png
     文件       68615  2020-10-05 14:45  2d-extras-master\Documentation~\images\GroupBrush.png
     文件       13692  2020-10-05 14:45  2d-extras-master\Documentation~\images\LineBrush.png
     文件       14236  2020-10-05 14:45  2d-extras-master\Documentation~\images\LineBrushFillGaps.png
     文件       96471  2020-10-05 14:45  2d-extras-master\Documentation~\images\PipelineTile.png
     文件       43013  2020-10-05 14:45  2d-extras-master\Documentation~\images\PipelineTileEditor.png
     文件       30047  2020-10-05 14:45  2d-extras-master\Documentation~\images\PrefabBrush.png
     文件       19372  2020-10-05 14:45  2d-extras-master\Documentation~\images\PrefabBrushEditor.png
     文件       18920  2020-10-05 14:45  2d-extras-master\Documentation~\images\RandomBrush.png
     文件       30983  2020-10-05 14:45  2d-extras-master\Documentation~\images\RandomBrushTileSet.png
     文件      126432  2020-10-05 14:45  2d-extras-master\Documentation~\images\RandomTile.png
     文件       55316  2020-10-05 14:45  2d-extras-master\Documentation~\images\RandomTileEditor.png
............此处省略223个文件信息

评论

共有 条评论