Пример #1
1
 void Awake()
 {
     base.Awake();
     nguiBc=Instantiate(nguiBcPrefab) as NguiButton;
     nguiBc.name=nguiBcPrefab.name;
     nguiBc.chess=this;
     // nguiBc.transform.parent=nguiBcPrefab.transform;
     var na=GetComponent<NguiAnchor>();
     na.ngui=nguiBc.transform;
     c=GetComponent<Creature>();
     card=Data.Card.find(name.Replace("(Clone)",""));
     hp.length=card.life;
 }
Пример #2
0
 public bool contains(Card card)
 {
     var list=new List<Card>(cards);
     list.Add(hero);
     foreach(var e in list.ToArray()){
     if(e.name==card.name)return true;
     }
     return false;
 }
Пример #3
0
 void Start()
 {
     card=Data.Card.find(name);
 }
Пример #4
0
 void fetchCards()
 {
     if(Data.Card.cards!=null)return;
     var query = ParseObject.GetQuery("Card");
     status="cards all data is fetching";
     task=query.FindAsync().ContinueWith(t =>{
     List<Data.Card> lCards=new List<Data.Card>();
     foreach(var po in t.Result){
         Data.Card card=new Data.Card(po);
         lCards.Add(card);
     }
     status="cards all data fetching succeeded";
     Data.Card.cards=lCards.ToArray();
     });
 }
Пример #5
0
 public void setHero(string name)
 {
     hero=Card.findByName(name);
 }