示例#1
0
 private void Got(object sender, ChildChangedEventArgs e)
 {
     print(e.Snapshot.GetRawJsonValue());
 }
示例#2
0
 private void CartesianChart2_ChildChanged(object sender, ChildChangedEventArgs e)
 {
     throw new NotImplementedException();
 }
 void OnMissionAdded(object sender, ChildChangedEventArgs args)
 {
     Debug.Log("Mission added!");
     GetMissions();
 }
 private void HandleRoomChanged(object sender, ChildChangedEventArgs args)
 {
     //Odada bir değişiklik var ise odanın güncellenmesi tetiklenir.
     refreshedRoom = true;
 }
示例#5
0
 private void ElementHost1_ChildChanged(object sender, ChildChangedEventArgs e)
 {
 }
示例#6
0
 void HasChildren_ChildChanged(object sender, ChildChangedEventArgs e)
 {
     BusinessRules.CheckRules(ChildListProperty);
 }
示例#7
0
 public void UpdateLobbyChatTrigger(object sender, ChildChangedEventArgs args)
 {
     Debug.Log(args.Snapshot.ToString());
 }
示例#8
0
 private void Model_ChildChanged(object sender, ChildChangedEventArgs e)
 {
     OnSetProperties();
 }
示例#9
0
 private void MyChildChanged(object sender, ChildChangedEventArgs e)
 {
     Debug.Print(e.ChildObject.ToString(), e.ListChangedArgs);
 }
    public void OnShotAdded(object sender2, ChildChangedEventArgs data)
    {
        Debug.Log("A new shot is added");

        if (data.Snapshot != null)
        {
            string shotName  = data.Snapshot.Child("name").Value.ToString();
            string shotOwner = data.Snapshot.Child("owner_name").Value.ToString();

            if (shotOwner.Equals(gameManager.LocalID))
            {
                Debug.Log("We already handled this!");
                return;
            }

            LauncherShot shot = new LauncherShot();
            shot.Name      = shotName;
            shot.OwnerName = shotOwner;
            shot.Owner     = gameManager.GetLauncher(shot.OwnerName);

            string timeToImpact = data.Snapshot.Child("time_to_impact").Value.ToString();
            shot.TimeToImpact = float.Parse(timeToImpact);

            string powerSettingString = data.Snapshot.Child("power_setting").Value.ToString();
            shot.PowerSetting = float.Parse(powerSettingString);

            string   startPosString = data.Snapshot.Child("start_pos").Value.ToString();
            string[] startPosArray  = startPosString.Split(',');
            Vector3  startPos       = new Vector3(
                float.Parse(startPosArray[0]),
                float.Parse(startPosArray[1]),
                float.Parse(startPosArray[2]));
            shot.StartPos = startPos;

            string   velocityString = data.Snapshot.Child("velocity").Value.ToString();
            string[] velocityArray  = velocityString.Split(',');
            Vector3  velocity       = new Vector3(
                float.Parse(velocityArray[0]),
                float.Parse(velocityArray[1]),
                float.Parse(velocityArray[2]));
            shot.Velocity = velocity;

            string   impactPosString = data.Snapshot.Child("impact_pos").Value.ToString();
            string[] impactArray     = impactPosString.Split(',');
            Vector3  impactPos       = new Vector3(
                float.Parse(impactArray[0]),
                float.Parse(impactArray[1]),
                float.Parse(impactArray[2]));
            shot.ImpactPos = impactPos;

            string doesHit = data.Snapshot.Child("does_hit").Value.ToString();
            shot.DoesHit = doesHit.Equals("true") ? true : false;
            string boardHit = data.Snapshot.Child("board_hit").Value.ToString();
            shot.BoardHit = boardHit.Equals("true") ? true : false;

            string hasDebris = data.Snapshot.Child("has_debris").Value.ToString();
            shot.HasDebris = hasDebris.Equals("true") ? true : false;

            shot.DebrisName = data.Snapshot.Child("debris_name").Value.ToString();

            string   debrisOffsetString = data.Snapshot.Child("debris_offset").Value.ToString();
            string[] debrisOffsetArray  = debrisOffsetString.Split(',');
            Vector3  debrisPos          = new Vector3(
                float.Parse(debrisOffsetArray[0]),
                float.Parse(debrisOffsetArray[1]),
                float.Parse(debrisOffsetArray[2]));
            shot.DebrisOffset = debrisPos;

            gameManager.EnemyShot(shot);
        }
    }
 private void GeckoBrowser_ChildChanged(object sender, ChildChangedEventArgs e)
 {
 }
示例#12
0
        private void ContainerOnChildAdded(object sender, ChildChangedEventArgs e)
        {
            var parentsNodes = treeControlsAndEntities.Nodes.Descendants().FirstOrDefault(n => n.Tag == sender)?.Nodes;

            BuildControlTree(parentsNodes, e.ChangedChild);
        }
        /// <summary>
        /// Callback when a score record is added with a score high enough for a spot on the
        /// leaderboard.
        /// </summary>
        private void OnScoreAdded(object sender, ChildChangedEventArgs args)
        {
            if (args.Snapshot == null || !args.Snapshot.Exists)
            {
                return;
            }

            var score = UserScore.CreateScoreFromRecord(args.Snapshot);

            if (score == null)
            {
                return;
            }

            // Verify that score is within start/end times, and isn't already in TopScores.
            if (TopScores.Contains(score))
            {
                return;
            }

            if (EndTime > 0 || Interval > 0)
            {
                var EndTimeInternal = EndTime > 0 ?
                                      EndTime :
                                      (DateTime.UtcNow.Ticks / TimeSpan.TicksPerSecond);
                var startTime = Interval > 0 ? EndTimeInternal - Interval : 0;
                if (score.Timestamp > EndTimeInternal || score.Timestamp < startTime)
                {
                    return;
                }
            }

            // Don't add if the same user already has a better score.
            // If the same user has a worse score, remove it.
            var existingScore = TopScores.Find(s => s.UserID == score.UserID);

            if (existingScore != null)
            {
                var bestScore = GetBestScore(existingScore, score);
                if (existingScore == bestScore)
                {
                    return;
                }
                TopScores.Remove(existingScore);
            }
            if (TopScores.Any(s => s.UserID == score.UserID))
            {
                return;
            }

            TopScores.Add(score);
            if (LowestFirst)
            {
                TopScores = TopScores.OrderBy(s => s.Score).Take(ScoresToRetrieve).ToList();
            }
            else
            {
                TopScores = TopScores.OrderByDescending(s => s.Score).Take(ScoresToRetrieve).ToList();
            }
            sendUpdateTopScoresEvent = true;
        }
示例#14
0
 private void CartesianChart1_ChildChanged(object sender, ChildChangedEventArgs e)
 {
 }
 public windowAsControl()
 {
     onAdd += new ChildChangedEventArgs(windowAsControl_onAdd);
     onRemove += new ChildChangedEventArgs(windowAsControl_onRemove);
 }
示例#16
0
 private void ElementHost1_ChildChanged(object sender, ChildChangedEventArgs e)
 {
 }
 public Button()
 {
     onAdd += new ChildChangedEventArgs(Button_onAdd);
     onRemove += new ChildChangedEventArgs(Button_onRemove);
 }
示例#18
0
 private void eh_admin_ChildChanged(object sender, ChildChangedEventArgs e)
 {
 }
示例#19
0
    void HandleChildChanged(object sender, ChildChangedEventArgs args)
    {
        if (args.DatabaseError != null)
        {
            Debug.LogError(args.DatabaseError.Message);
            return;
        }
        // Do something with the data in args.Snapshot
        Debug.Log(args.Snapshot);
        if (args.Snapshot.Key == "isGamestart")
        {
            if ((int)(long)args.Snapshot.Value == 1)
            {
                PlayerPrefs.SetInt("isGamestartEnemy", 1);
                if (PlayerPrefs.GetInt("isGamestartUser") == 1)
                {
                    if (PlayerPrefs.GetInt("myturn") == 1)
                    {
                        //攻撃
                        textMain.SetActive(true);
                        textNumber.SetActive(false);
                        textResult.SetActive(false);
                        textMain.GetComponent <Text>().text = "あなたのターンです";
                        PlayerPrefs.SetInt("isGamestartUser", 0);
                        PlayerPrefs.SetInt("isGamestartEnemy", 0);
                        keybord.SetActive(true);
                    }
                    else
                    {
                        //守備
                        textMain.SetActive(true);
                        textNumber.SetActive(false);
                        textResult.SetActive(false);
                        textMain.GetComponent <Text>().text = "相手のターンです";
                        PlayerPrefs.SetInt("isGamestartUser", 0);
                        PlayerPrefs.SetInt("isGamestartEnemy", 0);
                        keybord.SetActive(false);
                    }
                }
            }
        }
        if (args.Snapshot.Key == "data")
        {
            //相手がナンバーをコールしたらそのナンバーとeatbiteを取得
            FirebaseDatabase.DefaultInstance
            .GetReference("online")
            .GetValueAsync().ContinueWith(task => {
                if (task.IsFaulted)
                {
                }
                else if (task.IsCompleted)
                {
                    DataSnapshot snapshot            = task.Result;
                    Dictionary <string, object> data = new Dictionary <string, object>();
                    data = snapshot.Child("room").Child(PlayerPrefs.GetString("roomnum_str")).
                           Child(PlayerPrefs.GetString("enemyid")).Child("data").Value as Dictionary <string, object>;

                    Debug.Log(data);

                    textMain.SetActive(false);
                    textNumber.SetActive(false);
                    textResult.SetActive(true);
                    textResult.transform.GetChild(0).gameObject.GetComponent <TextMeshProUGUI>().text = data["callnum"].ToString();
                    textResult.transform.GetChild(1).gameObject.GetComponent <TextMeshProUGUI>().text = data["eat"].ToString();
                    textResult.transform.GetChild(2).gameObject.GetComponent <TextMeshProUGUI>().text = data["bite"].ToString();

                    reference.Child("online").Child("room").Child(PlayerPrefs.GetString("roomnum_str")).
                    Child(PlayerPrefs.GetString("userid")).Child("myturn").SetValueAsync(1);
                    PlayerPrefs.SetInt("myturn", 1);

                    if (int.Parse(data["eat"].ToString()) == 3)
                    {
                        Debug.Log("lose");
                        Invoke("ShowLose", 1.5f);
                    }
                    else
                    {
                        PlayerPrefs.SetInt("myturn", 1);
                        Invoke("Ready", 2.5f);
                    }
                }
            });
        }
    }
示例#20
0
 private void dataObject_ChildChanged(object sender, ChildChangedEventArgs e)
 {
     RefreshCanOperationsValues();
 }
示例#21
0
 private void WindowsFormsHost_ChildChanged(object sender, ChildChangedEventArgs e)
 {
 }
 private void propChangedObj_ChildChanged(object sender, ChildChangedEventArgs e)
 {
     ResetControls();
 }
示例#23
0
 private void HandleChatChanged(object sender, ChildChangedEventArgs args)
 {
     refreshedChat = true;
 }