Пример #1
0
 //复活
 public void toLive()
 {
     isDead = false;
     banBattleRole.attribute            = banBattleRole.initAttri;
     sprite_Attribute.spriteName        = BanTools.GetAttributeName(banBattleRole.initAttri);
     sprite_Attribute_Border.spriteName = BanTools.GetAttributeBorderName(banBattleRole.initAttri);
 }
Пример #2
0
    /// <summary>
    /// 返回值表示是否有属性克制, True代表确定有属性克制
    /// </summary>

    public bool Set(BanBattleRole.Attribute attackAttribute, BanBattleRole.Attribute defenseAttribute)
    {
        Core.Data.soundManager.SoundFxPlay(SoundFx.FX_Explosion);

        sprite_Attack.spriteName  = BanTools.GetAttributeName(attackAttribute);
        sprite_Defense.spriteName = BanTools.GetAttributeName(defenseAttribute);

        sprite_Attack.MakePixelPerfect();
        sprite_Defense.MakePixelPerfect();

        transform.localScale = new Vector3(15f, 15f, 15f);

        state = BanTools.GetAttributeState(attackAttribute, defenseAttribute);
        if (state == 1)
        {
            sprite_Attack.transform.localPosition = new Vector3(sprite_Attack.transform.localPosition.x - 10f, sprite_Attack.transform.localPosition.y, sprite_Attack.transform.localPosition.z);
            sprite_Attack.transform.localScale    = new Vector3(EnlargeFactor, EnlargeFactor, EnlargeFactor);
            sprite_Defense.transform.localScale   = new Vector3(1.0f, 1.0f, 1.0f);
        }
        else if (state == -1)
        {
            sprite_Defense.transform.localPosition = new Vector3(sprite_Defense.transform.localPosition.x + 10f, sprite_Defense.transform.localPosition.y, sprite_Defense.transform.localPosition.z);
            sprite_Attack.transform.localScale     = new Vector3(1.0f, 1.0f, 1.0f);
            sprite_Defense.transform.localScale    = new Vector3(EnlargeFactor, EnlargeFactor, EnlargeFactor);
        }

        MiniItween itween = MiniItween.ScaleTo(gameObject, new Vector3(1.0f, 1.0f, 1.0f), ScaleTime, ScaleType);

        itween.myDelegateFunc += shake;

        return(state != 0);
    }
Пример #3
0
    public void SetData(BanBattleRole roleInfo, bool showAttack)
    {
        AtlasMgr.mInstance.SetHeadSprite(_head, roleInfo.number.ToString());
        _head.MakePixelPerfect();
        _level.text = "Lv" + roleInfo.level;

        att.spriteName    = BanTools.GetAttributeName(roleInfo.initAttri);
        border.spriteName = BanTools.GetAttributeBorderName(roleInfo.initAttri);
        _power.text       = "" + (roleInfo.group == BanBattleRole.Group.Attack ? roleInfo.attackBP : roleInfo.defenseBP);
        _name.text        = Core.Data.monManager.getMonsterByNum(roleInfo.number).name;

        if (showAttack)
        {
            _part.spriteName = "common-0008";
        }
        else
        {
            _part.spriteName = "common-0010";
        }
    }
Пример #4
0
    public void ReadData(BanBattleRole aBanBattleRole, bool isCurrent = false)
    {
        AtlasMgr.mInstance.SetHeadSprite(sprite_Role, aBanBattleRole.number.ToString());
        sprite_Attribute_Border.spriteName = BanTools.GetAttributeBorderName(aBanBattleRole.attribute);
        if (!isDie)
        {
            sprite_Attribute.spriteName = BanTools.GetAttributeName(aBanBattleRole.attribute);
        }
        else
        {
            sprite_Attribute.spriteName = BanTools.GetAttributeName(BanBattleRole.Attribute.Unknown);
        }
        text_Level.text = "Lv" + aBanBattleRole.level;

        if (Core.Data.monManager != null)
        {
            RoleName.text = Core.Data.monManager.getMonsterByNum(aBanBattleRole.number).name;
        }

        banBattleRole = aBanBattleRole;
    }
Пример #5
0
    //Left = true,代表左边克制右边。否则,右边克制左边
    IEnumerator ShowKezhi(int state, BanBattleRole.Attribute attackAttribute, BanBattleRole.Attribute defenseAttribute)
    {
        LeftAttri.spriteName  = BanTools.GetAttributeName(attackAttribute);
        RightAttri.spriteName = BanTools.GetAttributeName(defenseAttribute);

        Core.Data.soundManager.SoundFxPlay(SoundFx.FX_Explosion);
        bool Left = state == 1;

        init();

        LeftAttri.transform.localScale  = Left ? 1.5f * Vector3.one : Vector3.one;
        RightAttri.transform.localScale = Left ? Vector3.one : 1.5f * Vector3.one;

        Vector3 leftPos  = Vector3.zero;
        Vector3 rightPos = Vector3.zero;

        if (Left)
        {
            leftPos  = new Vector3(-BigPoint, 0f, 0f);
            rightPos = new Vector3(SmallPoint, 0f, 0f);
        }
        else
        {
            leftPos  = new Vector3(-SmallPoint, 0f, 0f);
            rightPos = new Vector3(BigPoint, 0f, 0f);
        }

        //start move
        MiniItween.MoveTo(LeftAttri.gameObject, leftPos, Closed);
        MiniItween.MoveTo(RightAttri.gameObject, rightPos, Closed);

        MiniItween.ColorTo(LeftAttri.gameObject, new V4(Color.white), Closed, MiniItween.Type.ColorWidget);
        MiniItween.ColorTo(RightAttri.gameObject, new V4(Color.white), Closed, MiniItween.Type.ColorWidget);

        yield return(new WaitForSeconds(Closed));

        //分离
        MiniItween.MoveTo(LeftAttri.gameObject, new Vector3(leftPos.x - ApartDis, 0f, 0f), Apart);
        MiniItween.MoveTo(RightAttri.gameObject, new Vector3(rightPos.x + ApartDis, 0f, 0f), Apart);

        MiniItween.ScaleTo(KeZhi.gameObject, 1.1f * Vector3.one, Apart);
        MiniItween.ColorTo(KeZhi.gameObject, new V4(Color.white), Apart, MiniItween.Type.ColorWidget);

        yield return(new WaitForSeconds(Apart));

        yield return(new WaitForEndOfFrame());

        KeZhi.transform.localScale = Vector3.one;

        //闪电出现
        GameObject go = Instantiate(Ray) as GameObject;

        if (Left)
        {
            RED.AddChild(go, LeftAttri.gameObject);
        }
        else
        {
            RED.AddChild(go, RightAttri.gameObject);
        }

        yield return(new WaitForSeconds(Thunder));

        Destroy(go);

        //消失
        MiniItween.MoveTo(LeftAttri.gameObject, new Vector3(-700f, 0f, 0f), Disappear);
        MiniItween.MoveTo(RightAttri.gameObject, new Vector3(700f, 0f, 0f), Disappear);
        MiniItween.ScaleTo(KeZhi.gameObject, Vector3.zero, Disappear);

        MiniItween.ColorTo(LeftAttri.gameObject, new V4(new Color(1f, 1f, 1f, 0f)), Disappear, MiniItween.Type.ColorWidget);
        MiniItween.ColorTo(RightAttri.gameObject, new V4(new Color(1f, 1f, 1f, 0f)), Disappear, MiniItween.Type.ColorWidget);
        MiniItween.ColorTo(KeZhi.gameObject, new V4(new Color(1f, 1f, 1f, 0f)), Disappear, MiniItween.Type.ColorWidget);

        yield return(new WaitForSeconds(Disappear));
    }
Пример #6
0
 //改变为全属性
 public void changeToAllAttribute()
 {
     sprite_Attribute_Border.spriteName = BanTools.GetAttributeBorderName(BanBattleRole.Attribute.Quan);
     sprite_Attribute.spriteName        = BanTools.GetAttributeName(BanBattleRole.Attribute.Quan);
 }
Пример #7
0
 //死亡
 public void toDie()
 {
     isDead = true;
     sprite_Attribute.spriteName = BanTools.GetAttributeName(BanBattleRole.Attribute.Unknown);
 }