public SetBrushMode ( Painter_BrushMode brushMode ) : void | ||
brushMode | Painter_BrushMode | |
리턴 | void |
public void SetBrushMode(int newMode) { Painter_BrushMode brushMode = newMode == 0? Painter_BrushMode.DECAL:Painter_BrushMode.PAINT; //Cant set enums for buttons :( string colorText = brushMode == Painter_BrushMode.PAINT?"orange":"purple"; guiTextMode.text = "<b>Mode:</b><color=" + colorText + ">" + brushMode.ToString() + "</color>"; painter.SetBrushMode(brushMode); }
private void InitBrushes() { foreach (Transform transBtn in transPanelBrush) { Button btnBrush = transBtn.GetComponent <Button>(); btnBrush.onClick.AddListener(() => { Image imgBrush = transBtn.GetComponent <Image>(); string strSprite = imgBrush.sprite.name; Painter_BrushMode mode = GetBrushMode(strSprite); painter.SetBrushMode(mode, strSprite); transPanelBrush.gameObject.SetActive(false); }); } }