Пример #1
0
        void DanmakuDisplay()
        {
            if (selectedDanmaku == null)
            {
                return;
            }

            EditorGUILayout.LabelField("Danmaku Properties");
            EditorGUI.indentLevel++;
            selectedDanmaku.Position = EditorGUILayout.Vector2Field("Position", selectedDanmaku.Position);
            float rotation = (selectedDanmaku.Rotation % 360f + 360f) % 360f - 180f;

            selectedDanmaku.Rotation     = EditorGUILayout.Slider("Rotation", rotation, -180f, 180f);
            selectedDanmaku.Size         = EditorGUILayout.FloatField("Size", selectedDanmaku.Size);
            selectedDanmaku.Color        = EditorGUILayout.ColorField("Color", selectedDanmaku.Color);
            selectedDanmaku.Speed        = EditorGUILayout.FloatField("Speed", selectedDanmaku.Speed);
            selectedDanmaku.AngularSpeed = EditorGUILayout.FloatField("Angular Speed", selectedDanmaku.AngularSpeed);

            EditorGUILayout.LabelField("Frames", selectedDanmaku.Frames.ToString());
            EditorGUILayout.LabelField("Time", selectedDanmaku.Time.ToString());
            EditorGUI.indentLevel--;
            EditorGUILayout.LabelField("Prefab Properties");
            EditorGUI.indentLevel++;
            DanmakuPrefab prefab = selectedDanmaku.Prefab;
            DanmakuType   type   = selectedDanmaku.Type;

            EditorGUILayout.ObjectField("Prefab", prefab, typeof(DanmakuPrefab));
            type.Size  = EditorGUILayout.FloatField("Size", type.Size);
            type.Color = EditorGUILayout.ColorField("Color", type.Color);
            EditorGUILayout.LabelField("Tag", prefab.tag);
            EditorGUILayout.LabelField("Layer", LayerMask.LayerToName(selectedDanmaku.Prefab.gameObject.layer));
        }
Пример #2
0
 public SetPrefabModifier(DanmakuPrefab prefab)
 {
     if (prefab == null)
     {
         throw new System.ArgumentNullException();
     }
     newPrefab = prefab;
 }
Пример #3
0
        public override void OnFire(Vector2 position, DynamicFloat rotation)
        {
            DanmakuPrefab oldPrefab = Prefab;

            Prefab = newPrefab;

            FireSingle(position, rotation);

            Prefab = oldPrefab;
        }
 public static IEnumerable<Danmaku> Match(this IEnumerable<Danmaku> danmakus, DanmakuPrefab prefab, Func<Danmaku, bool> filter = null)
     {
     return danmakus.ForEach(x => prefab.Match(x), filter);
 }
Пример #5
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;
 }
Пример #6
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;
 }