Beispiel #1
0
 public void CharacterIconClick(VCharacterIcon vCharacterIcon)
 {
     if (!vCharacterIcon.isSelected && selectCharacterContent.childCount >= selectShadowContent.childCount)
     {
         CAlertDialog.Show("人数满了");
         return;
     }
     ToSelectCharacter(vCharacterIcon.ViewModel.CharacterId.Value, !vCharacterIcon.isSelected);
     vCharacterIcon.isSelected = !vCharacterIcon.isSelected;
 }
Beispiel #2
0
 private void ToSelectCharacter(int characterId, bool isSelected)
 {
     if (isSelected)
     {
         App.Model.MCharacter character = System.Array.Find(App.Util.Global.SUser.self.characters, _ => _.CharacterId == characterId);
         GameObject           shadowObj = Instantiate(selectShadow);
         shadowObj.SetActive(true);
         shadowObj.transform.SetParent(selectCharacterContent);
         shadowObj.transform.localScale = Vector3.one;
         GameObject obj = Instantiate(characterIcon);
         obj.transform.SetParent(shadowObj.transform);
         //obj.transform.localScale = Vector3.one * 0.65f;
         obj.transform.localScale = Vector3.one;
         VCharacterIcon vCharacterIcon = obj.GetComponent <VCharacterIcon>();
         vCharacterIcon.BindingContext = character.ViewModel;
         vCharacterIcon.UpdateView();
     }
     else
     {
         VCharacterIcon[] icons = selectCharacterContent.GetComponentsInChildren <VCharacterIcon>();
         VCharacterIcon   icon  = System.Array.Find(icons, _ => _.ViewModel.CharacterId.Value == characterId);
         GameObject.Destroy(icon.transform.parent.gameObject);
     }
 }
Beispiel #3
0
        public void CharacterIconClick(VCharacterIcon vCharacterIcon)
        {
            Request req = Request.Create("character_id", vCharacterIcon.ViewModel.CharacterId.Value);

            this.StartCoroutine(Global.SceneManager.ShowDialog(SceneManager.Prefabs.CharacterDetailDialog, req));
        }