public override void ReciveInput(int x, int y, ClickType type) { if (type == ClickType.Down) { printer.SetMaskArea(); printer.FloodFillMaskThread(x, y, Color.blue, printer.GetColor(x, y)); EventSys.GetInstance().MagicBandEnd(); } }
void Awake() { texture = new Texture2D(1, 1); colorArray = new Color[1]; paletteTexture = new Texture2D(255, 255); paletteColorArray = new Color[255 * 255]; image.texture = texture; MakeSliderTexture(); MakeBackGrounp(); SliderChange(); Init(); EventSys.GetInstance().changeToningColor += ToningUI_changeToningColor; }
public override void ReciveInput(int x, int y, ClickType type) { if (isDraw) { if (type == ClickType.Down) { drawRectangle.Draw(); } } // if(ty) if (type == ClickType.Up) { if (isDrag) { isDrag = false; drawRectangle.SetNotDrag(); } if (isDraw) { EventSys.GetInstance().ChooseAreaEnd(); drawRectangle.LockArea(); isDraw = false; drawRectangle.GetArea(); } } if (type == ClickType.Down) { if (!isDraw) { if (drawRectangle.IsInArea()) { isDrag = true; drawRectangle.SetDrag(); } } } if (isDrag) { drawRectangle.Drag(); } }
void Awake() { Init(); brushTypeDropDown = GetChild <Dropdown>("BrushTypeDropdown"); brushSizeSlider = GetChild <Slider>("BrushSizeSlider"); concentrationSlider = GetChild <Slider>("BrushConcentrationSlider"); magicBandToggle = GetChild <Toggle>("magicBandToggle"); getColorToggle = GetChild <Toggle>("getColorToggle"); paintPailToggle = GetChild <Toggle>("paintPailToggle"); bezierToggle = GetChild <Toggle>("bezierToggle"); cancelMagicBandButton = GetChild <Button>("CancelMagicBandButton"); mosaicToggle = GetChild <Toggle>("MosaicToggle"); mosaicAreaSlider = GetChild <Slider>("MosaicAreaSlider"); mosaicValSlider = GetChild <Slider>("MosaicValSlider"); chooseAreaToggle = GetChild <Toggle>("ChooseAreaToggle"); cancelChooseAreaButton = GetChild <Button>("CancelChooseAreaButton"); List <Dropdown.OptionData> list = new List <Dropdown.OptionData>(); list.Add(new Dropdown.OptionData("铅笔")); list.Add(new Dropdown.OptionData("笔")); list.Add(new Dropdown.OptionData("橡皮擦")); brushTypeDropDown.options = list; magicBandToggle.onValueChanged.AddListener(MagicBandToggleChange); getColorToggle.onValueChanged.AddListener(GetColorToggleChange); paintPailToggle.onValueChanged.AddListener(PaintPailToggleChange); bezierToggle.onValueChanged.AddListener(BezierToggleChange); cancelMagicBandButton.onClick.AddListener(CancelMagicBandButtonClick); mosaicToggle.onValueChanged.AddListener(MosaicToggleChange); mosaicAreaSlider.onValueChanged.AddListener(MosaicSliderValValueChange); mosaicValSlider.onValueChanged.AddListener(MosaicSliderValValueChange); chooseAreaToggle.onValueChanged.AddListener(ChooseToggleValueChange); cancelChooseAreaButton.onClick.AddListener(ChooseAreaButtonClick); EventSys.GetInstance().magicBandEnd += BrushMenuUI_magicBandEnd; EventSys.GetInstance().chooseAreaEnd += BrushMenuUI_chooseAreaEnd; }
public override void ReciveInput(int x, int y, ClickType type) { Color32 c = printer.GetColor(x, y); EventSys.GetInstance().ChangeToningColor(c); }