From 2951321e24a539b2de5220177390e0c39b5765bc Mon Sep 17 00:00:00 2001 From: wlt233 <1486185683@qq.com> Date: Fri, 17 Mar 2023 15:13:16 +0800 Subject: [PATCH] add change mode --- Assets/Main.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Assets/Main.cs b/Assets/Main.cs index 7a46cac..398dc40 100644 --- a/Assets/Main.cs +++ b/Assets/Main.cs @@ -20,7 +20,7 @@ public class Main : MonoBehaviour private int style = -1; public List effectId; private int effect = -1; - private int mode = -1; + private int mode = 0; void Start() { @@ -50,7 +50,10 @@ public class Main : MonoBehaviour void Update() { - ; + if (Input.GetMouseButtonDown(2)) + { + ChangeMode(); + } } void LoadAb(string abPath) @@ -65,14 +68,29 @@ public class Main : MonoBehaviour controller = charm.GetComponent(); charm.AddComponent(); styleId.Clear(); + style = -1; for (int i = 0; i < controller.weaponMaterialList.Length; i++) { styleId.Add(controller.weaponMaterialList[i].colorIndex); } effectId.Clear(); + effect = -1; for (int i = 0; i < controller.specialEffectList.Length; i++) { effectId.Add(controller.specialEffectList[i].id); } + mode = 0; } + + + void ChangeMode() + { + mode++; + controller.SetAnimeSpeed(.5f); + if (mode % 2 == 0) + controller.WeaponChangeOnly(WeaponMode.WeaponTypeA); + else + controller.WeaponChangeOnly(WeaponMode.WeaponTypeB); + } + }