12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using ShadowStudio.Tool;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using XRTool.Util;
- using XRTool.WorldUI;
- namespace ShadowStudio.UI
- {
- [RequireComponent(typeof(WorldDlg))]
- public class PaintBrushDlg : UnitySingleton<PaintBrushDlg>
- {
- private Transform paintBrushGroupTran;
- private ToggleGroup paintBrushGroup;
- private ColorPaletteDlg colorPaletteDlg;
- private Button showColor;
- public Transform ShowColorBack;
- private Slider brushSlider;
- // Start is called before the first frame update
- void Start()
- {
- WorldDlg dlg = GetComponent<WorldDlg>();
- paintBrushGroupTran = dlg.GetBreadthChild<Transform>("PaintBrushGroup");
- paintBrushGroup = dlg.GetBreadthChild<ToggleGroup>("PaintBrushGroup");
- showColor = dlg.GetBreadthChild<Button>("ShowColorBtn");
- ShowColorBack = dlg.GetBreadthChild<Transform>("ShowColorBack");
- brushSlider = dlg.GetBreadthChild<Slider>("BrushSlider");
- brushSlider.onValueChanged.AddListener(OnBrushValueChange);
- showColor.onClick.AddListener(ClickOnShowColor);
- colorPaletteDlg = transform.GetComponentInChildren<ColorPaletteDlg>(true);
- }
- private void OnBrushValueChange(float value)
- {
- DrawPener.Instance.radius = value;
- }
- public bool isok = false;
- public void ClickOnShowColor()
- {
- isok = !isok;
- colorPaletteDlg.gameObject.SetActive(isok);
- ShowColorBack.gameObject.SetActive(isok);
- }
- }
- }
|