Example #1
0
        public Danmaku FireCurved(DanmakuPrefab prefab,
                                  Vector2 location,
                                  DynamicFloat rotation,
                                  DynamicFloat speed,
                                  DynamicFloat angularSpeed,
                                  CoordinateSystem coordSys = CoordinateSystem.View,
                                  DanmakuModifier modifier  = null)
        {
            if (TargetField == null)
            {
                TargetField = this;
            }
            Vector2 position = TargetField.WorldPoint(location, coordSys);

            if (modifier == null)
            {
                Danmaku danmaku = Danmaku.GetInactive(prefab, position, rotation);
                danmaku.Field = this;
                danmaku.Activate();
                danmaku.Speed        = speed;
                danmaku.AngularSpeed = angularSpeed;
                return(danmaku);
            }
            else
            {
                FireData temp = new FireData();
                temp.Prefab       = prefab;
                temp.Speed        = speed;
                temp.AngularSpeed = angularSpeed;
                temp.Field        = this;
                modifier.Initialize(temp);
                modifier.OnFire(position, rotation);
                return(null);
            }
        }
        public Danmaku Fire()
        {
            Danmaku danmaku = Danmaku.GetInactive(this);

            danmaku.Field = Field;
            danmaku.Activate();
            return(danmaku);
        }
Example #3
0
        public Danmaku SpawnDanmaku(DanmakuPrefab bulletType, Vector2 location, DynamicFloat rotation, CoordinateSystem coordSys = CoordinateSystem.View)
        {
            if (TargetField == null)
            {
                TargetField = this;
            }
            Danmaku bullet = Danmaku.GetInactive(bulletType, TargetField.WorldPoint(location, coordSys), rotation);

            bullet.Field = TargetField;
            bullet.Activate();
            return(bullet);
        }