示例#1
0
        public override void OnHandEntered()
        {
            Debug.LogError("This is an example error message!");

            numErrorsTriggered++;
            VrDebugStats.SetStat("Errors", "Errors triggered", numErrorsTriggered);
        }
示例#2
0
        public override void OnHandEntered()
        {
            numWarningsTriggered++;

            // Log this to two separate categories
            VrDebugStats.SetStat("Gameplay", "Warnings triggered", numWarningsTriggered);
            VrDebugStats.SetStat("Errors", "Warnings triggered", numWarningsTriggered);

            Debug.LogWarning("This is a warning message!");
        }
示例#3
0
        public override void OnHandEntered()
        {
            // This message will go to the console and the vr console
            Debug.Log("Spawning ball number " + nextBallNumber);

            // This creates/updates a debug stat for the vr stats panel
            VrDebugStats.SetStat("Gameplay", "Num balls", nextBallNumber);

            // Now actually spawn the ball
            GameObject ball = GameObject.CreatePrimitive(PrimitiveType.Sphere);

            ball.name = "Ball " + nextBallNumber;
            ball.transform.position   = this.transform.position;
            ball.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
            ball.AddComponent <Rigidbody> ();

            nextBallNumber++;
        }
示例#4
0
 public void OnDisable()
 {
     VrDebugStats.AllowLogging(false);
 }
示例#5
0
        public void OnEnable()
        {
            VrDebugStats.AllowLogging(true);

            VirtualConsole.instance = this;
        }
        public override void OnHandEntered()
        {
            VrDebugStats.SetStat("Example", "Was exception triggered", true);

            throw new System.NullReferenceException("This is an example null reference exception");
        }