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; }
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; }
void Start() { card=Data.Card.find(name); }
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(); }); }
public void setHero(string name) { hero=Card.findByName(name); }