private void ShowIcon()
    {
        if (this.goMN_ICON_CHG_2 != null)
        {
            UnityEngine.Object.DestroyImmediate(this.goMN_ICON_CHG_2);
        }
        GUIMonsterIcon guimonsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(this.data, this.goMN_ICON.transform.localScale, this.goMN_ICON.transform.localPosition, this.goMN_ICON.transform.parent, true, false);

        this.goMN_ICON_CHG_2 = guimonsterIcon.gameObject;
        this.goMN_ICON_CHG_2.SetActive(true);
        guimonsterIcon.Data = this.data;
        guimonsterIcon.SetTouchAct_L(new Action <MonsterData>(this.actMIconLong));
        UIWidget component  = this.goMN_ICON.GetComponent <UIWidget>();
        UIWidget component2 = guimonsterIcon.gameObject.GetComponent <UIWidget>();

        if (component != null && component2 != null)
        {
            int             add        = component.depth - component2.depth;
            DepthController component3 = guimonsterIcon.gameObject.GetComponent <DepthController>();
            component3.AddWidgetDepth(guimonsterIcon.transform, add);
        }
        BoxCollider component4 = this.goMN_ICON.GetComponent <BoxCollider>();
        BoxCollider component5 = guimonsterIcon.GetComponent <BoxCollider>();

        if (component4 != null && component5 != null)
        {
            component5.center = component4.center;
            component5.size   = component4.size;
        }
        this.goMN_ICON.SetActive(false);
    }
    private void CreateDigimonThumbnail()
    {
        if (!this.isMulti)
        {
            int[] aliveInfo = DataMng.Instance().WD_ReqDngResult.aliveInfo;
            for (int i = 0; i < this.deckData.monsterList.Length; i++)
            {
                this.digimonInfos[i].DigimonNo = i;
                GameWebAPI.RespDataMN_GetDeckList.MonsterList monsterList = this.deckData.monsterList[i];
                MonsterData userMonster = ClassSingleton <MonsterUserDataMng> .Instance.GetUserMonster(monsterList.userMonsterId);

                MonsterData    monsterData    = MonsterDataMng.Instance().CreateMonsterDataByMID(userMonster.GetMonster().monsterId);
                Transform      iconLocator    = this.digimonInfos[i].GetIconLocator();
                GUIMonsterIcon guimonsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(monsterData, iconLocator.localScale, iconLocator.localPosition, iconLocator.parent, true, false);
                guimonsterIcon.name           = "DigimonIcon" + i;
                guimonsterIcon.activeCollider = false;
                int depth = guimonsterIcon.GetComponent <UIWidget>().depth;
                this.digimonInfos[i].SetDepth(depth);
                if (aliveInfo.Length > i && aliveInfo[i] == 0)
                {
                    guimonsterIcon.SetGrayout(GUIMonsterIcon.DIMM_LEVEL.NOTACTIVE);
                }
            }
        }
        else
        {
            int[] aliveInfo2 = DataMng.Instance().WD_ReqDngResult.aliveInfo;
            GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
            for (int j = 0; j < this.digimonInfos.Length; j++)
            {
                this.digimonInfos[j].DigimonNo = j;
                int            partyIndex      = DataMng.Instance().GetPartyIndex(j);
                int            monsterIndex    = DataMng.Instance().GetMonsterIndex(j);
                MonsterData    monsterData2    = MonsterDataMng.Instance().CreateMonsterDataByMID(respData_WorldMultiStartInfo.party[partyIndex].userMonsters[monsterIndex].monsterId);
                Transform      iconLocator2    = this.digimonInfos[j].GetIconLocator();
                GUIMonsterIcon guimonsterIcon2 = GUIMonsterIcon.MakePrefabByMonsterData(monsterData2, iconLocator2.localScale, iconLocator2.localPosition, iconLocator2.parent, true, false);
                guimonsterIcon2.name           = "DigimonIcon" + j;
                guimonsterIcon2.activeCollider = false;
                int depth2 = guimonsterIcon2.GetComponent <UIWidget>().depth;
                this.digimonInfos[j].SetDepth(depth2);
                guimonsterIcon2.SetPlayerIcon(partyIndex + 1);
                if (aliveInfo2.Length > j && aliveInfo2[j] == 0)
                {
                    guimonsterIcon2.SetGrayout(GUIMonsterIcon.DIMM_LEVEL.NOTACTIVE);
                }
            }
        }
        foreach (BattleResultDigimonInfo battleResultDigimonInfo in this.digimonInfos)
        {
            NGUITools.SetActiveSelf(battleResultDigimonInfo.gameObject, false);
        }
    }
Пример #3
0
    private void CreateIcon(int index, MonsterData md, GameObject goEmpty)
    {
        Transform      transform      = goEmpty.transform;
        GUIMonsterIcon guimonsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(md, transform.localScale, transform.localPosition, transform.parent, true, false);

        guimonsterIcon.playSelectSE         = false;
        guimonsterIcon.SendMoveToParent     = false;
        guimonsterIcon.CancelTouchEndByMove = false;
        guimonsterIcon.gameObject.name      = "MonsterIcon " + index.ToString();
        UIWidget component  = goEmpty.GetComponent <UIWidget>();
        UIWidget component2 = guimonsterIcon.gameObject.GetComponent <UIWidget>();

        if (component != null && component2 != null)
        {
            int             add        = component.depth - component2.depth;
            DepthController component3 = guimonsterIcon.GetComponent <DepthController>();
            component3.AddWidgetDepth(guimonsterIcon.transform, add);
        }
        NGUITools.DestroyImmediate(goEmpty);
    }