Exemplo n.º 1
0
    public void UpdateTarget(Transform hostTransform, GizmoShowSetting gizmoSetting)
    {
        if (HostTransform == hostTransform)
        {
            DisableGizmos();
            HostTransform = null;
            return;
        }

        //TODO FIX
        HostTransform = hostTransform;
        var rot = hostTransform.rotation;

        HostTransform.rotation = Quaternion.identity;
        var bounds = BoundsHelper.GetBounds(HostTransform);

        HostTransform.rotation = rot;
        transform.rotation     = rot;
        Center       = bounds.center;
        positionDiff = Center - HostTransform.transform.position;

        xArrow.SetActive(gizmoSetting.movement);
        yArrow.SetActive(gizmoSetting.movement);
        zArrow.SetActive(gizmoSetting.movement);
        if (useNegativeAxis)
        {
            negativexArrow.SetActive(gizmoSetting.movement);
            negativeyArrow.SetActive(gizmoSetting.movement);
            negativezArrow.SetActive(gizmoSetting.movement);
        }

        roll.SetActive(gizmoSetting.rotation);
        yaw.SetActive(gizmoSetting.rotation);
        pitch.SetActive(gizmoSetting.rotation);
    }
Exemplo n.º 2
0
    public void OnInputClicked(InputClickedEventData eventData)
    {
        var gizmoSetting = new GizmoShowSetting();

        gizmoSetting.movement = ArrowMovement;
        gizmoSetting.rotation = ArrowRotation;
        StandardGizmoManager.Instance.UpdateTarget(HostTransform, gizmoSetting);
    }