From 71ae3d755a03a706d93291ca57c6de8e6f0d5926 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Apr 2022 09:58:56 +0800 Subject: * rename equip to weapon --- SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs | 57 ------------------------- 1 file changed, 57 deletions(-) delete mode 100644 SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs (limited to 'SurvivalTest/Assets/Scripts/Equips/Equip_Gun.cs') 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; - -/// -/// 枪 -/// -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(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(); - - 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 -- cgit v1.1-26-g67d0