소스 검색

修复平台和胖子的判定

LAPTOP-OM1V99U2\永远de小亡灵 1 년 전
부모
커밋
62cc2c958f
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      ActionTowerDefense/Assets/Scripts/Platform.cs
  2. 1 1
      ActionTowerDefense/ProjectSettings/DynamicsManager.asset

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Platform.cs

@@ -12,7 +12,7 @@ public class Platform : MonoBehaviour
     {
         
         Foot foot = other.GetComponent<Foot>();
-        if (foot != null && foot.gameObject.layer != 8)
+        if (foot != null && foot.transform.parent.gameObject.layer != 8)
         {
             if (Mathf.Abs(foot.transform.position.x - transform.position.x) > edgeDistance)
             {
@@ -25,7 +25,7 @@ public class Platform : MonoBehaviour
     private void OnTriggerExit(Collider other)
     {
         Foot foot = other.GetComponent<Foot>();
-        if(foot != null && foot.gameObject.layer != 8)
+        if(foot != null && foot.transform.parent.gameObject.layer != 8)
         {
 
             if(foot.trigGroundList.Exists(i =>i == gameObject))

+ 1 - 1
ActionTowerDefense/ProjectSettings/DynamicsManager.asset

@@ -18,7 +18,7 @@ PhysicsManager:
   m_ClothInterCollisionDistance: 0.1
   m_ClothInterCollisionStiffness: 0.2
   m_ContactsGeneration: 1
-  m_LayerCollisionMatrix: ffa7ffffffa7ffffffa7fffffff7ffffffa7ffffffa7ffff3f80ffff3fa0ffff3fa0ffff3fa0ffff3fa0ffff0090ffff08a8ffffbff7ffff08a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+  m_LayerCollisionMatrix: ffa7ffffffa7ffffffa7fffffff7ffffffa7ffffffa7ffff3f80ffff3f80ffff3f80ffff3fa0ffff3fa0ffff0090ffff08a8ffff3ff6ffff08a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
   m_AutoSimulation: 1
   m_AutoSyncTransforms: 0
   m_ReuseCollisionCallbacks: 1