public void UpdateTracer(UpdateEvent evt, WeaponStreamTracerShootingEffectNode weapon) { WeaponStreamTracerBehaviour component = weapon.weaponStreamTracerEffect.Tracer.GetComponent<WeaponStreamTracerBehaviour>(); if (!weapon.Entity.HasComponent<StreamHitComponent>()) { component.TargetPosition = new Vector3(0f, 0f, weapon.weaponStreamTracerEffect.TracerMaxLength); } else { base.ScheduleEvent<UpdateWeaponStreamTracerByStreamHitEvent>(weapon); } }
public void UpdateTracer(UpdateWeaponStreamTracerByStreamHitEvent evt, WeaponStreamTracerStreamHitNode weapon) { StreamHitComponent streamHit = weapon.streamHit; GameObject tracer = weapon.weaponStreamTracerEffect.Tracer; WeaponStreamTracerBehaviour component = tracer.GetComponent<WeaponStreamTracerBehaviour>(); if (streamHit.StaticHit != null) { component.TargetPosition = MathUtil.WorldPositionToLocalPosition(streamHit.StaticHit.Position, tracer); } else if ((streamHit.TankHit != null) && weapon.Entity.HasComponent<StreamHitTargetLoadedComponent>()) { UpdateWeaponStreamTracerByTargetTankEvent eventInstance = new UpdateWeaponStreamTracerByTargetTankEvent { WeaponStreamTracerBehaviour = component, Hit = streamHit.TankHit, WeaponStreamTracerInstance = tracer }; base.ScheduleEvent(eventInstance, streamHit.TankHit.Entity); } }