コード例 #1
0
        public void SetType(BattleMonsterButton.Type type)
        {
            this.selectFrame.gameObject.SetActive(type == BattleMonsterButton.Type.Select);
            int num = (type != BattleMonsterButton.Type.Dead) ? 0 : 1;

            this.baseFrame.atlas  = this.uiAtlases[num];
            this.bgFrame.atlas    = this.uiAtlases[num];
            this.flashFrame.atlas = this.uiAtlases[num];
            if (this.charaTexture.material == null)
            {
                this.charaTexture.shader = this.materials[num].shader;
            }
            else if ((type == BattleMonsterButton.Type.Dead && this.iconType != BattleMonsterButton.Type.Dead) || (type != BattleMonsterButton.Type.Dead && this.iconType == BattleMonsterButton.Type.Dead))
            {
                this.iconType = type;
                Texture texture  = this.charaTexture.material.GetTexture("_MaskTex");
                Texture texture2 = this.charaTexture.material.GetTexture("_MainTex");
                if (type == BattleMonsterButton.Type.Dead)
                {
                    Shader iconShaderGray = GUIMonsterIcon.GetIconShaderGray();
                    this.charaTexture.material = new Material(iconShaderGray);
                    this.charaTexture.material.SetTexture("_MaskTex", texture);
                    this.charaTexture.material.SetTexture("_MainTex", texture2);
                }
                else
                {
                    Shader iconShader = GUIMonsterIcon.GetIconShader();
                    this.charaTexture.material = new Material(iconShader);
                    this.charaTexture.material.SetTexture("_MaskTex", texture);
                    this.charaTexture.material.SetTexture("_MainTex", texture2);
                }
            }
        }
コード例 #2
0
 public void SetType(BattleMonsterButton.Type Type)
 {
     this.frame.SetType(Type);
     this.leaderIcon.spriteName   = ((Type != BattleMonsterButton.Type.Dead) ? "Battle_Leader" : "Battle_Leader_g");
     base.transform.localPosition = ((Type != BattleMonsterButton.Type.Select) ? Vector3.zero : new Vector3(0f, 10f, 0f));
     if (BattleStateManager.current.battleMode == BattleMode.PvP)
     {
         base.transform.localPosition += new Vector3(0f, 20f, 0f);
     }
 }