Exemplo n.º 1
0
    void Start()
    {
        if (inst == null)
        {
            inst = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);

        if (SceneManager.GetActiveScene().name == "LoginMenu")
        {
            PlayerPrefs.DeleteAll();
            string j = PlayerPrefs.GetString("jwt", "");
            string e = KnightClubAPI.LoginWithJWT(jwt);
            if (e != null)
            {
                jwt = j;
                StartCoroutine(GameObject.Find("Login Manager").GetComponent <LoginManager>().TransitionToMainMenu());
            }
        }

        SceneManager.sceneLoaded += OnSceneLoaded;
    }
Exemplo n.º 2
0
    public void Login()
    {
        string e = emailIPF.text;
        string p = passwordIPF.text;

        KnightClubAPI.LoginWithUsernamePassword(GotLogin, e, p);
    }
Exemplo n.º 3
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         KnightClubAPI.ChangeCurrency(AddedCurrency, reward, GameManager.user.username);
         other.GetComponent <Player>().ChangeScenes(returnScene);
     }
 }
Exemplo n.º 4
0
 private void StartGame()
 {
     startedGame = true;
     PhotonNetwork.LocalPlayer.NickName = user.username;
     player      = PhotonNetwork.Instantiate("Player", Vector3.zero, Quaternion.identity, 0);
     player.name = "Player";
     KnightClubAPI.GetItem(SetShirtFromAPI, user.username, "shirt");
 }
Exemplo n.º 5
0
    private static void SetHeadwearP2(string res)
    {
        string newMoniesS = res.Substring(res.IndexOf(':') + 1);

        newMoniesS = newMoniesS.Remove(newMoniesS.Length - 2);

        int newMonies = int.Parse(newMoniesS);

        if (newMonies != -1)
        {
            inst.UpdateCurrency(newMonies);
            KnightClubAPI.SetItem(SetShirtCompleted, user.username, "shirt", targetShirt);
        }
    }
Exemplo n.º 6
0
 private void Start()
 {
     instance = this;
 }
Exemplo n.º 7
0
 public static void SetHeadwear(string itemname, int cost)
 {
     targetShirt = itemname;
     KnightClubAPI.ChangeCurrency(SetHeadwearP2, -cost, user.username);
 }
Exemplo n.º 8
0
 private static void SetShirtCompleted(string res)
 {
     KnightClubAPI.GetItem(inst.SetShirtFromAPI, user.username, "shirt");
 }