// Start is called before the first frame update void Start() { switch (gameObject.name) { case "herculesHead": { enemyPosition = "topleft"; break; } case "perseusHead": { enemyPosition = "botleft"; break; } case "achillesHead": { enemyPosition = "botright"; break; } case "ippoHead": { enemyPosition = "topright"; break; } } step = 1; Board.SetUpBoard(); FirebaseDatabase.ListenForValueChanged("game/positions/" + user.uid, gameObject.name, "OnValueChanged", "OnError"); FirebaseDatabase.ListenForValueChanged("rooms/room1/question/" + user.uid, gameObject.name, "OnQuestionChange", "OnQuestionError"); FirebaseDatabase.ListenForAnswer("rooms/room1/answers/" + user.uid, gameObject.name, "OnAnswerSuccess", "OnQuestionError"); }
// Start is called before the first frame update void Start() { Board.isMultiplayer = true; GetRoomStuff(); myUid = FirebaseManager.currentUser.uid; Debug.Log("I am : " + myUid); // Get from room //arrayOfUserUids[0] = "u6bnGbv3jyUnTSh5WPcslXfLCb03"; // ipo positions[0] = new Vector3(-17.7f, -17, 53); //arrayOfUserUids[1] = "eJsYWa9Wbvg5pUFYpDRmPc0StY12"; // achil positions[1] = new Vector3(-23.7f, -17, 47); //arrayOfUserUids[2] = "player3"; // hercules //positions[2] = new Vector3(-23.7f, -17, 53); //arrayOfUserUids[3] = "player4"; // perseus //positions[3] = new Vector3(-17.7f, -17, 47); // turnUid = arrayOfUserUids[0]; // DiceOnline.turnId = turnUid; DontDestroyOnLoad(gameObject); FirebaseDatabase.ListenForValueChanged("turn", gameObject.name, "OnValueChanged", "ErrorValueChanged"); }
public void OnUserSignedIn(string user) { FirebaseUser u = JsonUtility.FromJson <FirebaseUser>(user); // User signed in currentUser = u; FirebaseDatabase.ListenForValueChanged("users/" + currentUser.uid, gameObject.name, "OnUser", "OnUserSignedOut"); }
public void ListenForValueChanged() => FirebaseDatabase.ListenForValueChanged(pathInputField.text, gameObject.name, "DisplayData", "DisplayErrorObject");
// Start is called before the first frame update void Start() { Debug.Log("room key is : " + roomKey); FirebaseDatabase.ListenForValueChanged("rooms/" + roomKey, gameObject.name, "OnRoomGet", "OnError"); }
// Start is called before the first frame update void Start() { DontDestroyOnLoad(gameObject); FirebaseAuth.OnAuthStateChanged(gameObject.name, "OnUserSignedIn", "OnUserSignedOut"); FirebaseDatabase.ListenForValueChanged("test", gameObject.name, "OnValueChanged", "ErrorValueChanged"); }