Exemple #1
0
    public void Write_outside(string name)
    {
        character_data data = new character_data();
        string         json = JsonUtility.ToJson(data);

        databaseReference.Child("users").Child(name).SetRawJsonValueAsync(json);
    }
Exemple #2
0
    public void write()
    {
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://rpgshoot2.firebaseio.com/");
        databaseReference = FirebaseDatabase.DefaultInstance.RootReference;

        if (login_join.user != null)
        {
            character_data data = new character_data();
            string         json = JsonUtility.ToJson(data);
            databaseReference.Child("users").Child(login_join.user.UserId).SetRawJsonValueAsync(json);
        }
    }
Exemple #3
0
 // Start is called before the first frame update
 void Start()
 {
     chara      = Instantiate(data);                                         //instanciate the GameObject
     chara_data = chara.GetComponent <character_data>();                     //create an instance of the class character_data
     chara_data.get_data(chara_data.id);                                     //populate the variables in character_data by using get_data(id)
 }