Beispiel #1
0
    private void Awake()
    {
        //If we don't currently have a game control...
        if (instance == null)
        {
            //...set this one to be it...
            instance = this;
        }
        //...otherwise...
        else if (instance != this)
        {
            //...destroy this one because it is a duplicate.
            Destroy(gameObject);
        }

        if (!FB.IsInitialized)
        {
            // Initialize the Facebook SDK
            Debug.Log("Initialize the Facebook SDK!");
            FB.Init(InitCallback, OnHideUnity);
        }
        else
        {
            // Already initialized, signal an app activation App Event
            FB.ActivateApp();
        }
        DontDestroyOnLoad(instance);
    }
 // public PasswordManager passwordManager;
 public void Awake()
 {
     authManager  = new LambdaWorkoutHistory();
     fbController = new FBController(authManager);
     HideAll();
     CheckLogin();
 }
    public void UploadScore()
    {
        string user_id  = FBController.getInstance().GetUserId();
        string username = FBController.getInstance().GetUsername();

        if (user_id == "")
        {
            user_id  = "0";
            username = "******";
        }

        StartCoroutine(ApiController.getInstance().HttpRequestAsync(
                           "score.php",
                           new Dictionary <string, string>()
        {
            { "user_id", user_id },
            { "score", "" + score },
            { "username", username }
        },
                           ApiController.TYPE_POST, callback));
    }
 public void LoginByFacebook()
 {
     FBController.getInstance().LoginToFacebook();
 }