protected virtual void XYAxisPointerDownCallback(PointerEventData pointerEventData) { selectingAxis = true; currSelectedAxis = SELECTED_AXIS.XY_AXIS; xAxisSpriteRenderer.color = Color.yellow; yAxisSpriteRenderer.color = Color.yellow; xyAxisSpriteRenderer.color = Color.yellow; }
protected virtual void XYAxisPointerUpCallback(PointerEventData pointerEventData) { selectingAxis = false; currSelectedAxis = SELECTED_AXIS.NONE; Ray mouseRay = cachedMainCamera.ScreenPointToRay(Input.mousePosition); RaycastHit hit; LayerMask layerMask = LayerMask.GetMask("MapEditorInSceneObject"); if (Physics.Raycast(mouseRay, out hit, cachedMainCamera.farClipPlane, layerMask)) { if (hit.collider.transform.name == "xyAxisTrigger") { xAxisSpriteRenderer.color = Color.white; yAxisSpriteRenderer.color = Color.white; xyAxisSpriteRenderer.color = Color.white; } else if (hit.collider.transform.name == "xAxisTrigger") { xAxisSpriteRenderer.color = Color.white; yAxisSpriteRenderer.color = Color.green; xyAxisSpriteRenderer.color = Color.blue; } else if (hit.collider.transform.name == "yAxisTrigger") { xAxisSpriteRenderer.color = Color.red; yAxisSpriteRenderer.color = Color.white; xyAxisSpriteRenderer.color = Color.blue; } else { xAxisSpriteRenderer.color = Color.red; yAxisSpriteRenderer.color = Color.green; xyAxisSpriteRenderer.color = Color.blue; } } else { xAxisSpriteRenderer.color = Color.red; yAxisSpriteRenderer.color = Color.green; xyAxisSpriteRenderer.color = Color.blue; } SaveInSceneObjectData(); }