Beispiel #1
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();
        }
Beispiel #2
0
        public override void OnClickView(VBase view)
        {
            Debug.LogError("OnClickView " + view);
            VBaseListChild childView = view.GetComponent <VBaseListChild>();

            this.dispatcher.Set("currentCharacter", childView.model);
            this.dispatcher.Notify();
        }
Beispiel #3
0
 public override void Awake()
 {
     base.Awake();
     vListChild = GetComponent <VBaseListChild>();
     if (target != null)
     {
         targetView = target.GetComponent <VBaseListChild>();
     }
 }