示例#1
0
 public void Init(Player _Player, EBrushType _Type)
 {
     m_Type = _Type;
     SetColor(_Player.m_Color);
     m_MovingEffect.Init(_Player);
     if (_Type == EBrushType.MAIN)
     {
         m_Arrow.SetActive(true);
     }
 }
示例#2
0
 internal void setFillPattern(FillPattern fillPattern)
 {
     mForeground = fillPattern.mForeground;
     mBackground = fillPattern.mBackground;
     mBrushType  = fillPattern.mBrushType;
 }
示例#3
0
 public FillPattern(Color black)
 {
     mBackground = Color.Transparent;
     mForeground = black;
     mBrushType  = EBrushType.Solid;
 }
示例#4
0
 public FillPattern()
 {
     mBackground = Color.Transparent;
     mForeground = MyColor.DEFAULT_SHAPE_FILL_COLOR;
     mBrushType  = EBrushType.Solid;
 }
示例#5
0
 public FillPattern(EBrushType brushType, Color foregroundColor, Color backgroundColor)
 {
     this.mBrushType = brushType;
     mForeground     = foregroundColor;
     mBackground     = backgroundColor;
 }
示例#6
0
 public void setFillPattern(int index)
 {
     mBrushType = (EBrushType)index;
 }
示例#7
0
    /// <summary>
    /// Creates the specific brush.
    /// </summary>
    public static BSBrush CreateBrush(EBrushType type)
    {
        if (Self == null)
        {
            Debug.LogError("Building manipulator");
            return(null);
        }

        if (type == Self.m_BrushType)
        {
            return(Self.m_ActiveBrush);
        }

        if (Self.m_ActiveBrush != null)
        {
            Destroy(Self.m_ActiveBrush.gameObject);
        }

        BSBrush brush = null;

        switch (type)
        {
        case EBrushType.Point:
            brush = BSBrush.Create <BSPointBrush>(Self.brushPrefabs.pointBrush, Self.brushGroup.transform);
            break;

        case EBrushType.Box:
            brush = BSBrush.Create <BSBoxBrush>(Self.brushPrefabs.boxBrush, Self.brushGroup.transform);
            break;

        case EBrushType.Select:
            brush = BSBrush.Create <BSMiscBrush>(Self.brushPrefabs.SelectBrush, Self.brushGroup.transform);
            break;

        case EBrushType.Iso:
            brush = BSBrush.Create <BSIsoBrush>(Self.brushPrefabs.IsoBrush, Self.brushGroup.transform);
            break;

        case EBrushType.B45Diagonal:
            brush = BSBrush.Create <BSB45DiagonalBrush>(Self.brushPrefabs.diagonalBrush, Self.brushGroup.transform);
            break;

        case EBrushType.IsoSelectBrush:
            brush = BSBrush.Create <BSIsoSelectBrush>(Self.brushPrefabs.IsoSelectBrush, Self.brushGroup.transform);
            break;

        default:
            break;
        }
        Self.m_BrushType = type;

        if (brush == null)
        {
            return(null);
        }

        Self.m_ActiveBrush = brush;

        brush.pattern              = Self.pattern;
        brush.dataSource           = Self.m_ActiveData;
        Self.voxelIndicator.minVol = brush.minvol;

        if (Self.onCreateBrush != null)
        {
            Self.onCreateBrush(brush, type);
        }

        return(brush);
    }