public void HandleFrame(UpdateBulletEvent e, BulletNode bulletNode)
 {
     BulletComponent bullet = bulletNode.bullet;
     BulletConfigComponent bulletConfig = bulletNode.bulletConfig;
     DirectionData data = e.TargetingData.Directions[0];
     if (data.StaticHit != null)
     {
         Vector3 position = data.StaticHit.Position;
         base.ScheduleEvent(new RicochetBulletBounceEvent(position), bulletNode);
         bullet.Distance += (bullet.Position - data.StaticHit.Position).magnitude;
         this.ProcessRicochet(bullet, data.StaticHit);
     }
     else
     {
         if (base.DestroyOnAnyTargetHit(bulletNode.Entity, bullet, bulletConfig, e.TargetingData))
         {
             return;
         }
         base.MoveBullet(bulletNode.Entity, bullet);
     }
     if (bullet.Distance > bulletConfig.FullDistance)
     {
         base.DestroyBullet(bulletNode.Entity);
     }
 }
Example #2
0
    //检测敌人类型
    public bool CheckHitCondition(BulletNode bulletNode, BaseObject attack, BaseObject target)
    {
        bool result = false;

        if (bulletNode == null)
        {
            return(false);
        }
        if (bulletNode.col_type == null)
        {
            return(false);
        }
        for (int i = 0; i < bulletNode.col_type.Length; i++)
        {
            switch ((col_type)bulletNode.col_type[i])
            {
            case col_type.self:
                result |= target.m_Data.m_CampId == attack.m_Data.m_CampId && target == attack;
                break;

            case col_type.selfMonster:
                result |= target.m_Data.m_CampId == attack.m_Data.m_CampId && target != attack && target.m_Data.m_Type != ObjectType.PLAYER;
                break;

            case col_type.selfHero:
                result |= target.m_Data.m_CampId == attack.m_Data.m_CampId && target != attack && target.m_Data.m_Type != ObjectType.PLAYER;
                break;

            case col_type.enemyMonster:
                result |= target.m_Data.m_CampId != attack.m_Data.m_CampId && target != attack && target.m_Data.m_Type != ObjectType.PLAYER;
                break;

            case col_type.enemyHero:
                result |= target.m_Data.m_CampId != attack.m_Data.m_CampId && target != attack && target.m_Data.m_Type != ObjectType.PLAYER;
                break;

            case col_type.selfTower:
                break;

            case col_type.enemyTower:
                break;

            case col_type.neutralMonster:
                break;

            case col_type.neutralTower:
                break;

            case col_type.terrain:
                break;

            case col_type.target:
                break;

            default:
                break;
            }
        }
        return(result);
    }
Example #3
0
    public void Unstack()
    {
        top = top.nextNode;
        StackedItems--;

        OnUnStack?.Invoke(StackedItems);
        //Update UI Elements
    }
Example #4
0
        public void SetBulletLabelNode()
        {
            var           filename = new Filename(@"BulletEmpty.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            BulletNode testBulletNode = pattern.RootNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.AreEqual("test", testBulletNode.Label);
        }
Example #5
0
        public void CreatedBulletNode1()
        {
            var           filename = new Filename(@"BulletEmpty.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            BulletNode testBulletNode = pattern.RootNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode);
        }
Example #6
0
        public void SetBulletLabelNode()
        {
            string        filename = @"Content\BulletEmpty.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            BulletNode testBulletNode = pattern.RootNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.AreEqual("test", testBulletNode.Label);
        }
Example #7
0
        public void CreatedBulletNode1()
        {
            string        filename = @"Content\BulletEmpty.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            BulletNode testBulletNode = pattern.RootNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode);
        }
Example #8
0
        public void PrepareTargetsAtFirstFrame(NodeAddedEvent e, BulletNode bulletNode, [JoinByTank] WeaponNode weaponNode)
        {
            MuzzleLogicAccessor accessor          = new MuzzleLogicAccessor(weaponNode.muzzlePoint, weaponNode.weaponInstance);
            Vector3             barrelOriginWorld = accessor.GetBarrelOriginWorld();
            TargetingData       targetingData     = BattleCache.targetingData.GetInstance().Init();

            targetingData.Origin       = barrelOriginWorld;
            targetingData.Dir          = bulletNode.bullet.Direction;
            targetingData.FullDistance = (accessor.GetWorldPosition() - barrelOriginWorld).magnitude * 1.2f;
            base.ScheduleEvent(BattleCache.targetingEvent.GetInstance().Init(targetingData), bulletNode);
            base.ScheduleEvent(BattleCache.updateBulletEvent.GetInstance().Init(targetingData), bulletNode);
        }
Example #9
0
        public void PrepareTargets(UpdateEvent e, BulletNode bulletNode, [JoinByTank] WeaponNode weaponNode)
        {
            BulletComponent bullet        = bulletNode.bullet;
            float           num           = UnityTime.time - bullet.LastUpdateTime;
            TargetingData   targetingData = BattleCache.targetingData.GetInstance().Init();

            targetingData.Origin       = bullet.Position - (bullet.Direction * 0.1f);
            targetingData.Dir          = bullet.Direction;
            targetingData.FullDistance = Math.Min(Math.Max((float)0f, (float)(bulletNode.bulletConfig.FullDistance - bullet.Distance)), bullet.Speed * num);
            base.ScheduleEvent(BattleCache.targetingEvent.GetInstance().Init(targetingData), bulletNode);
            base.ScheduleEvent(BattleCache.updateBulletEvent.GetInstance().Init(targetingData), bulletNode);
        }
Example #10
0
        public void GotActionRefNode3()
        {
            var           filename = new Filename(@"ActionRefEmpty.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode testBulletNode = testFireNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode.GetChild(ENodeName.actionRef));
        }
Example #11
0
        public void GotActionRefNode4()
        {
            string        filename = @"Content\ActionRefEmpty.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode testBulletNode = testFireNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode);
        }
Example #12
0
        public void FoundCorrectBulletNode()
        {
            string        filename = @"Content\BulletRefTwoBullets.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode    testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletRefNode refNode        = testFireNode.GetChild(ENodeName.bulletRef) as BulletRefNode;
            BulletNode    testBulletNode = refNode.ReferencedBulletNode as BulletNode;

            Assert.AreEqual("test2", testBulletNode.Label);
        }
Example #13
0
        public void GotParamNode3()
        {
            var           filename = TestUtils.GetFilePath(@"Content\ActionRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.Parse(filename);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(NodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(NodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(NodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(NodeName.actionRef) as ActionRefNode;

            Assert.IsNotNull(testActionRefNode.GetChild(NodeName.param) as ParamNode);
        }
Example #14
0
        public void FoundBulletNode2()
        {
            var           filename = new Filename(@"BulletRef.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode    testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletRefNode refNode        = testFireNode.GetChild(ENodeName.bulletRef) as BulletRefNode;
            BulletNode    testBulletNode = refNode.ReferencedBulletNode as BulletNode;

            Assert.AreEqual("test", testBulletNode.Label);
        }
Example #15
0
        public void FoundCorrectActionNode()
        {
            var           filename = new Filename(@"ActionRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(ENodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode;
            ActionNode    refNode           = testActionRefNode.ReferencedActionNode as ActionNode;

            Assert.AreEqual(refNode.Label, "test2");
        }
Example #16
0
        public void FoundActionNode2()
        {
            string        filename = @"Content\ActionRefEmpty.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(ENodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode;
            ActionNode    refNode           = testActionRefNode.ReferencedActionNode as ActionNode;

            Assert.AreEqual(refNode.Label, "test");
        }
Example #17
0
    public void Stack(Bullet newBullet)
    {
        //Check maxed stacked items

        if (StackedItems < stackLimit)
        {
            BulletNode newNode = new BulletNode(newBullet);

            newNode.nextNode = top;

            top = newNode;

            StackedItems++;

            OnStack?.Invoke(top.storedBullet.bulletNumber);
        }
    }
        public void SpawnExplosionOnBounce(UpdateBulletEvent e, BulletNode bulletNode, [JoinByTank] WeaponNode weaponNode)
        {
            BulletEffectComponent bulletEffect = weaponNode.bulletEffect;
            DirectionData         data         = e.TargetingData.Directions.First <DirectionData>();

            if (data.StaticHit != null)
            {
                GetInstanceFromPoolEvent eventInstance = new GetInstanceFromPoolEvent {
                    Prefab          = bulletEffect.ExplosionPrefab,
                    AutoRecycleTime = bulletEffect.ExplosionTime
                };
                base.ScheduleEvent(eventInstance, new EntityStub());
                Transform instance = eventInstance.Instance;
                instance.position = data.StaticHit.Position + (data.StaticHit.Normal * bulletEffect.ExplosionOffset);
                instance.rotation = Quaternion.LookRotation(data.StaticHit.Normal);
                instance.gameObject.SetActive(true);
            }
        }
        public void Build(NodeAddedEvent e, BulletNode node, [JoinBy(typeof(TankGroupComponent))] WeaponNode weaponNode)
        {
            BulletComponent bullet     = node.bullet;
            Quaternion      quaternion = Quaternion.LookRotation(bullet.Direction);
            BulletEffectInstanceComponent component     = new BulletEffectInstanceComponent();
            GetInstanceFromPoolEvent      eventInstance = new GetInstanceFromPoolEvent {
                Prefab = weaponNode.bulletEffect.BulletPrefab
            };

            base.ScheduleEvent(eventInstance, node);
            GameObject gameObject = eventInstance.Instance.gameObject;

            gameObject.transform.position = bullet.Position;
            gameObject.transform.rotation = quaternion;
            gameObject.SetActive(true);
            component.Effect = gameObject;
            CustomRenderQueue.SetQueue(gameObject, 0xc4e);
            node.Entity.AddComponent(component);
        }
Example #20
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        this.gameNode     = GetNode <GameNode>("../../GameNode");
        this.levelLabel   = GetNode <Label>("LevelLabel");
        this.shotTimer    = GetNode <Timer>("ShotTimer");
        this.sensingTimer = GetNode <Timer>("SensingTimer");
        this.turretGun    = GetNode <TextureRect>("TurretGun");

        this.bulletNodes = new BulletNode[maxBullets];

        for (int i = 0; i < maxBullets; i++)
        {
            BulletNode bulletInstance = (BulletNode)BulletScene.Instance();
            AddChild(bulletInstance);

            bulletNodes[i] = bulletInstance;
        }

        up = new Vector2(0, 1);
    }
Example #21
0
    public bool IsInRange(BulletNode m_BulletNode, BaseObject attack, BaseObject Target)
    {
        if (m_BulletNode.col_size_value == null)
        {
            return(false);
        }
        float angle    = 0;
        Fix64 distance = Fix64.Zero;

        switch (m_BulletNode.col_size_type)
        {
        case 1:    //扇形/环形
            if (m_BulletNode.col_size_value != null && m_BulletNode.col_size_value.Length == 4)
            {
                angle    = Mathf.Acos(Vector3.Dot(m_BaseObject.m_Angles.ToVector3().normalized, (Target.m_Pos - attack.m_Pos).ToVector3().normalized)) * Mathf.Rad2Deg;
                distance = Target.m_Data.m_Type == ObjectType.PLAYER ? (FixVector3.Distance(Target.m_Pos, m_Pos) - Fix64.FromRaw(200)) : (FixVector3.Distance(Target.m_Pos, m_Pos) - Fix64.FromRaw(100));
                if ((angle <= m_BulletNode.col_size_value[0] || m_BulletNode.col_size_value[0] <= 0) && ((float)distance <= m_BulletNode.col_size_value[1]) && ((float)distance >= m_BulletNode.col_size_value[2]))
                {
                    return(true);
                }
            }
            break;

        case 2:    //矩形
            if (m_BulletNode.col_size_value != null && m_BulletNode.col_size_value.Length == 5)
            {
                FixVector3 p1 = new FixVector3(m_Pos.x - (Fix64)m_BulletNode.col_size_value[2], m_Pos.y, m_Pos.x + (Fix64)m_BulletNode.col_size_value[0]);
                FixVector3 p2 = new FixVector3(m_Pos.x + (Fix64)m_BulletNode.col_size_value[3], m_Pos.y, m_Pos.x + (Fix64)m_BulletNode.col_size_value[0]);
                FixVector3 p3 = new FixVector3(m_Pos.x + (Fix64)m_BulletNode.col_size_value[3], m_Pos.y, m_Pos.x - (Fix64)m_BulletNode.col_size_value[1]);
                FixVector3 p4 = new FixVector3(m_Pos.x - (Fix64)m_BulletNode.col_size_value[2], m_Pos.y, m_Pos.x - (Fix64)m_BulletNode.col_size_value[1]);
                FixVector3 p  = Target.m_Pos;
                return(GetCross(p1, p2, p) * GetCross(p3, p4, p) >= (Fix64)0 && GetCross(p2, p3, p) * GetCross(p4, p1, p) >= (Fix64)00);
            }
            break;

        default:
            break;
        }
        return(false);
    }
Example #22
0
        public void HandleFrame(UpdateBulletEvent e, BulletNode bulletNode)
        {
            BulletComponent       bullet       = bulletNode.bullet;
            BulletConfigComponent bulletConfig = bulletNode.bulletConfig;
            DirectionData         data         = e.TargetingData.Directions[0];

            if (data.StaticHit != null)
            {
                bullet.Distance += (bullet.Position - data.StaticHit.Position).magnitude;
                base.SetPositionNearHitPoint(bullet, data.StaticHit.Position);
                base.SendBulletStaticHitEvent(bulletNode.Entity, bullet);
                base.DestroyBullet(bulletNode.Entity);
            }
            else if (!base.DestroyOnAnyTargetHit(bulletNode.Entity, bullet, bulletConfig, e.TargetingData))
            {
                base.MoveBullet(bulletNode.Entity, bullet);
                if (bullet.Distance > bulletConfig.FullDistance)
                {
                    base.DestroyBullet(bulletNode.Entity);
                }
            }
        }
Example #23
0
    public override void _Ready()
    {
        sprite           = GetNode <AnimatedSprite>("Sprite");
        collisionShape2D = GetNode <CollisionShape2D>("CollisionShape2D");
        bloodParticles   = GetNode <Particles2D>("BloodParticles");
        camera2D         = GetNode <Camera2D>("Camera2D");

        crunchSounds[0] = GetNode <AudioStreamPlayer2D>("sounds/CrunchSoundOne");
        crunchSounds[1] = GetNode <AudioStreamPlayer2D>("sounds/CrunchSoundTwo");
        crunchSounds[2] = GetNode <AudioStreamPlayer2D>("sounds/CrunchSoundThree");
        crunchSounds[3] = GetNode <AudioStreamPlayer2D>("sounds/CrunchSoundFour");
        moneyGained     = GetNode <AudioStreamPlayer2D>("sounds/MoneyGained");
        hitSound        = GetNode <AudioStreamPlayer2D>("sounds/HitSound");
        healSound       = GetNode <AudioStreamPlayer2D>("sounds/HealSound");
        rayCast2D       = GetNode <RayCast2D>("RayCast2D");

        healthBar = GetNode <HealthBar>("HealthBarNode");

        this.inGameUI           = GetNode <InGameUI>("Camera2D/HudLayer/UI");
        this.endGameUI          = GetNode <EndGameUI>("Camera2D/HudLayer/EndGameUI");
        this.healParticleEffect = GetNode <Particles2D>("healParticleEffect");

        this.bulletNodes = new BulletNode[maxBullets];

        for (int i = 0; i < maxBullets; i++)
        {
            BulletNode bulletInstance = (BulletNode)BulletScene.Instance();
            AddChild(bulletInstance);

            bulletNodes[i] = bulletInstance;
        }
        endGameUI.Visible = false;

        inGameUI.SetSpendingMoney(spendingMoney);
        inGameUI.SetWeaponDamage(damage);
    }
Example #24
0
        public void FoundCorrectActionNode()
        {
            var           filename = TestUtils.GetFilePath(@"Content\ActionRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.Parse(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(NodeName.action) as ActionNode;

            Assert.IsNotNull(testActionNode);
            FireNode testFireNode = testActionNode.GetChild(NodeName.fire) as FireNode;

            Assert.IsNotNull(testFireNode);
            BulletNode testBulletNode = testFireNode.GetChild(NodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode);
            ActionRefNode testActionRefNode = testBulletNode.GetChild(NodeName.actionRef) as ActionRefNode;

            Assert.IsNotNull(testActionRefNode);
            ActionNode refNode = testActionRefNode.ReferencedActionNode;

            Assert.IsNotNull(testActionNode);
            Assert.AreEqual("test2", refNode.Label);
        }
Example #25
0
    /// <summary>
    /// 初始化数据
    /// </summary>
    /// <param name="viewPlayer"></param>
    /// <param name="parameter"></param>
    public void CreateBullet(BaseObject player, SkillNode skillNode, Bullet_ValueClass bullet, string parameter = null)
    {
        if (player == null || bullet == null)
        {
            return;
        }
        m_BaseObject  = player;
        m_Parameter   = parameter;
        m_SkillNode   = skillNode;
        m_BulletClass = bullet;
        m_BulletNode  = FSDataNodeTable <BulletNode> .GetSingleton().FindDataByType((long)bullet.m_BulletId);

        if (m_BulletNode == null)
        {
            Debug.Log(player.m_VGo.name + "     错误的子弹id      " + bullet.m_BulletId);
            return;
        }
        #region 子弹目标类型
        if (m_BulletClass.m_bul_target_type == (Fix64)0)//自身
        {
            m_Target = m_BaseObject;
        }
        else if (m_BulletClass.m_bul_target_type == (Fix64)1)//当前目标
        {
            m_Target = m_BulletClass.m_taregt;
        }
        else if (m_BulletClass.m_bul_target_type == (Fix64)2)//范围内目标
        {
            m_Target = CheckBulTargetValue();
            //if (m_BulletClass.v_taregt.Count > 0)
            //{
            //    m_Target = m_BulletClass.v_taregt[0];
            //}
        }
        #endregion

        m_IsActive = true;

        #region 技能判断子弹发射者
        if (m_BulletClass.m_bul_start == (Fix64)1)//自身
        {
            m_Pos = player.m_Pos;
        }
        else if (m_BulletClass.m_bul_start == (Fix64)2)//当前目标
        {
            if (m_Target == null)
            {
                return;
            }
            m_Pos = m_Target.m_Pos;
        }
        #endregion

        #region 子子弹判断子弹发射者
        if (m_BulletClass.newbul_origin == (Fix64)0)//无
        {
        }
        else if (m_BulletClass.newbul_origin == (Fix64)1)//当前子弹碰撞目标
        {
            if (m_BulletClass.old_pos != FixVector3.Zero)
            {
                m_Pos = m_BulletClass.old_pos;
            }
        }
        else if (m_BulletClass.newbul_origin == (Fix64)2)//技能释放者
        {
            m_Pos = player.m_Pos;
        }
        else if (m_BulletClass.newbul_origin == (Fix64)3)//当前子弹
        {
            if (m_BulletClass.m_taregt != null)
            {
                m_Pos = m_BulletClass.m_taregt.m_Pos;
            }
            if (m_BulletClass.old_pos != FixVector3.Zero)
            {
                m_Pos = m_BulletClass.old_pos;
            }
        }
        #endregion

        m_BuHurtList = new List <BeHurtTarget>();

        //子弹结束位置
        if (m_Target != null)
        {
            m_BulletClass.v_pos = (FixVector3)m_Target.m_Pos + bullet.m_bul_end_xyz;
        }
        #region 显示层
        if (GameData.m_IsExecuteViewLogic)
        {
            #region  加载子弹特效
            if (!string.IsNullOrEmpty(m_BulletNode.effect))
            {
                string eff = m_BulletNode.effect;
                if (m_BaseObject.m_Data.m_Type == ObjectType.PLAYER && !string.IsNullOrEmpty(eff))
                {
                    GameObject effectGo = Resources.Load <GameObject>(string.Format("{0}/{1}/{2}/{3}", GameData.m_EffectPath, "Heros", (m_BaseObject as Player).m_PlayerData.m_HeroResourceName, eff));
                    if (effectGo != null)
                    {
                        m_AniEffect = GameObject.Instantiate(effectGo);
                    }
                }
                if (m_BaseObject.m_Data.m_Type == ObjectType.MONSTER && !string.IsNullOrEmpty(eff))
                {
                    GameObject effectGo = Resources.Load <GameObject>(string.Format("{0}/{1}/{2}/{3}", GameData.m_EffectPath, "Monster", (m_BaseObject as Monster).m_MonsterData.m_MonsterResourceName, eff));
                    if (effectGo != null)
                    {
                        m_AniEffect = GameObject.Instantiate(effectGo);
                    }
                }
                //if (m_AniEffect == null)
                //{
                //    m_AniEffect = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                //    m_AniEffect.transform.localScale = new Vector3((float)1, (float)1, (float)1f);
                //}
                if (m_AniEffect == null)
                {
                    return;
                }
                //技能判断子弹发射者
                if (m_BulletClass.m_bul_start == (Fix64)1)//自身
                {
                    #region 后修改为挂点
                    //m_AniEffect.transform.parent = m_Player.m_VGo.transform;
                    m_AniEffect.transform.position = m_BaseObject.m_Pos.ToVector3();
                    #endregion
                }
                else if (m_BulletClass.m_bul_start == (Fix64)2)//当前目标
                {
                    if (m_Target == null)
                    {
                        return;
                    }
                    #region 后修改为挂点
                    //m_AniEffect.transform.parent = m_Target.m_VGo.transform;
                    m_AniEffect.transform.position = m_Target.m_Pos.ToVector3();
                    #endregion
                }
                //子子弹判断子弹发射者
                if (m_BulletClass.newbul_origin == (Fix64)0)//无
                {
                }
                else if (m_BulletClass.newbul_origin == (Fix64)1)//当前子弹碰撞目标
                {
                    #region 后修改为挂点
                    if (m_BulletClass.old_pos != FixVector3.Zero)
                    {
                        m_AniEffect.transform.position = m_BulletClass.old_pos.ToVector3();
                    }
                    #endregion
                }
                else if (m_BulletClass.newbul_origin == (Fix64)2)//技能释放者
                {
                    #region 后修改为挂点
                    //m_AniEffect.transform.parent = m_Player.m_VGo.transform;
                    m_AniEffect.transform.position = m_BaseObject.m_Pos.ToVector3();
                    #endregion
                }
                else if (m_BulletClass.newbul_origin == (Fix64)3)//当前子弹
                {
                    #region 后修改为挂点
                    if (m_BulletClass.m_taregt != null)
                    {
                        //m_AniEffect.transform.parent = m_Player.m_VGo.transform;
                        m_AniEffect.transform.position = m_BulletClass.m_taregt.m_Pos.ToVector3();
                    }
                    if (m_BulletClass.old_pos != FixVector3.Zero)
                    {
                        m_AniEffect.transform.position = m_BulletClass.old_pos.ToVector3();
                    }
                    #endregion
                }

                //m_AniEffect.transform.localPosition = Vector3.zero + m_BulletNode.effect_xyz;
                m_AniEffect.transform.localRotation = Quaternion.Euler(m_BaseObject.m_Rotation.ToVector3());
                //m_AniEffect.transform.localScale = Vector3.one;
                if (m_BulletNode.effect_timeend != 0)//自然销毁特效
                {
                    Delay end_delay = new Delay();
                    end_delay.InitDestory(m_AniEffect, (Fix64)m_BulletNode.effect_timeend);
                    GameData.m_GameManager.m_DelayManager.m_DelayList.Add(end_delay);
                }
                else if ((Fix64)m_BulletNode.time_max > (Fix64)0)
                {
                    Delay end_delay = new Delay();
                    end_delay.InitDestory(m_AniEffect, (Fix64)m_BulletNode.time_max);
                    GameData.m_GameManager.m_DelayManager.m_DelayList.Add(end_delay);
                }
            }
            #endregion
        }
        #endregion
    }
Example #26
0
        public void InstantiateEffectOnTargetHit(BulletHitEvent e, BulletNode bullet, [JoinByTank] RicochetSoundEffectNode weapon, [JoinAll] SingleNode <SoundListenerBattleStateComponent> soundListener)
        {
            Vector3 position = e.Position;

            weapon.ricochetTargetHitSoundEffect.PlayEffect(position);
        }
Example #27
0
        public void InstantiateEffectOnStaticHit(RicochetBulletBounceEvent e, BulletNode bullet, [JoinByTank] RicochetSoundEffectNode weapon, [JoinAll] SingleNode <SoundListenerBattleStateComponent> soundListener)
        {
            Vector3 worldSpaceBouncePosition = e.WorldSpaceBouncePosition;

            weapon.ricochetBounceSoundEffect.PlayEffect(worldSpaceBouncePosition);
        }
Example #28
0
 public void DestroyBulletsOnRemoveWeapon(NodeRemoveEvent e, WeaponNode weapon, [JoinByTank, Combine] BulletNode bullet)
 {
     bullet.Entity.RemoveComponent <BulletComponent>();
     base.DeleteEntity(bullet.Entity);
 }
Example #29
0
 public void InitializeStack()
 {
     top = null;
 }