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)); }
public SetPrefabModifier(DanmakuPrefab prefab) { if (prefab == null) { throw new System.ArgumentNullException(); } newPrefab = prefab; }
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); }
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; }
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; }