Exemplo n.º 1
0
        public static DMKCurveProperty Copy(DMKCurveProperty p)
        {
            DMKCurveProperty n = new DMKCurveProperty();

            n.value  = p.value;
            n.type   = p.type;
            n.curve  = DMKUtil.CopyCurve(p.curve);
            n.valEnd = p.valEnd;
            n.Update(0, true);
            return(n);
        }
Exemplo n.º 2
0
        public override void OnShoot(int frame)
        {
            float start = _currentAngle;
            float t     = (float)frame / 60f;

            if (this.startAngle.type != DMKCurvePropertyType.Constant)
            {
                _currentAngle = this.startAngle.Update(t, true);
            }
            else
            {
                _currentAngle += _acceleration;
                _acceleration += accel2;
                if (_currentAngle > 360)
                {
                    _currentAngle -= 360;
                }
            }

            if (trackTarget && targetObject != null)
            {
                start = DMKUtil.GetDgrBetweenObjects(this.parentController.gameObject, targetObject);
            }
            for (int i = 0; i < bulletCount; ++i)
            {
                float   angle = angleRange.Update(t) / bulletCount * i + start;
                Vector3 diff  = Vector3.zero;
                if (radius.Update(t) != 0f)
                {
                    diff = new Vector3(Mathf.Cos(angle * Mathf.Deg2Rad) * radius.get(),
                                       Mathf.Sin(angle * Mathf.Deg2Rad) * radius.get(),
                                       0);
                }
                this.ShootBullet(diff,
                                 angle);
            }
        }
Exemplo n.º 3
0
 public override void OnInit()
 {
     _currentAngle = startAngle.Update(0, true);
     _acceleration = accel1;
 }