diff options
author | chai <chaifix@163.com> | 2022-04-25 09:58:56 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-04-25 09:58:56 +0800 |
commit | 71ae3d755a03a706d93291ca57c6de8e6f0d5926 (patch) | |
tree | ea8e38b0fe6bd860fae5458b4a4ed12b3984920f /SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs | |
parent | 0eff98708ab049559d7891f1aa24e365000caae1 (diff) |
* rename equip to weapon
Diffstat (limited to 'SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs')
-rw-r--r-- | SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs b/SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs deleted file mode 100644 index 8daf999..0000000 --- a/SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -/// <summary> -/// 枪 -/// </summary> -public class Equip_Gun : EquipBase -{ - - public override string name => "枪"; - - public override string iconPath => "art/ui/equipicon/gun"; - - public override AutoMode autoMode => AutoMode.Interval; - - public override float interval => 0.1f; - - private string prefabPath = "prefabs/bullet/bullet"; - - private int index = 0; - - TestPeaceMakerBullet CreateBullet(CrewScript crew, Vector2 dir, float speed, float lifeTime) - { - TestPeaceMakerBullet bullet = UnityEngine.Object.Instantiate<TestPeaceMakerBullet>(ResourceManager.Instance.Load< TestPeaceMakerBullet>(prefabPath)); - - bullet.transform.position = crew.arrow.position + new Vector3(crew.aimDirection.x, crew.aimDirection.y, 0) * -0.3f; - - bullet.Set(dir, speed, lifeTime); - bullet.gameObject.SetActive(true); - - return bullet; - } - - public override void OnTrigger(GameObject owner) - { - CrewScript crew = owner.GetComponent<CrewScript>(); - - index++; - index = index % 3; - - if(index == 0) - { - CreateBullet(crew, TestMathHelper.Rotate(crew.aimDirection, -10 * Mathf.Deg2Rad), 12f, 2f); - } - else if(index == 1) - { - CreateBullet(crew, crew.aimDirection, 12f, 2f); - } - else if(index == 2) - { - CreateBullet(crew, TestMathHelper.Rotate(crew.aimDirection, 10 * Mathf.Deg2Rad), 12f, 2f); - } - - } - -}
\ No newline at end of file |