2
0
龙腾猫跃 4 жил өмнө
parent
commit
78241ac3dd

+ 1 - 1
Assets/Resources/Dice/Dice.prefab

@@ -79,7 +79,7 @@ SpriteRenderer:
   m_SortingLayer: 2
   m_SortingOrder: 1000
   m_Sprite: {fileID: 21300000, guid: 99c4f3f06e1d0524b8adb53534e796b1, type: 3}
-  m_Color: {r: 0.62352943, g: 0.68235296, b: 0.7294118, a: 1}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
   m_FlipX: 0
   m_FlipY: 0
   m_DrawMode: 0

+ 8 - 8
Assets/Resources/Dice/DiceEntity.cs

@@ -22,11 +22,11 @@ public class DiceEntity : MonoBehaviour {
     private void OnCollisionEnter2D(Collision2D collision) {
         if (!collision.gameObject.CompareTag("Player")) return;
         AudioM.Play("DicePickup1");
-        // 关闭其他移动
+        // 鍏抽棴鍏朵粬绉诲姩
         GetComponent<Collider2D>().enabled = false;
         GetComponent<Rigidbody2D>().gravityScale = 0;
         GetComponent<Rigidbody2D>().velocity = Vector2.zero;
-        // 开始旋转
+        // 寮€濮嬫棆杞�
         transform.DORotate(new Vector3(0, 0, 360f * Mathf.RoundToInt(rollTime * 1.5f)), rollTime, RotateMode.FastBeyond360);
         transform.DOScale(1, rollTime).SetRelative();
         transform.DOMoveY(transform.position.y + 2, rollTime);
@@ -43,32 +43,32 @@ public class DiceEntity : MonoBehaviour {
             UpdateSpriteText();
             yield return new WaitForSeconds(0.333f);
         }
-        // 最终确定
+        // 鏈€缁堢‘瀹�
         string possible = InputM.GetPossibleResults(key, canRestore);
         Debug.Log(possible);
         currentLetter = Modules.RandomOne(possible.ToCharArray().ToList()).ToString();
         UpdateSpriteText();
         yield return new WaitForSeconds(0.5f);
-        // 强调动画
+        // 寮鸿皟鍔ㄧ敾
         AudioM.Play("DicePickup2");
         transform.DOScale(0.5f, 0.1f).SetRelative();
         yield return new WaitForSeconds(0.1f);
         transform.DOScale(-0.2f, 0.1f).SetRelative();
         yield return new WaitForSeconds(0.7f);
-        // 结束动画
+        // 缁撴潫鍔ㄧ敾
         transform.DOScale(-1.3f, endTime).SetRelative();
         GameObject endObj = InputM.GetDiceUI(key);
         Vector2 screenPos = RectTransformUtility.WorldToScreenPoint(AspectUtility.cam, endObj.transform.position);
         transform.DOMove((Vector2) AspectUtility.cam.ScreenToWorldPoint(screenPos), endTime);
         yield return new WaitForSeconds(endTime);
-        // 设置
+        // 璁剧疆
         InputM.SetKey(key, currentLetter);
         endObj.GetComponent<DiceUI>().isDropped = false;
         endObj.GetComponent<DiceUI>().UpdateColor();
         yield return new WaitForSeconds(0.1f);
-        // 销毁
+        // 閿€姣�
         transform.localScale = Vector3.zero; Destroy(gameObject, 1);
     }
 
 
-}
+}

+ 1 - 4
Assets/Resources/Dice/DiceUI.cs

@@ -28,10 +28,7 @@ public class DiceUI : MonoBehaviour {
     }
     public void UpdateColor() {
         spriteBg.DOColor(isKeyDown ?
-            new Color(168f / 255f, 255f / 255f, 177f / 255f, isDropped ? 0.3f : 1f) :
-            new Color(159f / 255f, 174f / 255f, 186f / 255f, isDropped ? 0.3f : 1f), 0.05f);
-        spriteLetter.DOColor(isKeyDown ?
-            new Color(168f / 255f, 255f / 255f, 177f / 255f, isDropped ? 0.3f : 1f) :
+            new Color(247f / 255f, 142f / 255f, 48f / 255f, isDropped ? 0.3f : 1f) :
             new Color(1f, 1f, 1f, isDropped ? 0.3f : 1f), 0.05f);
     }
 

BIN
Assets/Resources/Dice/Images/die_bg.png


+ 1 - 1
Assets/Resources/Dice/Images/die_bg.png.meta

@@ -47,7 +47,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 72
+  spritePixelsToUnits: 128
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
   alphaUsage: 1

BIN
Assets/Resources/Dice/Images/die_cover_attack.png


+ 1 - 1
Assets/Resources/Dice/Images/die_cover_attack.png.meta

@@ -47,7 +47,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 72
+  spritePixelsToUnits: 128
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
   alphaUsage: 1

BIN
Assets/Resources/Dice/Images/die_cover_down.png


+ 1 - 1
Assets/Resources/Dice/Images/die_cover_down.png.meta

@@ -47,7 +47,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 72
+  spritePixelsToUnits: 128
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
   alphaUsage: 1

BIN
Assets/Resources/Dice/Images/die_cover_lefft.png


+ 1 - 1
Assets/Resources/Dice/Images/die_cover_lefft.png.meta

@@ -47,7 +47,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 72
+  spritePixelsToUnits: 128
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
   alphaUsage: 1

BIN
Assets/Resources/Dice/Images/die_cover_refresh.png


+ 1 - 1
Assets/Resources/Dice/Images/die_cover_refresh.png.meta

@@ -47,7 +47,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 72
+  spritePixelsToUnits: 128
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
   alphaUsage: 1

BIN
Assets/Resources/Dice/Images/die_cover_right.png


+ 1 - 1
Assets/Resources/Dice/Images/die_cover_right.png.meta

@@ -47,7 +47,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 72
+  spritePixelsToUnits: 128
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
   alphaUsage: 1

BIN
Assets/Resources/Dice/Images/die_cover_up.png


+ 1 - 1
Assets/Resources/Dice/Images/die_cover_up.png.meta

@@ -47,7 +47,7 @@ TextureImporter:
   spriteMeshType: 1
   alignment: 0
   spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 72
+  spritePixelsToUnits: 128
   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
   spriteGenerateFallbackPhysicsShape: 1
   alphaUsage: 1

+ 7 - 7
Assets/Resources/Entities/Player.cs

@@ -91,7 +91,6 @@ public class Player : EntityBase {
             currentReloadDelay -= Time.deltaTime;
         }
         // 开火
-        bool autoReload = false;
         if (InputM.GetKeyEvent(InputM.KeyType.Fire) && currentBullet > 0 && currentShootDelay <= 0f && currentReloadDelay <= 0f) {
             AudioM.Play("fire");
             currentBullet--; currentShootDelay = shootDelay;
@@ -105,15 +104,16 @@ public class Player : EntityBase {
             rb.velocity += bulletKnockback * -shootVector;
         } else if (currentShootDelay > 0) {
             currentShootDelay -= Time.deltaTime;
-        } else if (autoReload && InputM.GetKeyEvent(InputM.KeyType.Fire) && currentBullet == 0 && currentShootDelay <= 0f && currentReloadDelay <= 0f) {
-            AudioM.Play("reload");
-            currentReloadDelay = reloadDelay;
         }
         // 更新 UI
+        {
+
+        }
+        // ���� UI
         textBullet.text = currentReloadDelay > 0f ?
-            "".PadLeft(maxBullet - Mathf.RoundToInt(currentReloadDelay / reloadDelay * maxBullet), "|".ToCharArray().First()) : 
+            "".PadLeft(maxBullet - Mathf.RoundToInt(currentReloadDelay / reloadDelay * maxBullet), "|".ToCharArray().First()) :
             "".PadLeft(currentBullet, "|".ToCharArray().First());
-        textBullet.color = currentReloadDelay > 0f ? new Color(0.6f, 0.6f, 0.6f) : new Color(0.6588235f, 1f, 0.6941177f);
+        textBullet.color = currentReloadDelay > 0f ? new Color(0.6f, 0.6f, 0.6f) : new Color(0.9686275f, 0.5568628f, 0.1098039f);
     }
 
-}
+}

+ 12 - 12
Assets/Resources/System/InputM.cs

@@ -5,7 +5,7 @@ using System.Linq;
 
 public class InputM : MonoBehaviour {
     public GameObject dicePrefab;
-    
+
     public static string keyLeft = "a", keyRight = "d", keyJump = "w", keyCrouch = "s", keyFire = "l", keyReload = "r";
     public enum KeyType { Left, Right, Jump, Crouch, Fire, Reload }
 
@@ -90,31 +90,31 @@ public class InputM : MonoBehaviour {
     public static string GetPossibleResults(KeyType key, bool doRestore) {
         List<string> accepted = "wasdlr".ToList().Select(c => c.ToString()).ToList();
         List<string> refused = new();
-        // 删除冲突键位
-        //  - 不能同时跳跃、蹲下
-        if (key == KeyType.Jump) refused.Add(GetKeyRaw(KeyType.Crouch)); 
+        // 鍒犻櫎鍐茬獊閿�綅
+        //  - 涓嶈兘鍚屾椂璺宠穬銆佽共涓�
+        if (key == KeyType.Jump) refused.Add(GetKeyRaw(KeyType.Crouch));
         if (key == KeyType.Crouch) refused.Add(GetKeyRaw(KeyType.Jump));
-        //  - 不能同时向左、向右
+        //  - 涓嶈兘鍚屾椂鍚戝乏銆佸悜鍙�
         if (key == KeyType.Left) refused.Add(GetKeyRaw(KeyType.Right));
         if (key == KeyType.Right) refused.Add(GetKeyRaw(KeyType.Left));
-        //  - 不能同时开火、装弹
+        //  - 涓嶈兘鍚屾椂寮€鐏�€佽�寮�
         if (key == KeyType.Fire) refused.Add(GetKeyRaw(KeyType.Reload));
         if (key == KeyType.Reload) refused.Add(GetKeyRaw(KeyType.Fire));
-        // 禁止选择已经有两个绑定项的字母、尽量选择没有绑定项的字母
+        // 绂佹�閫夋嫨宸茬粡鏈変袱涓�粦瀹氶」鐨勫瓧姣嶃€佸敖閲忛€夋嫨娌℃湁缁戝畾椤圭殑瀛楁瘝
         foreach (string letter in "wasdlr".ToCharArray().Select(c => c.ToString())) {
             if (keyTypes.Count(keyType => GetKeyRaw(keyType) == letter) >= 2) refused.Add(letter);
             if (keyTypes.Count(keyType => GetKeyRaw(keyType) == letter) == 0) { accepted.Add(letter); accepted.Add(letter); }
         }
-        // 禁止与当前项相同
+        // 绂佹�涓庡綋鍓嶉」鐩稿悓
         refused.Add(GetKeyRaw(key));
-        // 是否可以还原回原始键位
+        // 鏄�惁鍙�互杩樺師鍥炲師濮嬮敭浣�
         if (!doRestore) refused.Add(GetKeyRawDefault(key));
         if (doRestore) for (int i = 0; i < 10; i++) accepted.Add(GetKeyRawDefault(key));
-        // 输出
+        // 杈撳嚭
         string resultStr = "";
         accepted.ForEach(resultChar => {
             foreach (string refusedChar in refused) if (resultChar == refusedChar) return;
-            resultStr += resultChar; 
+            resultStr += resultChar;
         });
         return resultStr;
     }
@@ -123,4 +123,4 @@ public class InputM : MonoBehaviour {
         GetDiceUI(key).GetComponent<DiceUI>().DropDice();
     }
 
-}
+}

+ 16 - 16
Assets/Resources/System/StoryM.cs

@@ -8,21 +8,21 @@ using System.Linq;
 
 public class StoryM : MonoBehaviour {
 
-    // 文本
+    // 鏂囨湰
     public TMPro.TextMeshProUGUI textStory;
     public RectTransform shapeBack;
     /// <summary>
-    /// 设置旁白,并返回预期时间。旁白字幕将在预期时间后消失。
+    /// 璁剧疆鏃佺櫧锛屽苟杩斿洖棰勬湡鏃堕棿銆傛梺鐧藉瓧骞曞皢鍦ㄩ�鏈熸椂闂村悗娑堝け銆�
     /// </summary>
     public float SetStoryText(string textCn, string textEn = "English") {
         bool isCn = LocalizationSettings.SelectedLocale.LocaleName == "Chinese (Simplified) (zh-CN)";
         textStory.text = isCn ? textCn : textEn;
         LayoutRebuilder.ForceRebuildLayoutImmediate(textStory.rectTransform);
-        // 动画
+        // 鍔ㄧ敾
         textStory.color = Color.black;
         DOTween.Kill("StoryFont"); textStory.DOColor(Color.white, 0.25f).SetId("StoryFont");
         DOTween.Kill("StoryBackground"); shapeBack.DOScaleX((textStory.rectTransform.rect.width + 40f) / 100f, 0.15f).SetId("StoryBackground");
-        // 消失
+        // 娑堝け
         float time = 1.5f + (isCn ? textCn.Length / 3f : textEn.Split(" ").Length / 3f);
         StopCoroutine("WaitForHideStoryText"); StartCoroutine("WaitForHideStoryText", time);
         Debug.Log(time + " -> " + textCn);
@@ -38,10 +38,10 @@ public class StoryM : MonoBehaviour {
         DOTween.Kill("StoryBackground"); shapeBack.DOScaleX(0, 0.2f).SetId("StoryBackground");
     }
 
-    // 刷怪
+    // 鍒锋€�
     private Dictionary<Spawner.EnemyType, List<Spawner>> spawners = null;
     public void Spawn(Spawner.EnemyType type, int count = 1) {
-        // 初始化
+        // 鍒濆�鍖�
         if (spawners == null) {
             spawners = new();
             foreach (Spawner spawner in FindObjectsOfType<Spawner>()) {
@@ -52,7 +52,7 @@ public class StoryM : MonoBehaviour {
                 }
             }
         }
-        // 实际刷怪
+        // 瀹為檯鍒锋€�
         spawners[type].Shuffle();
         for (int i = 0; i < count; i++) {
             if (i >= spawners[type].Count) i = 0;
@@ -60,9 +60,9 @@ public class StoryM : MonoBehaviour {
         }
     }
 
-    // 流程控制
+    // 娴佺▼鎺у埗
     IEnumerator WaitUntilClear(int remain = 0) {
-        while (FindObjectsOfType<EnemyBase>().Length - FindObjectsOfType<EnemyArrow>().Length > remain) { // 要算上自己
+        while (FindObjectsOfType<EnemyBase>().Length - FindObjectsOfType<EnemyArrow>().Length > remain) { // 瑕佺畻涓婅嚜宸�
             yield return new WaitForSeconds(0.1f);
         }
     }
@@ -72,7 +72,7 @@ public class StoryM : MonoBehaviour {
         }
     }
 
-    // 故事
+    // 鏁呬簨
     public int stage = 0;
     void Start() {
         StartCoroutine(test());
@@ -83,23 +83,23 @@ public class StoryM : MonoBehaviour {
         while (true) {
             canSpawnArrow = true;
             Spawn(Spawner.EnemyType.Mover, 3);
-            SetStoryText("先刷几个瞎晃悠的", "");
+            SetStoryText("鍏堝埛鍑犱釜鐬庢檭鎮犵殑", "");
             yield return new WaitForSeconds(3f);
 
             Spawn(Spawner.EnemyType.Shooter);
-            SetStoryText("炮塔!", "");
+            SetStoryText("鐐��锛�", "");
             yield return new WaitForSeconds(2f);
 
             Spawn(Spawner.EnemyType.Heavy, 2);
-            SetStoryText("最后是两个贼硬的……", "");
+            SetStoryText("鏈€鍚庢槸涓や釜璐肩‖鐨勨€︹€�", "");
             yield return StartCoroutine(WaitUntilClear(2));
 
             canSpawnArrow = false;
             InputM.DropDice(Modules.RandomOne(InputM.keyTypes.ToList()));
-            SetStoryText("来一个骰子吧……?", "");
+            SetStoryText("鏉ヤ竴涓��瀛愬惂鈥︹€︼紵", "");
             yield return StartCoroutine(WaitUntilPickDice());
 
-            yield return StartCoroutine(WaitForStoryText("准备好,下一轮要来了!", ""));
+            yield return StartCoroutine(WaitForStoryText("鍑嗗�濂斤紝涓嬩竴杞��鏉ヤ簡锛�", ""));
         }
     }
     IEnumerator spawnArrow() {
@@ -109,4 +109,4 @@ public class StoryM : MonoBehaviour {
         }
     }
 
-}
+}

+ 1 - 2
Assets/Resources/UI/LocalesProvider.cs

@@ -1,8 +1,7 @@
 using System.Collections.Generic;
 using UnityEngine.Localization.Settings;
 
-public class LocalesProvider : ILocalesProvider
-{
+public class LocalesProvider : ILocalesProvider{
     public List<UnityEngine.Localization.Locale> Locales { get; } = new List<UnityEngine.Localization.Locale>();
 
     public UnityEngine.Localization.Locale GetLocale(UnityEngine.Localization.LocaleIdentifier id) => Locales.Find(l => l.Identifier == id);