Esempio n. 1
0
    /// <summary>
    /// /*/*/*Required Initialization Code.*/*/*/
    /// </summary>
    /// 
    void OnGUI()
    {
        GUI.skin = customSkin;
        float dh = (Screen.height - 20) / 12;
        GUILayout.BeginArea(new Rect(10, 10, Screen.width - 20, Screen.height - 20));
        GUI.skin.button.fixedHeight = dh;
        GUI.skin.button.fixedWidth = Screen.width - 20;
        GUI.skin.textField.wordWrap = true;
        GUI.skin.textField.fixedWidth = Screen.width - 20;
        GUI.skin.textField.fixedHeight = dh * 0.6f;
        GUI.skin.label.alignment = TextAnchor.MiddleLeft;

        GUILayout.Label ("Status: " + Status, GUILayout.MaxHeight(dh * 0.7f));

        if (currentScreen == null)
        {
            if (GUILayout.Button("Billing"))
            {
                currentScreen = billingExample;
            }
            if (GUILayout.Button("DataStorage"))
            {
                currentScreen = playerDataExample;
            }
            if (GUILayout.Button("Leaderboards"))
            {
                currentScreen = leaderboardsExample;
            }
            if (GUILayout.Button("Achievements"))
            {
                currentScreen = achievementsExample;
            }
            if (GUILayout.Button("License"))
            {
                currentScreen = licenseExample;
            }
            if (GUILayout.Button("Expansions"))
            {
                currentScreen = expansionsExample;
            }

            if (GUILayout.Button("Exit"))
            {
                Application.Quit();
            }
        }
        else
        {
            currentScreen.Draw();

            if (GUILayout.Button("Back"))
            {
                currentScreen = null;
            }
        }

        GUILayout.EndArea();
    }
Esempio n. 2
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         currentScreen = null;
     }
 }
Esempio n. 3
0
    /// <summary>
    /// /*/*/*Required Initialization Code.*/*/*/
    /// </summary>
    void Start()
    {
        Status = "Initializing...";
        PlayPhone.Plugin.IncrementTracking();
        PlayPhone.Plugin.OnInit += () =>
        {
            Status = "Successfuly initialized";
            PlayPhone.Plugin.ShowIcon();
            PlayPhone.Plugin.GetLaunchScreen();
            PlayPhone.Plugin.GetPlatformId();
        };
        PlayPhone.Plugin.OnInitError += (error) =>
        {
            Status = "Initialization failed: " + error;
        };

        PlayPhone.Plugin.OnLaunchScreen += (screen) =>
        {
            if (PlayPhone.Consts.PSGN_LAUNCH_SCREEN_OFFERS == screen) {
                currentScreen = billingExample;
            }
        };

        PlayPhone.Plugin.OnPlatformId += (platformId) => {};
        PlayPhone.Plugin.Init();
        PlayPhone.Plugin.DoLaunchAction(false);
    }