Пример #1
0
        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
        }
Пример #2
0
        public static string SceneGetName(SceneHandle scene)
        {
            var name = SceneGetNameNative(scene);

            string namestr;

            unsafe
            {
                namestr = new string((char *)name);
            }

            return(namestr);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public static extern TransformNative.TransformHandle SceneGetRoot(SceneHandle scene);
Пример #5
0
 public static extern ActiveOption SceneGetActive(SceneHandle scene);
Пример #6
0
 public static extern void SceneSetActive(SceneHandle scene, ActiveOption active);
Пример #7
0
 public static extern IntPtr SceneGetNameNative(SceneHandle scene);
Пример #8
0
 public static extern void SceneSetName(SceneHandle scene, string name);
Пример #9
0
 public static extern void SceneRemove(SceneHandle handle);