private void InitSceneUI() { if (RotationRing == null) { RotationRing = GameObject.Instantiate(GameManager.I.Modular.RotationRingPrefab, Vector3.zero, Quaternion.identity).GetComponent <SceneHandle> (); } else { RotationRing.UpdateLocalScale(); // update scale } if (FastPlaceHandles == null) { FastPlaceHandles = GameObject.Instantiate(GameManager.I.Modular.FastMoveHandlePrefab, Vector3.zero, ScopedObject.Rotation).GetComponent <SceneHandle> (); } else { FastPlaceHandles.UpdateLocalScale(); // update scale } RotationRing.Interactable = false; FastPlaceHandles.Interactable = false; HideRotationRing(); // hide ring after init HideFastPlaceHandles(); // hide fast place handles }
public static string SceneGetName(SceneHandle scene) { var name = SceneGetNameNative(scene); string namestr; unsafe { namestr = new string((char *)name); } return(namestr); }
private void InitSceneUI() { // init position handle PositionHandle = GameObject.Instantiate(GameManager.I.Modular.PositionHandles, LocalMover.transform.position, Quaternion.identity).GetComponent <SceneHandle>(); PositionHandle.UpdateLocalScale(); PositionHandle.OnDragAction(0, OnPositionHandleDragZ); // Z axis PositionHandle.OnDragAction(1, OnPositionHandleDragY); // Y axis PositionHandle.OnDragAction(2, OnPositionHandleDragX); // X axis PositionHandle.OnGlobalMouseDown(OnPositionMouseDown); // Global on mouse down callback PositionHandle.OnGlobalMouseUp(OnPositionMouseUp); PositionHandle.gameObject.SetActive(false); UpdatePositionTransfrom(); // init Rotation Handle RotationHandle = GameObject.Instantiate(GameManager.I.Modular.RotationHandles, LocalMover.transform.position, Quaternion.identity).GetComponent <SceneHandle>(); RotationHandle.UpdateLocalScale(); RotationHandle.OnDragAction(0, OnRotationY); // Y axis RotationHandle.OnDragAction(1, OnRotationZ); // Z axis RotationHandle.OnDragAction(2, OnRotationX); // X axis RotationHandle.OnGlobalMouseDown(OnRotationMouseDown); RotationHandle.OnGlobalMouseUp(OnRotationGlobalMouseUp); RotationHandle.gameObject.SetActive(false); // set handle restrictions switch (_RotationRestriction) { case RotationRestrictions.Y: RotationHandle.SetHandleVisiblity(1, true); RotationHandle.SetHandleVisiblity(2, true); break; } UpdateRotationTransform(); // init scale Handle ScaleHandle = GameObject.Instantiate(GameManager.I.Modular.ScaleHandles, LocalMover.transform.position, Quaternion.identity).GetComponent <SceneHandle>(); ScaleHandle.UpdateLocalScale(); ScaleHandle.OnDragAction(0, OnScaleZ); ScaleHandle.OnDragAction(1, OnScaleY); ScaleHandle.OnDragAction(2, OnScaleX); ScaleHandle.OnDragAction(3, OnScaleAll); ScaleHandle.OnGlobalMouseDown(OnScaleMouseDown); ScaleHandle.OnGlobalMouseUp(OnScaleMouseUp); ScaleHandle.gameObject.SetActive(false); }
public static extern TransformNative.TransformHandle SceneGetRoot(SceneHandle scene);
public static extern ActiveOption SceneGetActive(SceneHandle scene);
public static extern void SceneSetActive(SceneHandle scene, ActiveOption active);
public static extern IntPtr SceneGetNameNative(SceneHandle scene);
public static extern void SceneSetName(SceneHandle scene, string name);
public static extern void SceneRemove(SceneHandle handle);