Exemple #1
0
 public void ExecuteTests()
 {
     selfReference = this;
     TestCustomEvents();
     TestFunctionParameters();
     TestIntermediateReturn();
 }
Exemple #2
0
 public void ExecuteTests()
 {
     selfReference = this;
     TestCustomEvents();
     TestFunctionParameters();
     TestIntermediateReturn();
     TestObjectArrayArg();
     TestStringCopy();
 }
        public void ExecuteTests()
        {
            selfReference = this;
            TestCustomEvents();
            TestFunctionParameters();
            TestIntermediateReturn();
            TestObjectArrayArg();
            TestStringCopy();
            TestSetGetProgramVar();

            tester.TestAssertion("gameObject valid", gameObject.name == "LocalFunctionTests");
            MethodPropertyAliasingTest(gameObject.transform.parent.gameObject);
            tester.TestAssertion("gameObject valid 2", gameObject.name == "LocalFunctionTests");

            tester.TestAssertion("Variable declaration after methods", heyImDeclaredAfter == 4f);
        }
        void TestDelayed()
        {
            SendCustomEventDelayedSeconds(nameof(PrintThingDelayed), 4f);
            SendCustomEventDelayedSeconds(nameof(PrintThingDelayed), 4f, VRC.Udon.Common.Enums.EventTiming.Update);
            SendCustomEventDelayedSeconds(nameof(PrintThingDelayedLate), 4f, VRC.Udon.Common.Enums.EventTiming.LateUpdate);

            LocalFunctionTest myself = this;

            myself.SendCustomEventDelayedSeconds(nameof(PrintThingDelayed), 5f);
            myself.SendCustomEventDelayedFrames(nameof(PrintThingDelayed), 0);
            myself.SendCustomEventDelayedFrames(nameof(PrintThingDelayed), 1);
            myself.SendCustomEventDelayedFrames(nameof(PrintThingDelayedLate), 1, VRC.Udon.Common.Enums.EventTiming.LateUpdate);

            UdonBehaviour myselfUdon = (UdonBehaviour)(Component)myself;

            myselfUdon.SendCustomEventDelayedFrames(nameof(PrintThingDelayed), 10);
        }
        void TestDelayed()
        {
            SendCustomEventDelayedSeconds(nameof(PrintThingDelayed), 4f);
            SendCustomEventDelayedSeconds(nameof(PrintThingDelayed), 4f, VRC.Udon.Common.Enums.EventTiming.Update);
            SendCustomEventDelayedSeconds(nameof(PrintThingDelayedLate), 4f, VRC.Udon.Common.Enums.EventTiming.LateUpdate);

            LocalFunctionTest myself = this;

            myself.SendCustomEventDelayedSeconds(nameof(PrintThingDelayed), 5f);
            myself.SendCustomEventDelayedFrames(nameof(PrintThingDelayed), 0);
            myself.SendCustomEventDelayedFrames(nameof(PrintThingDelayed), 1);
            myself.SendCustomEventDelayedFrames(nameof(PrintThingDelayedLate), 1, VRC.Udon.Common.Enums.EventTiming.LateUpdate);

            // ReSharper disable once SuspiciousTypeConversion.Global
            // ReSharper disable once PossibleInvalidCastException
            UdonBehaviour myselfUdon = (UdonBehaviour)(Component)myself;

            myselfUdon.SendCustomEventDelayedFrames(nameof(PrintThingDelayed), 10);
        }