private void FindSomethingToLookAt() { List <Vector3> list = new List <Vector3>(); ZoneMgr mgr = ZoneMgr.Get(); if (mgr == null) { this.PlayAniamtion(); } else { foreach (ZonePlay play in mgr.FindZonesOfType <ZonePlay>()) { foreach (Card card in play.GetCards()) { if (card.IsMousedOver()) { this.m_LookAtPosition = card.transform.position; return; } list.Add(card.transform.position); } } if (UnityEngine.Random.Range(0, 100) < this.m_LookAtHeroesPercent) { foreach (ZoneHero hero in ZoneMgr.Get().FindZonesOfType <ZoneHero>()) { foreach (Card card2 in hero.GetCards()) { if (card2.IsMousedOver()) { this.m_LookAtPosition = card2.transform.position; return; } list.Add(card2.transform.position); } } } if (list.Count > 0) { int num = UnityEngine.Random.Range(0, list.Count); this.m_LookAtPosition = list[num]; } else { this.PlayAniamtion(); } } }
public static List <Zone> FindZonesFromTag(SpellZoneTag zoneTag) { ZoneMgr mgr = ZoneMgr.Get(); if (mgr != null) { switch (zoneTag) { case SpellZoneTag.PLAY: return(mgr.FindZonesOfType <Zone, ZonePlay>()); case SpellZoneTag.HERO: return(mgr.FindZonesOfType <Zone, ZoneHero>()); case SpellZoneTag.HERO_POWER: return(mgr.FindZonesOfType <Zone, ZoneHeroPower>()); case SpellZoneTag.WEAPON: return(mgr.FindZonesOfType <Zone, ZoneWeapon>()); case SpellZoneTag.DECK: return(mgr.FindZonesOfType <Zone, ZoneDeck>()); case SpellZoneTag.HAND: return(mgr.FindZonesOfType <Zone, ZoneHand>()); case SpellZoneTag.GRAVEYARD: return(mgr.FindZonesOfType <Zone, ZoneGraveyard>()); case SpellZoneTag.SECRET: return(mgr.FindZonesOfType <Zone, ZoneSecret>()); } Debug.LogWarning(string.Format("SpellUtils.FindZonesFromTag() - unhandled zoneTag {0}", zoneTag)); } return(null); }