Adjust player and jump pad physics parameters; refine visual effects and project settings
This commit is contained in:
@@ -10,15 +10,7 @@ namespace Infrastructure.Unity
|
||||
[Self][SerializeField] private MeshRenderer meshRenderer;
|
||||
|
||||
public event Action OnCollected;
|
||||
|
||||
private MaterialPropertyBlock _propBlock;
|
||||
private static readonly int ColorProperty = Shader.PropertyToID("_BaseColor");
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_propBlock = new MaterialPropertyBlock();
|
||||
}
|
||||
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.TryGetComponent<PlayerController>(out var player))
|
||||
@@ -28,8 +20,7 @@ namespace Infrastructure.Unity
|
||||
var vfx = Instantiate(pickupVfx, transform.position, Quaternion.identity);
|
||||
var main = vfx.main;
|
||||
|
||||
meshRenderer.GetPropertyBlock(_propBlock);
|
||||
var currentColor = _propBlock.GetColor(ColorProperty);
|
||||
var currentColor = meshRenderer.material.color;
|
||||
main.startColor = currentColor;
|
||||
|
||||
Destroy(vfx.gameObject, 2f);
|
||||
|
||||
Reference in New Issue
Block a user