added platfrom break effect
This commit is contained in:
@@ -13,6 +13,9 @@ public class Player : MonoBehaviour, IPlayer
|
||||
[SerializeField] private ParticleSystem jumpParticle;
|
||||
[SerializeField] private CinemachineImpulseSource cinemachineImpulseSource;
|
||||
|
||||
[SerializeField] private Material playerMaterial;
|
||||
[SerializeField] Color[] playerMaterialColors;
|
||||
|
||||
public bool isDead { get; private set; }
|
||||
|
||||
[Inject] private IDeathScreenController IdeathScreenController;
|
||||
@@ -22,6 +25,7 @@ public class Player : MonoBehaviour, IPlayer
|
||||
private void Start()
|
||||
{
|
||||
isDead = false;
|
||||
playerMaterial.color = playerMaterialColors[Random.Range(0, playerMaterialColors.Length)];
|
||||
}
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
@@ -46,8 +50,8 @@ public class Player : MonoBehaviour, IPlayer
|
||||
float splashYPos = collision.transform.position.y + 0.155f;
|
||||
ContactPoint contact = collision.contacts[0];
|
||||
Vector3 surfacePoint = new Vector3(contact.point.x, splashYPos, contact.point.z);
|
||||
GameObject instancedSplash = Instantiate(splashObject, surfacePoint, splashObject.transform.rotation, splashParent);
|
||||
instancedSplash.transform.localScale = new Vector3(Random.Range(0.08f, 0.1f), Random.Range(0.08f, 0.1f),1);
|
||||
GameObject instancedSplash = Instantiate(splashObject, surfacePoint, splashObject.transform.rotation, collision.gameObject.transform);
|
||||
instancedSplash.transform.localScale = new Vector3(Random.Range(0.05f, 0.09f), Random.Range(0.05f, 0.09f),1);
|
||||
Destroy(instancedSplash, 2f);
|
||||
}
|
||||
private void Die()
|
||||
|
||||
Reference in New Issue
Block a user