Ejemplo n.º 1
0
    public AttackTowerInfo(int indexId, int towerId)
    {
        this.Id              = indexId;
        this.charId          = towerId;
        this.eventDispatcher = new MiniEventDispatcher();
        this.towerData       = J_Tower.GetData(towerId);
        this.towerBase       = towerData._towerBase;
        this.shooter         = towerData._Shooter;
        this.towerType       = towerData._towerType;

        towerStateMachine = new StateMachine();
        towerAtk          = new TowerAtk(this);
        towerIdle         = new TowerIdle(this);

        attackSkillList = new List <SkillInfo>();
        attackSkillList.Add(GetSpaceSkillInfo());
        attackSkill = SkillManager.getInstance().AddSkill(2, this);
        //若有弓手,攻击时长为弓手攻击动作
        if (this.shooter != null)
        {
            attackTime = AnimationCache.getInstance().getAnimation(this.shooter).getMeshAnimation("attack").getAnimTime();
        }
        //若没有弓手,攻击时长为塔身攻击动作
        else
        {
            attackTime = AnimationCache.getInstance().getAnimation(this.towerBase).getMeshAnimation("attack").getAnimTime();
        }
    }
Ejemplo n.º 2
0
    public AttackTowerInfo(int indexId, CharacterPrototype proto)
        : base(indexId, proto)
    {
        towerStateMachine = new StateMachine();
        towerAtk          = new TowerAtk(this);
        towerIdle         = new TowerIdle(this);
        towerConstructing = new TowerConstructing(this);

        attackSkill = SkillManager.getInstance().AddSkill(this.towerData._attackId, this);
    }
Ejemplo n.º 3
0
 private void Dead()
 {
     if (myTowerAtk == null)
     {
         myTowerAtk = transform.GetComponentInChildren <TowerAtk>();
     }
     myTowerAtk.StopAllCoroutines();
     myTowerAtk.nowTarget = null;
     gameObject.SetActive(false);
 }
Ejemplo n.º 4
0
    private void Dead()
    {
        InitTowerStatus();
        if (myTowerAtk == null)
        {
            myTowerAtk = transform.GetComponentInChildren <TowerAtk>();
        }
        myTowerAtk.StopAllCoroutines();
        myTowerAtk.nowTarget = null;
        if (PhotonNetwork.isMasterClient)             // 마스터가 한번만.
        {
            if (Team.ToLower().Equals("red"))         // 타워가 레드팀이면
            {
                sysmsg.Annoucement(8, false, "red");  // 파괴
                sysmsg.Annoucement(9, false, "blue"); // 적 파괴
            }
            else if (Team.ToLower().Equals("blue"))
            {
                sysmsg.Annoucement(8, false, "blue");
                sysmsg.Annoucement(9, false, "red");
            }
        }
        if (myNextTower != null)
        {
            myNextTower.isCanAtkMe = true;
        }
        else if (myNextSup != null)
        {
            if (myNextSup.tag.Equals("Nexus"))
            {
                myNextSup.nexusAtkNum += 10;
                if (myNextSup.nexusAtkNum >= 21)
                {
                    myNextSup.isCanAtkMe = true;
                }
            }
            else
            {
                myNextSup.isCanAtkMe = true;
            }
        }
        TowerDestroyEffect.SetActive(true);
        DestroyEffect.Play();
        toweraudio.PlayOneShot(SoundManager.instance.Building_Destroy);
        gameObject.SetActive(false);

        // 죽을때 마우스바뀐상태면 원래대로
        if (mouseChanged)
        {
            cursor.SetCursor(cursor.PreCursor, Vector2.zero);
        }
    }
Ejemplo n.º 5
0
 private void OnEnable()
 {
     if (firstload)
     {
         towerHP.BasicSetting();
     }
     firstload  = true;
     myTowerAtk = transform.GetComponentInChildren <TowerAtk>();
     if (!cursor)
     {
         cursor = GameObject.FindGameObjectWithTag("MouseCursor").GetComponent <AOSMouseCursor>();
     }
 }
Ejemplo n.º 6
0
 private void OnEnable()
 {
     myTowerAtk = transform.GetComponentInChildren <TowerAtk>();
 }
Ejemplo n.º 7
0
    /// <summary>
    /// 사망처리를 하는 함수
    /// </summary>
    private void Dead()
    {
        InitTowerHP();

        if (myTowerAtk == null)
        {
            myTowerAtk = transform.GetComponentInChildren <TowerAtk>();
        }

        //공격 중이었다면 공격을 멈춘다
        myTowerAtk.StopAllCoroutines();
        myTowerAtk.nowTarget = null;

        //건물이 파괴되었다는 시스템 메시지를 띄운다
        if (PhotonNetwork.isMasterClient)
        {
            if (team.ToLower().Equals("red"))
            {
                sysmsg.Annoucement(8, false, "red");
                sysmsg.Annoucement(9, false, "blue");
            }
            else if (team.ToLower().Equals("blue"))
            {
                sysmsg.Annoucement(8, false, "blue");
                sysmsg.Annoucement(9, false, "red");
            }
        }

        if (myNextTower != null)
        {
            myNextTower.isCanAtkMe = true;
        }
        else if (myNextSup != null)
        {
            //만약 현재 타워가 쌍둥이 타워면 넥서스의 공격 가능 유무를 계산한다
            if (myNextSup.tag.Equals("Nexus"))
            {
                myNextSup.nexusAtkNum += 10;

                if (myNextSup.nexusAtkNum >= 21)
                {
                    myNextSup.isCanAtkMe = true;
                }
            }
            else
            {
                myNextSup.isCanAtkMe = true;
            }
        }

        towerDestroyEffect.SetActive(true);
        destroyEffect.Play();
        towerAudio.PlayOneShot(SoundManager.Instance.Building_Destroy);
        gameObject.SetActive(false);

        // 죽을 때 마우스 바뀐 상태면 원래대로 돌림
        if (isMouseChanged)
        {
            cursor.SetCursor(cursor.PreCursor, Vector2.zero);
        }
    }