示例#1
0
        private void AddOrChangeWeaponBlockedComponent(Entity weapon, RaycastHit hitInfo)
        {
            WeaponBlockedComponent component = !weapon.HasComponent <WeaponBlockedComponent>() ? ((WeaponBlockedComponent)weapon.CreateNewComponentInstance(typeof(WeaponBlockedComponent))) : weapon.GetComponent <WeaponBlockedComponent>();

            component.BlockPoint      = PhysicsUtil.GetPulledHitPoint(hitInfo);
            component.BlockGameObject = hitInfo.collider.gameObject;
            component.BlockNormal     = hitInfo.normal;
            StateUtils.SwitchEntityState(weapon, component, this.weaponStates);
        }
        public void CreateBlockedExplosionEffect(BaseShotEvent evt, BlockedWeaponNode node)
        {
            HitExplosionGraphicsComponent hitExplosionGraphics = node.hitExplosionGraphics;
            WeaponBlockedComponent        weaponBlocked        = node.weaponBlocked;
            Vector3 position = weaponBlocked.BlockPoint - (evt.ShotDirection * hitExplosionGraphics.ExplosionOffset);

            if (hitExplosionGraphics.UseForBlockedWeapon)
            {
                this.DrawExplosionEffect(position, weaponBlocked.BlockNormal, hitExplosionGraphics.ExplosionAsset, hitExplosionGraphics.ExplosionDuration, node);
            }
        }
示例#3
0
        public void PrepareSplashTargetsWhenBlockedWeapon(ShotPrepareEvent evt, BlockedWeaponNode weapon)
        {
            WeaponBlockedComponent weaponBlocked = weapon.weaponBlocked;
            StaticHit staticHit = new StaticHit {
                Position = weaponBlocked.BlockPoint,
                Normal   = weaponBlocked.BlockNormal
            };
            SplashHitData splashHit = SplashHitData.CreateSplashHitData(new List <HitTarget>(), staticHit, weapon.Entity);

            base.ScheduleEvent(new CollectSplashTargetsEvent(splashHit), weapon);
        }