void OnSelectGameObject(object sender, SelectGameObjectArgs e)
 {
     if (String.IsNullOrEmpty (e.GameObject.name)) {
         selectedText.text = "Selected: None";
     } else {
         selectedText.text = "Selected: " + e.GameObject.name;
     }
 }
示例#2
0
        void OnSelectGameObject(object sender, SelectGameObjectArgs e)
        {
            var living = e.GameObject.GetComponent<Living> ();

            if (living == null) {
                panel.SetActive (false);
                if (current_living != null) {
                    current_living.Life.ValueChange -= new EventHandler<ObservableEventArgs<int>> (OnLivingValueChange);
                }
            } else {
                panel.SetActive (true);
                current_living = living;
                current_living.Life.ValueChange += new EventHandler<ObservableEventArgs<int>> (OnLivingValueChange);
                updateText (living.Life.ToString ());
            }
        }
 void OnSelectGameObject(object sender, SelectGameObjectArgs e)
 {
     var inventory = e.GameObject.GetComponentInChildren<Inventory> ();
     this.gameObject.SetActive (inventory != null);
     RefreshScrollView (inventory);
 }