// Note(Brandon): The start function will not be called on a disabled gameObject. public void Start() { if (!menuPlacement) { throw new UnassignedReferenceException("menuPlacement"); } ColorPickerManager.AssignMenuPlacement(menuPlacement); ColorPickerManager.InitListeners(); }
/* * * /!\ Don't forget to make the texture readable. Select your texture in the Inspector. Choose [Texture Import Setting] > Texture Type > Advanced > Read/Write enabled > True, then Apply. * */ public void Start() { if (!colorImageObject) { throw new UnassignedReferenceException("colorImageObject"); } ColorPickerManager.AssignComponentReferences(lineRenderers, triggers, handCamera, colorImageObject, selectedColorCursor, previewColorCursor, selectedColorDisplay, previewColorDisplay); TryGrabPlayerDrawTargets(); }
public void Awake() { ColorPickerManager.Init(); }
// Stop selecting color, because OnPointerExit will not fire if the GameObject is disabled. public void OnDisable() { ColorPickerManager.StopSelectingColor(); }
public void OnPointerUp(PointerEventData eventData) { ColorPickerManager.StopDragging(); }
public void OnPointerDown(PointerEventData eventData) { ColorPickerManager.StartDragging(); }
public void OnPointerExit(PointerEventData eventData) { ColorPickerManager.StopPreviewing(); }
public void OnPointerEnter(PointerEventData eventData) { ColorPickerManager.StartPreviewing(); }
// Change color marker to match image selection location public void OnPointerClick(PointerEventData eventData) { ColorPickerManager.SetSelectedColorCursorPosition(eventData); }
public void Update() { ColorPickerManager.UpdateColors(); }