public void Initial() { if (palette == null) { palette = new Palette(); palette.LoadHSVT(1); } var hc = transform.Find("HTemplate"); if (hc != null) { var template = hc.GetComponent <HImage>(); if (template != null) { template.MainTexture = palette.texture; } } var htemp = transform.GetComponent <HImage>(); if (htemp != null) { htemp.MainTexture = Palette.LoadCTemplate(); } var sli = transform.Find("Slider"); if (sli != null) { var slider = sli.GetComponent <HImage>(); if (slider != null) { slider.MainTexture = Palette.AlphaTemplate(); } } }
public override void Initial(ModelElement mod) { palette = new Palette(); callBackR = EventCallBack.RegEvent <EventCallBack>(mod); callBackR.IsCircular = true; callBackR.Drag = callBackR.DragEnd = DragingR; callBackR.PointerDown = PointDownR; NobA = mod.Find("NobA"); NobB = mod.Find("NobB"); hc = mod.Find("HTemplate"); template = hc.GetComponent <RawImageElement>(); callBackC = EventCallBack.RegEvent <EventCallBack>(hc); callBackC.Drag = callBackC.DragEnd = DragingC; callBackC.PointerDown = PointDownC; htemp = mod.GetComponent <RawImageElement>(); ThreadMission.InvokeToMain((o) => { htemp.Context.texture = Palette.LoadCTemplateAsync(); template.Context.texture = palette.texture; slider.Context.texture = Palette.AlphaTemplate(); }, null); palette.LoadHSVTAsync(1); SelectColor.a = 1; var son = mod.Find("Slider"); slider = son.GetComponent <RawImageElement>(); uISlider = new UISlider(); uISlider.Initial(son); uISlider.OnValueChanged = AlphaChanged; uISlider.Percentage = 1; }
public override void Initial(ModelElement mod) { mod.InstantiateChild(); var rect = mod.Context; palette = new Palette(); callBackR = EventCallBack.RegEvent <EventCallBack>(rect); callBackR.IsCircular = true; callBackR.Drag = callBackR.DragEnd = DragingR; callBackR.PointerDown = PointDownR; NobA = rect.Find("NobA") as RectTransform; NobB = rect.Find("NobB") as RectTransform; hc = rect.Find("HTemplate") as RectTransform; template = hc.GetComponent <RawImage>(); callBackC = EventCallBack.RegEvent <EventCallBack>(hc); callBackC.Drag = callBackC.DragEnd = DragingC; callBackC.PointerDown = PointDownC; htemp = rect.GetComponent <RawImage>(); htemp.texture = Palette.LoadCTemplateAsync(); template.texture = palette.texture; palette.LoadHSVTAsyncM(1); SelectColor.a = 1; var son = mod.Find("Slider"); slider = son.Context.GetComponent <RawImage>(); slider.texture = Palette.AlphaTemplate(); uISlider = new UISlider(); uISlider.Initial(son); uISlider.OnValueChanged = AlphaChanged; uISlider.Percentage = 1; }
public override void Initial(FakeStruct fake, UIElement element) { base.Initial(fake, element); palette = new Palette(); callBackR = element.RegEvent <UserEvent>(); callBackR.IsCircular = true; callBackR.Drag = callBackR.DragEnd = DragingR; callBackR.PointerDown = PointDownR; var mod = element.transform; NobA = mod.Find("NobA"); NobB = mod.Find("NobB"); hc = mod.Find("HTemplate"); template = hc.GetComponent <HImage>(); callBackC = template.RegEvent <UserEvent>(); callBackC.Drag = callBackC.DragEnd = DragingC; callBackC.PointerDown = PointDownC; htemp = mod.GetComponent <HImage>(); htemp.MainTexture = Palette.LoadCTemplateAsync(); template.MainTexture = palette.texture; palette.AwaitLoadHSVT(1); SelectColor.a = 1; var son = mod.Find("Slider"); slider = son.GetComponent <HImage>(); slider.MainTexture = Palette.AlphaTemplate(); uISlider = slider.composite as UISlider; uISlider.OnValueChanged = AlphaChanged; uISlider.Percentage = 1; }
public override void Initial(FakeStruct fake, UIElement element, UIInitializer initializer) { base.Initial(fake, element, initializer); palette = new Palette(); callBackR = element.RegEvent <UserEvent>(new UICircleCollider()); callBackR.Drag = callBackR.DragEnd = DragingR; callBackR.PointerDown = PointDownR; NobA = element.Find("NobA"); NobB = element.Find("NobB"); hc = element.Find("HTemplate"); template = hc as HImage; callBackC = template.RegEvent <UserEvent>(); callBackC.Drag = callBackC.DragEnd = DragingC; callBackC.PointerDown = PointDownC; htemp = element as HImage; htemp.MainTexture = Palette.LoadCTemplateAsync(); template.MainTexture = palette.texture; palette.AwaitLoadHSVT(1); SelectColor.a = 1; var son = element.Find("Slider"); slider = son as HImage; slider.MainTexture = Palette.AlphaTemplate(); uISlider = slider.composite as UISlider; uISlider.OnValueChanged = AlphaChanged; uISlider.Percentage = 1; }