Esempio n. 1
0
        public static IKTool Create(GameObject container)
        {
            if (instance != null)
            {
                return(instance);
            }

            return(instance = container.AddComponent <IKTool>());
        }
Esempio n. 2
0
        protected override void OnAwake()
        {
            SaveLoadSceneHook.InstallHook();
            LoadFixHook.InstallHook();

            VR.Manager.SetMode <StudioStandingMode>();
            var gameObject = new GameObject("KKCharaStudioVR");

            DontDestroyOnLoad(gameObject);
            IKTool.Create(gameObject);
            VRControllerMgr.Install(gameObject);
            VRCameraMoveHelper.Install(gameObject);
            VRItemObjMoveHelper.Install(gameObject);
            gameObject.AddComponent <KKCharaStudioVRGUI>();
            DontDestroyOnLoad(VRCamera.Instance.gameObject);
        }
Esempio n. 3
0
        protected override void OnStart()
        {
            base.OnStart();

            try
            {
                VRLog.Debug("Loading GripMoveTool", new object[0]);
                _settings   = (VR.Manager.Context.Settings as KKCharaStudioVRSettings);
                internalGui = GUIQuad.Create(null);
                resetGUIPosition();
                internalGui.gameObject.AddComponent <MoveableGUIObject>();
                internalGui.gameObject.AddComponent <BoxCollider>();
                internalGui.IsOwned = true;
                DontDestroyOnLoad(internalGui.gameObject);
                CreatePointer();
                gripMenuHandler         = gameObject.AddComponent <GripMenuHandler>();
                gripMenuHandler.enabled = false;
            }
            catch (Exception ex)
            {
                VRLog.Debug(ex);
            }

            if (marker == null)
            {
                marker = new GameObject("__GripMoveMarker__");
                marker.transform.parent   = transform.parent;
                marker.transform.position = transform.position;
                marker.transform.rotation = transform.rotation;
            }

            if (_settings != null)
            {
                moveSelfButton     = EVRButtonId.k_EButton_Grip;
                moveSelfButtonName = "rgrip";
                grabScreenButton   = EVRButtonId.k_EButton_Axis1;
            }

            menuHandlder = GetComponent <MenuHandler>();
            ikTool       = IKTool.instance;
        }