Ejemplo n.º 1
0
        public Danmaku FireCurved(DanmakuPrefab prefab,
                                  Vector2 location,
                                  float rotation,
                                  float speed,
                                  float angularSpeed)
        {
            if (prefab == null)
            {
                throw new ArgumentNullException("prefab");
            }
            Danmaku danmaku = prefab.Get();

            danmaku.Position     = position;
            danmaku.Rotation     = rotation;
            danmaku.Speed        = speed;
            danmaku.AngularSpeed = angularSpeed;
            return(danmaku);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Handles a Danmaku collision. Only ever called with Danmaku that pass the filter.
 /// </summary>
 /// <param name="danmaku">the danmaku that hit the collider.</param>
 /// <param name="info"> additional information about the collision</param>
 protected abstract void DanmakuCollision(Danmaku danmaku,
                                          RaycastHit2D info);
Ejemplo n.º 4
0
 /// <summary>
 /// Handles a Danmaku collision. Only ever called with Danmaku that pass the filter.
 /// </summary>
 /// <param name="danmaku">the danmaku that hit the collider.</param>
 /// <param name="info"> additional information about the collision</param>
 protected abstract void DanmakuCollision(Danmaku danmaku,
                                          RaycastHit2D info);
Ejemplo n.º 5
0
 /// <summary>
 /// Called on collision with any Danmaku
 /// </summary>
 /// <param name="proj">Proj.</param>
 public void OnDanmakuCollision(Danmaku danmaku, RaycastHit2D info) {
     if (tags == null ||tags.Contains(danmaku.Tag))
         DanmakuCollision(danmaku, info);
 }