龙腾猫跃 4 년 전
부모
커밋
ef47e27a2a

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 41 - 0
Assets/Plugins/TextMesh Pro/Resources/Fonts & Materials/SOURCEHANSANSCN-NORMAL SDF.asset


+ 14 - 2
Assets/Resources/Entities/EnemyBase.cs

@@ -5,9 +5,21 @@ using DG.Tweening;
 
 public abstract class EnemyBase : EntityBase {
 
+    internal override void OnUpdate() {
+        rb.mass = baseMass * (towardsRight ? 1.2f : 0.8f);
+        // 反向
+        if (towardsRight != (Mathf.Abs(rb.velocity.x) > filpSpeed ? rb.velocity.x > 0 : towardsRight)) {
+            towardsRight = !towardsRight;
+            transform.DOScaleX(towardsRight ? 1 : -1, 0.15f);
+        }
+    }
+
     public bool movingLeft = false;
     internal override void OnHitBorder() {
-        transform.localScale = Vector3.zero; Destroy(gameObject, 1);
+        // 死亡
+        transform.position = new Vector3(1000, 1000);
+        gameObject.SetActive(false);
+        Destroy(gameObject, 1);
     }
 
     public int hp; internal int currentHp = -1;
@@ -19,7 +31,7 @@ public abstract class EnemyBase : EntityBase {
         currentHp--;
         if (currentHp <= 0) {
             AudioM.Play("enemy_die", 0.5f);
-            transform.localScale = Vector3.zero; Destroy(gameObject, 1); // 防止动画没播放完导致报错
+            OnHitBorder();
         }
     }
 

+ 4 - 2
Assets/Resources/Entities/EnemyHeavy.cs

@@ -10,14 +10,16 @@ public class EnemyHeavy : EnemyBase {
     internal override bool isPressingRight() => !movingLeft;
     private float turnCooldown = 0f;
     internal override void OnUpdate() {
+        base.OnUpdate();
+        if (!isLand) return;
         bool shouldTurn =
             (movingLeft && Physics2D.Linecast(transform.position, transform.position + Vector3.left * 0.5f, LayerMask.GetMask("Marker"))) ||
             (!movingLeft && Physics2D.Linecast(transform.position, transform.position + Vector3.right * 0.5f, LayerMask.GetMask("Marker")));
-        if (Mathf.Abs(rb.velocity.x) > 0.0001f && (rb.velocity.x > 0 == movingLeft)) shouldTurn = true;
+        if (Mathf.Abs(rb.velocity.x) > filpSpeed && (rb.velocity.x > 0 == movingLeft)) shouldTurn = true;
         turnCooldown -= Time.deltaTime;
         if (shouldTurn && turnCooldown <= 0f) {
             movingLeft = !movingLeft;
-            turnCooldown = 1f;
+            turnCooldown = 0.6f;
         }
     }
 

+ 4 - 2
Assets/Resources/Entities/EnemyMover.cs

@@ -11,14 +11,16 @@ public class EnemyMover : EnemyBase {
 
     private float turnCooldown = 0f;
     internal override void OnUpdate() {
+        base.OnUpdate();
+        if (!isLand) return;
         bool shouldTurn =
             (movingLeft && Physics2D.Linecast(transform.position, transform.position + new Vector3(-0.7f, 0.5f, 0f), LayerMask.GetMask("Marker"))) ||
             (!movingLeft && Physics2D.Linecast(transform.position, transform.position + new Vector3(0.7f, 0.5f, 0f), LayerMask.GetMask("Marker")));
-        if (Mathf.Abs(rb.velocity.x) > 0.0001f && (rb.velocity.x > 0 == movingLeft)) shouldTurn = true;
+        if (Mathf.Abs(rb.velocity.x) > filpSpeed && (rb.velocity.x > 0 == movingLeft)) shouldTurn = true;
         turnCooldown -= Time.deltaTime;
         if (shouldTurn && turnCooldown <= 0f) {
             movingLeft = !movingLeft;
-            turnCooldown = 1f;
+            turnCooldown = 0.6f;
         }
     }
 

+ 1 - 0
Assets/Resources/Entities/EnemyShooter.cs

@@ -13,6 +13,7 @@ public class EnemyShooter : EnemyBase {
     public float shootDelay = 5f, bulletSpeed = 1f; private float shootCooldown = 0f;
     public GameObject bullet;
     internal override void OnUpdate() {
+        base.OnUpdate();
         if (!isLand) return;
         shootCooldown += Time.deltaTime;
         if (shootCooldown < shootDelay) return;

+ 0 - 6
Assets/Resources/Entities/EntityBase.cs

@@ -65,12 +65,6 @@ public abstract class EntityBase : MonoBehaviour {
         }
         // ÉèÖÃ
         rb.velocity = new Vector2(speedX, speedY);
-        rb.mass = baseMass * (towardsRight ? 1.2f : 0.8f);
-        if (towardsRight != (Mathf.Abs(speedX) > filpSpeed ? speedX > 0 : towardsRight)) {
-            // ·´Ïò
-            towardsRight = !towardsRight;
-            transform.DOScaleX(towardsRight ? 1 : -1, 0.1f);
-        }
     }
     internal abstract bool isPressingLeft();
     internal abstract bool isPressingRight();

+ 5 - 0
Assets/Resources/Entities/Player.cs

@@ -71,6 +71,11 @@ public class Player : EntityBase {
     public float bulletSpeed = 50f, bulletKnockback = 1f;
     public GameObject bullet; public TMPro.TextMeshProUGUI textBullet;
     internal override void OnUpdate() {
+        // 反向
+        if ((towardsRight && isPressingLeft()) || (!towardsRight && isPressingRight())) {
+            towardsRight = !towardsRight;
+            transform.DOScaleX(towardsRight ? 1 : -1, 0.15f);
+        }
         // 无敌
         if (resistanceTime > 0f) resistanceTime -= Time.deltaTime;
         // 治疗

+ 70 - 326
Assets/Scenes/SceneMain.unity

@@ -1877,26 +1877,26 @@ CompositeCollider2D:
         Y: -30000100
       - X: -29999959
         Y: -30000100
-    - - X: 120000100
-        Y: -100000041
+    - - X: 99999900
+        Y: -69999959
+      - X: 99999959
+        Y: -69999900
+      - X: 120000041
+        Y: -69999900
+      - X: 120000100
+        Y: -69999959
       - X: 120000100
         Y: -70000100
       - X: 139999900
         Y: -70000100
       - X: 139999900
-        Y: -100000041
+        Y: -69999959
       - X: 139999959
-        Y: -100000100
-      - X: 150000041
-        Y: -100000100
-      - X: 150000100
-        Y: -100000041
-      - X: 150000100
-        Y: -80000100
+        Y: -69999900
       - X: 160000041
-        Y: -80000100
+        Y: -69999900
       - X: 160000100
-        Y: -80000041
+        Y: -69999959
       - X: 160000100
         Y: -70000100
       - X: 170000041
@@ -1917,57 +1917,81 @@ CompositeCollider2D:
         Y: -70000100
       - X: 99999900
         Y: -70000100
-      - X: 99999900
-        Y: -80000041
-      - X: 99999959
-        Y: -80000100
-      - X: 109999900
-        Y: -80000100
-      - X: 109999900
-        Y: -100000041
-      - X: 109999959
-        Y: -100000100
-      - X: 120000041
-        Y: -100000100
     - - X: -129999900
         Y: -100000041
       - X: -129999900
         Y: -90000100
-      - X: -109999959
+      - X: -130000041
         Y: -90000100
-      - X: -109999900
+      - X: -130000100
         Y: -90000041
-      - X: -109999900
-        Y: -80000100
+      - X: -130000100
+        Y: -79999959
+      - X: -130000041
+        Y: -79999900
+      - X: -129999900
+        Y: -79999900
+      - X: -129999900
+        Y: -70000100
+      - X: -110000100
+        Y: -70000100
+      - X: -110000100
+        Y: -69999959
+      - X: -110000041
+        Y: -69999900
       - X: -99999959
-        Y: -80000100
+        Y: -69999900
       - X: -99999900
-        Y: -80000041
+        Y: -69999959
       - X: -99999900
         Y: -70000100
       - X: -70000100
         Y: -70000100
       - X: -70000100
-        Y: -90000041
+        Y: -69999959
       - X: -70000041
-        Y: -90000100
+        Y: -69999900
+      - X: -59999959
+        Y: -69999900
+      - X: -59999900
+        Y: -69999959
+      - X: -59999900
+        Y: -70000100
+      - X: -20000100
+        Y: -70000100
+      - X: -20000100
+        Y: -69999959
+      - X: -20000041
+        Y: -69999900
       - X: -9999959
-        Y: -90000100
+        Y: -69999900
       - X: -9999900
-        Y: -90000041
+        Y: -69999959
       - X: -9999900
         Y: -70000100
       - X: 9999900
         Y: -70000100
       - X: 9999900
-        Y: -80000041
+        Y: -69999959
       - X: 9999959
-        Y: -80000100
-      - X: 19999900
-        Y: -80000100
-      - X: 19999900
+        Y: -69999900
+      - X: 20000041
+        Y: -69999900
+      - X: 20000100
+        Y: -69999959
+      - X: 20000100
+        Y: -70000100
+      - X: 39999900
+        Y: -70000100
+      - X: 39999900
+        Y: -79999900
+      - X: 40000041
+        Y: -79999900
+      - X: 40000100
+        Y: -79999959
+      - X: 40000100
         Y: -90000041
-      - X: 19999959
+      - X: 40000041
         Y: -90000100
       - X: 39999900
         Y: -90000100
@@ -2005,30 +2029,6 @@ CompositeCollider2D:
         Y: -100000100
       - X: -129999959
         Y: -100000100
-    - - X: 20000100
-        Y: -79999900
-      - X: 20000100
-        Y: -70000100
-      - X: 39999900
-        Y: -70000100
-      - X: 39999900
-        Y: -79999900
-    - - X: -59999900
-        Y: -79999900
-      - X: -59999900
-        Y: -70000100
-      - X: -20000100
-        Y: -70000100
-      - X: -20000100
-        Y: -79999900
-    - - X: -129999900
-        Y: -79999900
-      - X: -129999900
-        Y: -70000100
-      - X: -110000100
-        Y: -70000100
-      - X: -110000100
-        Y: -79999900
   m_CompositePaths:
     m_Paths:
     - - {x: -8.000026, y: 0.99999}
@@ -2052,28 +2052,8 @@ CompositeCollider2D:
       - {x: 1.99999, y: -2.0000253}
       - {x: 2.0000253, y: -3.00001}
     - - {x: -13.000026, y: -10.00001}
-      - {x: -12.999961, y: -9.00001}
-      - {x: -10.99999, y: -8.999974}
-      - {x: -11.000019, y: -7.9999905}
-      - {x: -12.99999, y: -7.999961}
       - {x: -12.999961, y: -7.0000095}
-      - {x: -11.00001, y: -7.000039}
-      - {x: -10.999981, y: -8.00001}
-      - {x: -9.99999, y: -7.9999747}
-      - {x: -9.999961, y: -7.0000095}
-      - {x: -7.0000095, y: -7.000039}
-      - {x: -6.9999743, y: -9.00001}
-      - {x: -0.99999, y: -8.999974}
-      - {x: -0.9999606, y: -7.0000095}
-      - {x: 0.99999, y: -7.000039}
-      - {x: 1.0000252, y: -8.00001}
-      - {x: 2.00001, y: -7.999981}
-      - {x: 2.0000393, y: -7.0000095}
       - {x: 3.99999, y: -7.000039}
-      - {x: 3.999961, y: -7.9999905}
-      - {x: 1.99999, y: -8.000019}
-      - {x: 2.0000253, y: -9.00001}
-      - {x: 3.99999, y: -9.000039}
       - {x: 4.0000253, y: -10.00001}
       - {x: 5.00001, y: -9.999974}
       - {x: 5.000039, y: -7.0000095}
@@ -2083,26 +2063,10 @@ CompositeCollider2D:
       - {x: -15.999974, y: -7.0000095}
       - {x: -14.00001, y: -7.000039}
       - {x: -13.999974, y: -10.00001}
-    - - {x: 11.999974, y: -10.00001}
-      - {x: 12.000039, y: -7.0000095}
-      - {x: 13.99999, y: -7.000039}
-      - {x: 14.000026, y: -10.00001}
-      - {x: 15.00001, y: -9.999974}
-      - {x: 15.00004, y: -8.00001}
-      - {x: 16.00001, y: -7.9999747}
-      - {x: 16.00004, y: -7.0000095}
-      - {x: 17.00001, y: -6.9999743}
+    - - {x: 16.99998, y: -7.0000043}
       - {x: 16.999975, y: -5.99999}
       - {x: 8.99999, y: -6.0000253}
-      - {x: 9.000026, y: -7.0000095}
-      - {x: 9.99999, y: -7.000039}
-      - {x: 10.000026, y: -8.00001}
-      - {x: 10.99999, y: -8.000039}
-      - {x: 11.000026, y: -10.00001}
-    - - {x: -2.00001, y: -7.999961}
-      - {x: -5.99999, y: -7.999961}
-      - {x: -5.999961, y: -7.0000095}
-      - {x: -2.00001, y: -7.000039}
+      - {x: 9.000019, y: -7.0000043}
   m_VertexDistance: 0.0005
   m_OffsetDistance: 0.00005
 --- !u!19719996 &558216836
@@ -2220,26 +2184,6 @@ Tilemap:
       m_TileObjectToInstantiateIndex: 65535
       dummyAlignment: 0
       m_AllTileFlags: 2147483649
-  - first: {x: 11, y: -10, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 14, y: -10, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
   - first: {x: -14, y: -9, z: 0}
     second:
       serializedVersion: 2
@@ -2250,106 +2194,6 @@ Tilemap:
       m_TileObjectToInstantiateIndex: 65535
       dummyAlignment: 0
       m_AllTileFlags: 2147483649
-  - first: {x: -13, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -12, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -7, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -6, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -5, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -4, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -3, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -2, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 2, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 3, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
   - first: {x: 4, y: -9, z: 0}
     second:
       serializedVersion: 2
@@ -2360,26 +2204,6 @@ Tilemap:
       m_TileObjectToInstantiateIndex: 65535
       dummyAlignment: 0
       m_AllTileFlags: 2147483649
-  - first: {x: 11, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 14, y: -9, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
   - first: {x: -14, y: -8, z: 0}
     second:
       serializedVersion: 2
@@ -2390,46 +2214,6 @@ Tilemap:
       m_TileObjectToInstantiateIndex: 65535
       dummyAlignment: 0
       m_AllTileFlags: 2147483649
-  - first: {x: -11, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -7, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: -2, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 1, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
   - first: {x: 4, y: -8, z: 0}
     second:
       serializedVersion: 2
@@ -2440,46 +2224,6 @@ Tilemap:
       m_TileObjectToInstantiateIndex: 65535
       dummyAlignment: 0
       m_AllTileFlags: 2147483649
-  - first: {x: 10, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 11, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 14, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
-  - first: {x: 15, y: -8, z: 0}
-    second:
-      serializedVersion: 2
-      m_TileIndex: 5
-      m_TileSpriteIndex: 4294967295
-      m_TileMatrixIndex: 0
-      m_TileColorIndex: 0
-      m_TileObjectToInstantiateIndex: 65535
-      dummyAlignment: 0
-      m_AllTileFlags: 2147483649
   - first: {x: -16, y: -7, z: 0}
     second:
       serializedVersion: 2
@@ -3152,11 +2896,11 @@ Tilemap:
     m_Data: {fileID: 0}
   - m_RefCount: 0
     m_Data: {fileID: 0}
-  - m_RefCount: 94
+  - m_RefCount: 72
     m_Data: {fileID: 11400000, guid: 8415aca5ed2fabd418fa41366a33fd69, type: 2}
   m_TileSpriteArray: []
   m_TileMatrixArray:
-  - m_RefCount: 94
+  - m_RefCount: 72
     m_Data:
       e00: 1
       e01: 0
@@ -3175,7 +2919,7 @@ Tilemap:
       e32: 0
       e33: 1
   m_TileColorArray:
-  - m_RefCount: 94
+  - m_RefCount: 72
     m_Data: {r: 1, g: 1, b: 1, a: 1}
   m_TileObjectToInstantiateArray: []
   m_AnimationFrameRate: 1
@@ -10796,7 +10540,7 @@ AudioSource:
   m_PlayOnAwake: 1
   m_Volume: 0.2
   m_Pitch: 1
-  Loop: 0
+  Loop: 1
   Mute: 0
   Spatialize: 0
   SpatializePostEffects: 0

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.