Exemplo n.º 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");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
        }
Exemplo n.º 5
0
    private void Awake()
    {
        m_persistentProgression = new PlayerPrefsStore();

        CheckpointController.Initialise(m_persistentProgression);
    }