예제 #1
0
        public override IEnumerator RunTest()
        {
            IoC.inject.SetSingleton <IPreferences>(PlayerPrefsStore.NewPreferencesUsingPlayerPrefs());
            LogConsole.RegisterForAllLogEvents(this);

            links = gameObject.GetLinkMap();
            links.Get <Button>("ButtonTestJsonLib").SetOnClickAction(delegate {
                TestJsonSerialization().LogOnError();
            });
            links.Get <Button>("ButtonTestPing").SetOnClickAction(delegate {
                StartCoroutine(TestCurrentPing(links.Get <InputField>("IpInput").text));
            });
            links.Get <Button>("ButtonShowToast").SetOnClickAction(delegate {
                Toast.Show("Hello World");
            });
            // Clicking multiple times on a button with an async action will only execute the first click:
            links.Get <Button>("ButtonRunAsyncMethod").SetOnClickAction(async delegate {
                await Task.Delay(2000);
                Toast.Show("Button waited 2 seconds");
            });

            yield return(new WaitForSeconds(0.5f));

            SimulateButtonClickOn("ButtonTestJsonLib");

            yield return(new WaitForSeconds(0.5f));

            SimulateButtonClickOn("ButtonTestPing");
        }
예제 #2
0
        public override IEnumerator RunTest()
        {
            IoC.inject.SetSingleton <IPreferences>(PlayerPrefsStore.NewPreferencesUsingPlayerPrefs());
            AppFlow.AddAppFlowTracker(new AppFlowToLog().WithAllTrackingActive());

            var links = gameObject.GetLinkMap();

            links.Get <Button>("OptionsButton").SetOnClickAction(delegate {
                gameObject.GetViewStack().ShowView("ExampleUi2_OptionsScreen", gameObject);
            });
            links.Get <Button>("UserDetailsButton").SetOnClickAction(ShowUserUi);
            yield return(null);
        }
예제 #3
0
        public void ExampleUsage1()
        {
            // In the setup logic of your application set the Preferences singleton to use the Unity PlayerPrefs:
            IoC.inject.SetSingleton <IPreferences>(PlayerPrefsStore.NewPreferencesUsingPlayerPrefs());

            string key1   = "key1";
            string value1 = "value1";
            var    prefs  = Preferences.instance;

            prefs.Set(key1, value1);
            string x = prefs.Get(key1, "defaultValue1").Result;

            prefs.Remove(key1); // cleanup
            Assert.AreEqual(value1, x);
        }
예제 #4
0
        public override IEnumerator RunTest()
        {
            IoC.inject.SetSingleton <IPreferences>(PlayerPrefsStore.NewPreferencesUsingPlayerPrefs());
            LogConsole.RegisterForAllLogEvents(this);

            links = gameObject.GetLinkMap();
            links.Get <Button>("ButtonTestJsonLib").SetOnClickAction(delegate { TestJsonSerialization().LogOnError(); });
            links.Get <Button>("ButtonTestPing").SetOnClickAction(delegate {
                StartCoroutine(TestCurrentPing(links.Get <InputField>("IpInput").text));
            });

            yield return(new WaitForSeconds(0.5f));

            SimulateButtonClickOn("ButtonTestJsonLib");

            yield return(new WaitForSeconds(0.5f));

            SimulateButtonClickOn("ButtonTestPing");
        }
예제 #5
0
    private void Awake()
    {
        m_persistentProgression = new PlayerPrefsStore();

        CheckpointController.Initialise(m_persistentProgression);
    }