optimized projectile initialization in Root.cs
This commit is contained in:
parent
7f4f5ac7a8
commit
d58496a08b
@ -36,9 +36,9 @@ public class Root : MonoBehaviour
|
|||||||
Vector3 spawnPos = (_projectileSpawn == null) ? _rigidbodyAlly.position : _projectileSpawn.position;
|
Vector3 spawnPos = (_projectileSpawn == null) ? _rigidbodyAlly.position : _projectileSpawn.position;
|
||||||
GameObject _newArrow = Instantiate(_projectile, spawnPos, Quaternion.identity);
|
GameObject _newArrow = Instantiate(_projectile, spawnPos, Quaternion.identity);
|
||||||
|
|
||||||
//Warning : the Speed of the arrow is equal to the speed of this unit, if this unit need to move, use an other variable !
|
var projectile = _newArrow.GetComponent<Projectile>();
|
||||||
_newArrow.GetComponent<Projectile>().Damage = _entity.AttackDamage;
|
projectile.Damage = _entity.AttackDamage;
|
||||||
_newArrow.GetComponent<Projectile>().Origin = _entity;
|
projectile.Origin = _entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlaySound(string soundName)
|
public void PlaySound(string soundName)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user