예제 #1
0
    private static MinionShake[] FindAllMinionShakers(GameObject shakeTrigger)
    {
        Card  sourceCard = null;
        Spell spell      = SceneUtils.FindComponentInThisOrParents <Spell>(shakeTrigger);

        if (spell != null)
        {
            sourceCard = spell.GetSourceCard();
        }
        List <MinionShake> list = new List <MinionShake>();

        foreach (Zone zone in ZoneMgr.Get().FindZonesForTag(TAG_ZONE.PLAY))
        {
            if (zone.GetType() != typeof(ZoneHero))
            {
                foreach (Card card2 in zone.GetCards())
                {
                    if (card2 != sourceCard)
                    {
                        MinionShake componentInChildren = card2.GetComponentInChildren <MinionShake>();
                        Log.Kyle.Print(string.Format("Minion Shake Search:{0}", card2), new object[0]);
                        if (componentInChildren != null)
                        {
                            list.Add(componentInChildren);
                            Log.Kyle.Print(string.Format("Minion Shake Found:{0}", card2), new object[0]);
                        }
                    }
                }
            }
        }
        return(list.ToArray());
    }
예제 #2
0
    public bool HasCardDef(GameObject go)
    {
        CardDef def = SceneUtils.FindComponentInThisOrParents <CardDef>(go);

        if (def == null)
        {
            return(false);
        }
        return(this.m_cachedCardDefs.ContainsValue(def));
    }
예제 #3
0
 private static bool ShouldCheckGameplayForPlayMakerMouseInput(GameObject go)
 {
     if (SceneMgr.Get() == null)
     {
         return(false);
     }
     if (!SceneMgr.Get().IsInGame())
     {
         return(false);
     }
     if (((LoadingScreen.Get() != null) && LoadingScreen.Get().IsPreviousSceneActive()) && (SceneUtils.FindComponentInThisOrParents <LoadingScreen>(go) != null))
     {
         return(false);
     }
     if (SceneUtils.FindComponentInThisOrParents <BaseUI>(go) != null)
     {
         return(false);
     }
     return(true);
 }
    private void Start()
    {
        Actor actor = SceneUtils.FindComponentInThisOrParents <Actor>(base.gameObject);

        if (actor == null)
        {
            Spell message = SceneUtils.FindComponentInParents <Spell>(base.gameObject);
            if (message != null)
            {
                Debug.Log(message);
                Debug.Log(message.GetSourceCard());
                actor = message.GetSourceCard().GetActor();
            }
        }
        if (actor == null)
        {
            Debug.LogError(string.Format("SnapActorToGameObject on {0} failed to find Actor object!", base.gameObject.name));
            base.enabled = false;
        }
        else
        {
            this.m_actorTransform = actor.transform;
        }
    }
 public static Actor GetParentActor(Spell spell)
 {
     return(SceneUtils.FindComponentInThisOrParents <Actor>(spell.gameObject));
 }
 private void Init(bool forceRender)
 {
     if (!this.m_Init || forceRender)
     {
         if (this.m_Actor == null)
         {
             this.m_Actor = SceneUtils.FindComponentInThisOrParents <Actor>(base.gameObject);
             if (this.m_Actor == null)
             {
                 Debug.LogError(string.Format("{0} Ghost card effect failed to find Actor!", base.transform.root.name));
                 base.enabled = false;
                 return;
             }
         }
         this.m_CardMesh            = this.m_Actor.m_cardMesh;
         this.m_CardFrontIdx        = this.m_Actor.m_cardFrontMatIdx;
         this.m_PremiumRibbonIdx    = this.m_Actor.m_premiumRibbon;
         this.m_PortraitMesh        = this.m_Actor.m_portraitMesh;
         this.m_PortraitFrameIdx    = this.m_Actor.m_portraitFrameMatIdx;
         this.m_NameMesh            = this.m_Actor.m_nameBannerMesh;
         this.m_DescriptionMesh     = this.m_Actor.m_descriptionMesh;
         this.m_DescriptionTrimMesh = this.m_Actor.m_descriptionTrimMesh;
         this.m_RarityFrameMesh     = this.m_Actor.m_rarityFrameMesh;
         if (this.m_Actor.m_attackObject != null)
         {
             Renderer component = this.m_Actor.m_attackObject.GetComponent <Renderer>();
             if (component != null)
             {
                 this.m_AttackMesh = component.gameObject;
             }
             if (this.m_AttackMesh == null)
             {
                 foreach (Renderer renderer2 in this.m_Actor.m_attackObject.GetComponentsInChildren <Renderer>())
                 {
                     if (renderer2.GetComponent <UberText>() == null)
                     {
                         this.m_AttackMesh = renderer2.gameObject;
                     }
                 }
             }
         }
         if (this.m_Actor.m_healthObject != null)
         {
             Renderer renderer3 = this.m_Actor.m_healthObject.GetComponent <Renderer>();
             if (renderer3 != null)
             {
                 this.m_HealthMesh = renderer3.gameObject;
             }
             if (this.m_HealthMesh == null)
             {
                 foreach (Renderer renderer4 in this.m_Actor.m_healthObject.GetComponentsInChildren <Renderer>())
                 {
                     if (renderer4.GetComponent <UberText>() == null)
                     {
                         this.m_HealthMesh = renderer4.gameObject;
                     }
                 }
             }
         }
         this.m_ManaCostMesh  = this.m_Actor.m_manaObject;
         this.m_RacePlateMesh = this.m_Actor.m_racePlateObject;
         this.m_EliteMesh     = this.m_Actor.m_eliteObject;
         this.StoreOrgMaterials();
         this.m_R2T_BaseCard = base.GetComponent <RenderToTexture>();
         this.m_R2T_BaseCard.m_ObjectToRender = this.m_Actor.GetRootObject();
         if ((this.m_R2T_BaseCard.m_Material != null) && this.m_R2T_BaseCard.m_Material.HasProperty("_Seed"))
         {
             this.m_R2T_BaseCard.m_Material.SetFloat("_Seed", UnityEngine.Random.Range((float)0f, (float)1f));
         }
         this.m_Init = true;
     }
 }
 private void Start()
 {
     this.m_Actor = SceneUtils.FindComponentInThisOrParents <Actor>(base.gameObject);
 }