You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
460 B
20 lines
460 B
2 years ago
|
using UnityEngine;
|
||
|
|
||
|
|
||
|
namespace FFmpeg.Demo.REC
|
||
|
{
|
||
|
public class RecDemoBall : MonoBehaviour
|
||
|
{
|
||
|
public AudioClip ballHitSound;
|
||
|
public AudioSource source;
|
||
|
[Range(0, 1)]
|
||
|
public float voice = 0.5f;
|
||
|
public Rigidbody body;
|
||
|
|
||
|
void OnCollisionEnter(Collision collision)
|
||
|
{
|
||
|
source.PlayOneShot(ballHitSound, voice);
|
||
|
body.AddForce(Vector3.up * 10, ForceMode.Impulse);
|
||
|
}
|
||
|
}
|
||
|
}
|