Пример #1
0
 protected void Subfire(DanmakuConfig state)
 {
     if (Child == null)
     {
         return;
     }
     Child.Fire(state);
 }
Пример #2
0
        public void Fire(DanmakuConfig state)
        {
            var subemitter = Subemitters[Mathf.FloorToInt(Random.value * Subemitters.Count)];

            if (subemitter != null)
            {
                subemitter.Fire(state);
            }
        }
Пример #3
0
        public override void Fire(DanmakuConfig config)
        {
            var count      = Mathf.RoundToInt(Count.GetValue());
            var deltaSpeed = DeltaSpeed.GetValue();

            for (var i = 0; i < count; i++)
            {
                config.Speed += deltaSpeed;
                Subfire(config);
            }
        }
        public override void Fire(FireableInfo fireableInfo, DanmakuConfig config)
        {
            int c      = Mathf.RoundToInt(count.GetValue());
            var dSpeed = deltaSpeed.GetValue();

            for (var i = 0; i < c; i++)
            {
                config.speed += dSpeed;
                SubFire(fireableInfo, config);
            }
        }
Пример #5
0
 public override void Fire(DanmakuConfig state) {
   float radius = Radius.GetValue();
   int count = Mathf.RoundToInt(Count.GetValue());
   var rotation = state.Rotation.GetValue();
   var currentState = state;
   for (int i = 0; i < count; i++) {
     var angle = rotation + i * (Mathf.PI * 2 / count);
     currentState.Position = state.Position + (radius * RotationUtiliity.ToUnitVector(angle));
     currentState.Rotation = angle;
     Subfire(currentState);
   }
 }
        public override void Fire(FireableInfo fireableInfo, DanmakuConfig config)
        {
            float r        = radius.GetValue();
            int   c        = Mathf.RoundToInt(count.GetValue());
            var   rotation = config.rotation;
            var   origin   = config.position;

            config.rotation = rotation;
            for (int i = 0; i < c; i++)
            {
                float   angle = i * Mathf.PI * 2 / c;
                float   x     = Mathf.Cos(angle) * r;
                float   z     = Mathf.Sin(angle) * r;
                Vector3 pos   = origin + new Vector3(x, 0, z);

                //float angleDegrees = -angle * Mathf.Rad2Deg;
                //Quaternion rot = Quaternion.Euler(0, angleDegrees, 0);

                config.position = Helpers.RotatePointAroundPivot(pos, origin, rotation);
                config.rotation = rotation;
                SubFire(fireableInfo, config);
            }
        }
Пример #7
0
 public abstract void Fire(DanmakuConfig state);
Пример #8
0
 public override void Fire(DanmakuConfig state)
 {
     _fireAction(Subfire, state);
 }
Пример #9
0
 public virtual void Fire(DanmakuConfig state)
 {
 }
Пример #10
0
 public override void Fire(DanmakuConfig state)
 {
     state.Color = _source.Evaluate(Random.value);
     Subfire(state);
 }