示例#1
0
        public void OnLevelWasInitialized(int level)
        {
            // Stub
            if (Environment.CommandLine.Contains("--vr"))
            {
                if (!_FXInitialized && (VR.Settings as HoneySettings).ApplyShaders && Camera.main)
                {
                    VR.Camera.CopyFX(Camera.main);
                    _Effector = VR.Camera.gameObject.AddComponent <VRConfigEffector>();
                    _Effector.Reset();
                    _FXInitialized = true;
                }

                //SoundShim.Inject();
                VoiceShim.Inject();

                // [PLAY TOOL ANIMATIONS] Ver 1
                var scene = GameObject.FindObjectOfType <HScene>();
                if (scene && scene.sprite)
                {
                    var dummy = HSceneSpriteDummy.Create(scene.sprite);
                    var procs = typeof(HScene).GetField("lstProc", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(scene) as List <ProcBase>;
                    foreach (var proc in procs)
                    {
                        typeof(ProcBase).GetField("sprite", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(proc, dummy);
                    }
                }
            }
        }
示例#2
0
        public static void Inject()
        {
            var original = Instance;

            if (original && !(original is VoiceShim))
            {
                //var shim = new GameObject().AddComponent<SoundShim>();
                VoiceShim shim = original.gameObject.CopyComponentFrom <Manager.Voice, VoiceShim>(original);
                instance           = shim;
                shim.originalSound = original;
                //Destroy(original);
            }
            //new GameObject("VRGIN_SoundShim")
            //Singleton<Manager.Sound>.instance = Singleton<SoundShim>.instance;
        }
示例#3
0
        public void OnApplicationStart()
        {
            if (Environment.CommandLine.Contains("--vr"))
            {
                var context  = new HoneyContext();
                var settings = context.Settings as HoneySettings;

                // Enforce new default
                if (!File.Exists(NEW_DEFAULT_TOKEN))
                {
                    File.Create(NEW_DEFAULT_TOKEN);

                    settings.ApplyShaders = true;
                    settings.Save();
                }
                VRManager.Create <HoneyInterpreter>(context);
                VR.Manager.SetMode <HoneySeatedMode>();
                VoiceShim.Inject();
            }
        }