public void MakeEnter(PnjBehavior pnj) { pnj.transform.parent = transform; pnj.GetComponent <PnjBehavior>().initTile = initTile; pnj.GetComponent <PnjBehavior>().container = GetComponent <TilesBehavior>(); GameList.Instance.AddPnj(pnj.GetComponent <PnjBehavior>()); pnj.Activate(); }
public bool Entering(PnjBehavior pnj) { if (visitor[0] == null) { pnj.GetComponent <SpriteRenderer>().enabled = false; visitor[0] = pnj.GetComponent <PnjDungeon>(); visitor[0].Restart(); return(true); } else { return(false); } }
public void SetPnj(PnjBehavior pnj) { image.sprite = pnj.GetComponent <SpriteRenderer>().sprite; title.text = pnj.pnjName; stat0.text = "Life : " + pnj.life + "/" + pnj.lifeMax + "\nDamage : " + pnj.damage + "\nMoney : " + pnj.money; stat1.text = "Shop : " + pnj.shopMax + "\nAdventure : " + pnj.adventureMax + "\nQuest : " + pnj.questFinished + "\nKilled :" + pnj.monsterKilled; }
public Sprite GetImage() { if (pnj1 != null) { return(pnj1.GetComponent <SpriteRenderer>().sprite); } else if (class1 != null) { return(class1.members[0].GetComponent <SpriteRenderer>().sprite); } else if (building1 != null) { return(building1.image); } else if (monster1 != null) { return(monster1.image); } else if (adventure != 0) { return(GameUtilities.Instance.compass); } return(null); }
public bool Use(PnjBehavior pnj) { if (clientNumb < clientMax) { clientNumb++; for (int i = 0; i < clientMax; i++) { if (clients[i] == null) { clients[i] = pnj; time[i] = timeRestore; GetComponent <Facility>().Use(pnj); pnj.GetComponent <SpriteRenderer>().enabled = false; pnj.inDungeon = true; break; } } return(true); } else { return(false); } }
public void Exiting(PnjBehavior pnj) { pnj.GetComponent <SpriteRenderer>().enabled = true; pnj.inDungeon = false; pnj.GetComponent <PnjDungeon>().Restart(); }