WXMC/.svn/pristine/52/52c2d0c94f8f7798886681d6942d194f395283ce.svn-base

77 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-12-04 16:18:46 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PHomeFirer : MonoBehaviour
{
[SerializeField]
protected float m_shootRate;
private PHomeWeaponBase m_weapon;
protected PHomeWeaponBase Weapon
{
get
{
if (m_weapon == null)
{
m_weapon = GetComponent<PHomeWeaponBase>();
}
return m_weapon;
}
}
public PHomeUnit Unit
{
get
{
return Weapon.Unit;
}
}
protected GameObject ProjectilePrefab
{
get
{
return Weapon.ProjectilePrefab;
}
}
protected Vector2 AimDirection
{
get
{
return Unit.AimDirection;
}
}
protected ShootData GetShootData()
{
return new ShootData()
{
Unit = Unit,
Weapon = Weapon,
StartPoint = transform.position,
};
}
protected void ShootProjectiles(ShootData baseData, int count = 1)
{
for (int i = 0; i < count; i++)
{
PHomeProjectile proj = PHomeGameMode.main.SpawnProjectile(Unit, baseData, ProjectilePrefab);
}
}
public virtual bool CanFire()
{
throw new System.NotImplementedException();
}
public virtual IEnumerator Fire(int count)
{
throw new System.NotImplementedException();
}
}