-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProjectileBehaviour.cs
53 lines (43 loc) · 1.35 KB
/
ProjectileBehaviour.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Behaviours/Projectile Behaviour")]
public class ProjectileBehaviour : ScriptableObject
{
[Header("Visuals")]
[SerializeField]
private GameObject _baseVisual;
public GameObject BaseVisual => _baseVisual;
[Header("Behaviour")]
[SerializeField]
private DamageInstance hitscanDamage;
public DamageInstance HitscanDamage => hitscanDamage;
[SerializeField]
private Hitbox[] hitboxes;
public Hitbox[] Hitboxes => hitboxes;
[SerializeField]
private ProjectileBehaviour[] _explosionProjectiles;
public ProjectileBehaviour[] ExplosionProjectiles => _explosionProjectiles;
[System.Flags]
public enum ProjectileBehaviours
{
None = 0,
ExplodeOnImpact = 1,
StickInSurface = 2,
DestroyOnImpact = 4,
HitWhileImpacted = 8,
HitScan = 16
}
[SerializeField]
private ProjectileBehaviours _behaviours;
public ProjectileBehaviours Behaviours => _behaviours;
[SerializeField]
private float _projectileSpeed;
public float ProjectileSpeed => _projectileSpeed;
[SerializeField]
private Vector3 _gravity;
public Vector3 Gravity => _gravity;
[SerializeField]
private int _lifetime;
public int Lifetime => _lifetime;
}