Esempio n. 1
0
        public override void UpdateView()
        {
            if (targetView != null && targetView.model is Model.Character.MCharacter)
            {
                vListChild.UpdateView(targetView.model);
                return;
            }
            object val = this.GetByPath(BindPath);

            if (val != null)
            {
                vListChild.UpdateView(val as MBase);
            }
        }
Esempio n. 2
0
        public override void UpdateView()
        {
            if (targetView != null && targetView.model is Model.Character.MCharacter)
            {
                vListChild.UpdateView(targetView.model);
                return;
            }
            object val = this.GetByPath(BindPath);

            UnityEngine.Debug.LogError("VBindCharacterIcon val=" + val);
            if (val != null)
            {
                vListChild.UpdateView(val as MBase);
            }
        }
Esempio n. 3
0
        public override void OnClickView(VBase view)
        {
            View.Common.Bind.VBindList vBindList = view.transform.parent.GetComponent <View.Common.Bind.VBindList>();
            VBaseListChild             child     = view as VBaseListChild;

            Model.Character.MCharacter mCharacter = child.model as Model.Character.MCharacter;
            if (vBindList.BindPath == "selectedCharacters")
            {
                mCharacter = System.Array.Find(Global.SUser.self.characters, chara => chara.characterId == mCharacter.characterId);
            }
            if (mCharacter.isSelected == 0 && selectedCharacters.Count == battleFieldMaster.owns.Length)
            {
                return;
            }
            mCharacter.isSelected = mCharacter.isSelected == 0 ? 1 : 0;
            child.UpdateView(mCharacter);
            if (mCharacter.isSelected == 1)
            {
                selectedCharacters.Add(mCharacter.Clone());
            }
            else
            {
                selectedCharacters.RemoveAt(selectedCharacters.FindIndex(chara => chara.characterId == mCharacter.characterId));
            }
            this.dispatcher.Set("selectedCharacters", selectedCharacters.ToArray());
            this.dispatcher.Notify();
        }
Esempio n. 4
0
 void ChangeBattleCharacterPreviewDialog(MCharacter mCharacter)
 {
     if (mCharacter == null)
     {
         characterPreview.gameObject.SetActive(false);
     }
     else
     {
         characterPreview.gameObject.SetActive(true);
         characterPreview.UpdateView(mCharacter);
     }
 }