Esempio n. 1
0
    void DoDestroySelf()
    {
        //for follow bullet
        if (BulletData.m_bulletIdFollow != 0 && GameManager.Instance.CurrentGameMode == GameMode.SINGLE_PLAYER)
        {
            BulletFactory.Instance.CreateBullet(BulletData.m_bulletIdFollow, FormEntityID, m_thisTransfrom, m_skillId, m_targetId);
        }

        //for follow monster
        if (BulletData.m_monsterIdFollow != 0)
        {
            if (!(SceneDataManager.Instance.IsPositionInBlock(m_thisTransfrom.position)))
            {
                float xValue, yValue;
                m_thisTransfrom.position.SetToServer(out xValue, out yValue);

                SMsgFightSummonBullet_CS sMsgFightSummonBullet_CS = new SMsgFightSummonBullet_CS();
                sMsgFightSummonBullet_CS.uidFighter        = FormEntityID;
                sMsgFightSummonBullet_CS.MonsterTemplateID = (uint)(BulletData.m_monsterIdFollow);
                sMsgFightSummonBullet_CS.BulletPosX        = xValue;
                sMsgFightSummonBullet_CS.BulletPosY        = yValue;

                var direct = transform.TransformDirection(Vector3.forward);
                sMsgFightSummonBullet_CS.BulletDirX = direct.x;
                sMsgFightSummonBullet_CS.BulletDirY = -direct.z;

                NetServiceManager.Instance.BattleService.SendFightSummonBullet_CS(sMsgFightSummonBullet_CS);
            }
        }

        //TraceUtil.Log("Time To Destroy Bullet:" + seconds + " Index:" + this.BulletIndex+"  "+transform.position);
        if (this.BulletIndex != 0)
        {
            BulletManager.Instance.UnRegisteEntity(this.BulletIndex, this.FormEntityID);
        }
    }
Esempio n. 2
0
 public void SendFightSummonBullet_CS(SMsgFightSummonBullet_CS sMsgFightSummonBullet_CS)
 {
     this.Request(sMsgFightSummonBullet_CS.GeneratePackage());
 }