您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
831 B
31 行
831 B
using UnityEngine;
|
|
|
|
public class ShellExplosion : MonoBehaviour
|
|
{
|
|
public LayerMask m_TankMask;
|
|
public ParticleSystem m_ExplosionParticles;
|
|
public AudioSource m_ExplosionAudio;
|
|
public float m_MaxDamage = 100f;
|
|
public float m_ExplosionForce = 1000f;
|
|
public float m_MaxLifeTime = 2f;
|
|
public float m_ExplosionRadius = 5f;
|
|
|
|
|
|
private void Start()
|
|
{
|
|
Destroy(gameObject, m_MaxLifeTime);
|
|
}
|
|
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
// Find all the tanks in an area around the shell and damage them.
|
|
}
|
|
|
|
|
|
private float CalculateDamage(Vector3 targetPosition)
|
|
{
|
|
// Calculate the amount of damage a target should take based on it's position.
|
|
return 0f;
|
|
}
|
|
}
|