Example #1
0
    private void OnGUI()
    {
        GUIStyle buttonStyle = new GUIStyle(GUI.skin.button);

        buttonStyle.fontSize = 50;

        bool bPressed = GUI.Button(new Rect(200, 300, 600, 150), mButtonText, buttonStyle);

        if (bPressed && mOptedInState == AdendaPlugin.OPTED_OUT_STATE)
        {
            // Click event happened -- Opt the user IN
            AdendaPlugin.startAdendaLockscreen("9876543210", "m", "19900102");
        }
        else if (bPressed && mOptedInState == AdendaPlugin.OPTED_IN_STATE)
        {
            // Click event happened -- Opt the user OUT
            AdendaPlugin.stopAdendaLockscreen();
        }
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        AdendaPlugin.setUnlockType(AdendaPlugin.UNLOCK_TYPE_SLIDE);
        // ADENDA: Disable ads
        AdendaPlugin.setEnableAds(false);

        // Opt the user IN
        string sUserId = SystemInfo.deviceUniqueIdentifier;

        Debug.Log("USERID: " + sUserId);
        print("USERID: " + sUserId);

        if (!AdendaPlugin.isOptedIn())
        {
            AdendaPlugin.startAdendaLockscreen(sUserId, "m", "19900102", false);
        }

        if (AdendaPlugin.getNumberCustomEntries() <= 0)
        {
            AdendaPlugin.addUnityFragment(null, "Unity!", true, false, "Flappy", "startOnLockScreen", "");
        }
    }