public virtual void OnInputClicked(InputEventData eventData) { GazeableColorPicker colorPicker = FindObjectOfType <GazeableColorPicker>(); if (colorPicker != null && colorPicker.IsColoring) { Color col = colorPicker.PickedColor; GetComponentInChildren <Renderer>().material.SetColor("_Color", colorPicker.PickedColor); colorPicker.IsColoring = false; return; } // On each tap gesture, toggle whether the user is in placing mode. IsBeingPlaced = !IsBeingPlaced; // If the user is in placing mode, display the spatial mapping mesh. if (IsBeingPlaced) { spatialMappingManager.DrawVisualMeshes = true; Debug.Log(gameObject.name + " : Removing existing world anchor if any."); anchorManager.RemoveAnchor(gameObject); } // If the user is not in placing mode, hide the spatial mapping mesh. else { spatialMappingManager.DrawVisualMeshes = false; // Add world anchor when object placement is done. anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName); } }
public void OnInputClicked(InputEventData eventData) { if (GazeableColorPicker == null) { GazeableColorPicker = FindObjectOfType <GazeableColorPicker>(); } if (GazeableColorPicker != null && GazeableColorPicker.IsColoring) { Color col = GazeableColorPicker.PickedColor; GetComponentInChildren <Renderer>().material.SetColor("_Color", GazeableColorPicker.PickedColor); GazeableColorPicker.IsColoring = false; } }
void UpdateActions() { changcolor.SetActive(conquertap.canchangecolor); delet.GetComponent <ItemsN>().Init(() => { conquertap.ChangeState(ModelState.Dele); }); move.GetComponent <ItemsN>().Init(() => { conquertap.ChangeState(ModelState.Move); }); GazeableColorPicker picker = changcolor.GetComponentInChildren <GazeableColorPicker>(); //picker.Init(WorldSpaceUI.Instance.cursor); picker.OnPickedColor.RemoveAllListeners(); picker.OnPickedColor.AddListener(conquertap.Changcolor); }
private void Start() { colorPickerScript = GetComponentInChildren <GazeableColorPicker>(); colorPickerScript.OnPickedColor.AddListener(ColorPicked); }