Beispiel #1
0
        public Danmaku SpawnDanmaku(DanmakuPrefab prefab,
                                    Vector2 location,
                                    float rotation)
        {
            if (prefab == null)
            {
                throw new ArgumentNullException("prefab");
            }
            Danmaku danmaku = prefab.Get();

            danmaku.Position = position;
            danmaku.Rotation = rotation;
            return(danmaku);
        }
Beispiel #2
0
        public Danmaku FireLinear(DanmakuPrefab prefab,
                                  Vector2 location,
                                  float rotation,
                                  float speed)
        {
            if (prefab == null)
            {
                throw new ArgumentNullException("prefab");
            }
            Danmaku danmaku = prefab.Get();

            danmaku.Position     = position;
            danmaku.Rotation     = rotation;
            danmaku.Speed        = speed;
            danmaku.AngularSpeed = 0f;
            return(danmaku);
        }
Beispiel #3
0
        public Danmaku Fire()
        {
            Danmaku danmaku = Prefab.Get();

            danmaku.Position     = Position;
            danmaku.Rotation     = Rotation;
            danmaku.Speed        = Speed;
            danmaku.AngularSpeed = AngularSpeed;
            danmaku.Controller  += Controller;
            danmaku.Damage       = Damage;
            danmaku.OnActivate  += OnActivate;
            danmaku.OnDestroy   += OnDestroy;
            if (Color != null)
            {
                Color = Color.Value;
            }
            danmaku.Activate();
            return(danmaku);
        }