3D解剖功能
This commit is contained in:
parent
e3bc40bf8b
commit
194672f17c
@ -15,7 +15,7 @@ public class Body3DController : MonoSingleton<Body3DController>
|
|||||||
{
|
{
|
||||||
Normal = 1 << 0,
|
Normal = 1 << 0,
|
||||||
Active = 1 << 1,
|
Active = 1 << 1,
|
||||||
Move = 1 << 2,
|
Drag = 1 << 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
Body3DController() { }
|
Body3DController() { }
|
||||||
@ -87,6 +87,11 @@ public class Body3DController : MonoSingleton<Body3DController>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CheckStatus(Status status)
|
||||||
|
{
|
||||||
|
return (this.status & status) == status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void Active(bool isActive)
|
public void Active(bool isActive)
|
||||||
|
|||||||
@ -33,6 +33,15 @@ public class Body3DOjbItem : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
objToggle.OnValueChanged.AddListener(isOn =>
|
objToggle.OnValueChanged.AddListener(isOn =>
|
||||||
|
{
|
||||||
|
if (Body3DController.Instance.CheckStatus(Body3DController.Status.Active))
|
||||||
|
{
|
||||||
|
if (isOn == true)
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
colorToggle?.SetColor(isOn);
|
colorToggle?.SetColor(isOn);
|
||||||
objDrag = gameObject.GetOrAddComponent<ObjDrag>();
|
objDrag = gameObject.GetOrAddComponent<ObjDrag>();
|
||||||
@ -46,6 +55,8 @@ public class Body3DOjbItem : MonoBehaviour
|
|||||||
{
|
{
|
||||||
TypeEventSystem.Global.UnRegister<OnBody3DDragChanged>(OnBody3DDragHandler);
|
TypeEventSystem.Global.UnRegister<OnBody3DDragChanged>(OnBody3DDragHandler);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +72,7 @@ public class Body3DOjbItem : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (objToggle != null && objDrag != null)
|
if (objToggle != null && objDrag != null)
|
||||||
{
|
{
|
||||||
objDrag.isOn = objToggle.isOn && Body3DController.Instance.allowDrag;
|
objDrag.isOn = objToggle.isOn && Body3DController.Instance.CheckStatus(Body3DController.Status.Drag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
DragBtn.transform.Find("SubBtns").gameObject.SetActive(isOn);
|
DragBtn.transform.Find("SubBtns").gameObject.SetActive(isOn);
|
||||||
Body3DController.Instance.allowDrag = isOn;
|
Body3DController.Instance.allowDrag = isOn;
|
||||||
|
Body3DController.Instance.SetStatus(Body3DController.Status.Drag, isOn);
|
||||||
TypeEventSystem.Global.Send<OnBody3DDragChanged>();
|
TypeEventSystem.Global.Send<OnBody3DDragChanged>();
|
||||||
});
|
});
|
||||||
DragBack.onClick.AddListener(() =>
|
DragBack.onClick.AddListener(() =>
|
||||||
@ -27,6 +28,7 @@ namespace QFramework.Example
|
|||||||
ActiveBtn.onValueChanged.AddListener(isOn =>
|
ActiveBtn.onValueChanged.AddListener(isOn =>
|
||||||
{
|
{
|
||||||
ActiveBtn.transform.Find("SubBtns").gameObject.SetActive(isOn);
|
ActiveBtn.transform.Find("SubBtns").gameObject.SetActive(isOn);
|
||||||
|
Body3DController.Instance.SetStatus(Body3DController.Status.Active, isOn);
|
||||||
});
|
});
|
||||||
|
|
||||||
ActiveBack.onClick.AddListener(() =>
|
ActiveBack.onClick.AddListener(() =>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user