Przeglądaj źródła

排排站,乖乖等

SZAND\msx_2 1 rok temu
rodzic
commit
ad3f008c7c

+ 226 - 4
ActionTowerDefense/Assets/Scenes/SampleScene.unity

@@ -903,6 +903,37 @@ Transform:
   m_Father: {fileID: 1055802830}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: -7.831, y: 0, z: 0}
+--- !u!1 &546706452
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 546706453}
+  m_Layer: 0
+  m_Name: Pos5
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &546706453
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 546706452}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: -10.299998, y: -2.2999992, z: -4.84}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 1803098783}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &580427336
 GameObject:
   m_ObjectHideFlags: 0
@@ -16112,6 +16143,37 @@ ParticleSystem:
         m_PostInfinity: 2
         m_RotationOrder: 4
     vectorLabel1_3: W
+--- !u!1 &946427696
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 946427697}
+  m_Layer: 0
+  m_Name: Pos3
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &946427697
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 946427696}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: -8.359996, y: -2.2999992, z: -1.59}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 1803098783}
+  m_RootOrder: 3
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &970449923
 GameObject:
   m_ObjectHideFlags: 0
@@ -16792,6 +16854,37 @@ RectTransform:
   m_AnchoredPosition: {x: 5, y: 60}
   m_SizeDelta: {x: 200, y: 50}
   m_Pivot: {x: 0.5, y: 0.5}
+--- !u!1 &1316598307
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1316598308}
+  m_Layer: 0
+  m_Name: Pos2
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1316598308
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1316598307}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 6.210002, y: -2.2999992, z: 0}
+  m_LocalScale: {x: -1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 1803098783}
+  m_RootOrder: 4
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1001 &1361503157
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -17468,6 +17561,68 @@ Transform:
   m_Father: {fileID: 7175282025644772592}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1583294796
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1583294797}
+  m_Layer: 0
+  m_Name: Pos1
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1583294797
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1583294796}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: -6.329997, y: -2.2999992, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 1803098783}
+  m_RootOrder: 5
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1614988426
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1614988427}
+  m_Layer: 0
+  m_Name: Pos6
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1614988427
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1614988426}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 10.329997, y: -2.2999992, z: -5.19}
+  m_LocalScale: {x: -1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 1803098783}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1656440121
 GameObject:
   m_ObjectHideFlags: 0
@@ -17504,6 +17659,37 @@ Transform:
   m_CorrespondingSourceObject: {fileID: 7247696002149726, guid: 956ff4379e83d3c49a9c10310dbf7cc7, type: 3}
   m_PrefabInstance: {fileID: 7247696832750845}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &1682582306
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1682582307}
+  m_Layer: 0
+  m_Name: Pos4
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1682582307
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1682582306}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 8.349997, y: -2.2999992, z: -1.67}
+  m_LocalScale: {x: -1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 1803098783}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1714821084
 GameObject:
   m_ObjectHideFlags: 0
@@ -22546,6 +22732,43 @@ Transform:
   m_Father: {fileID: 1932370447}
   m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1803098782
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1803098783}
+  m_Layer: 0
+  m_Name: poses
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1803098783
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1803098782}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 1614988427}
+  - {fileID: 546706453}
+  - {fileID: 1682582307}
+  - {fileID: 946427697}
+  - {fileID: 1316598308}
+  - {fileID: 1583294797}
+  m_Father: {fileID: 7175282025644772592}
+  m_RootOrder: 4
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1861954882
 GameObject:
   m_ObjectHideFlags: 0
@@ -30120,6 +30343,7 @@ Transform:
   - {fileID: 4960807373307151507}
   - {fileID: 1507415184}
   - {fileID: 1740336465}
+  - {fileID: 1803098783}
   m_Father: {fileID: 0}
   m_RootOrder: 14
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -30203,10 +30427,8 @@ MonoBehaviour:
   - {fileID: 7102925310079278345, guid: 09b955d55353c724e81b2dc27dcecc28, type: 3}
   - {fileID: 8517101868754928651, guid: b9e89573dc6c2fa4fb25cddacde70043, type: 3}
   outSpirits: []
-  minForceX: 4
-  maxForceX: 16
-  minForceY: 0.1
-  maxForceY: 1.2
+  poses: {fileID: 1803098782}
+  maxPos: 6
 --- !u!1 &7724000536078886812
 GameObject:
   m_ObjectHideFlags: 0

+ 1 - 0
ActionTowerDefense/Assets/Scripts/Spirits/Base_Spirits/Base_Spirits.cs

@@ -111,6 +111,7 @@ public class Base_Spirits : MonoBehaviour
                             default:
                                 break;
                         }
+                        SpiritOutDoor.curPos--;
                     }
                 }
                 else

+ 9 - 9
ActionTowerDefense/Assets/Scripts/Spirits/Base_Spirits/SpiritOutDoor.cs

@@ -38,10 +38,9 @@ public class SpiritOutDoor : MonoBehaviour
     //public GameObject isLooking2;
     public List<GameObject> outSpirits;
 
-    [Header("µ¯³öÀ´µÄÁ¦")]
-    public float minForceX, maxForceX;
-    public float minForceY, maxForceY;
-    private int dir;
+    public GameObject poses;
+    public int maxPos = 6;
+    static public int curPos;
 
     private void RandomSpirit()
     {
@@ -52,11 +51,12 @@ public class SpiritOutDoor : MonoBehaviour
 
     private void OutSpirit(int id)
     {
-        GameObject g = Instantiate(spirits[id].spiritPrefab, transform.position, new Quaternion(0, 0, 0, 0), null);
+        GameObject g = Instantiate(spirits[id].spiritPrefab, poses.transform.GetChild(curPos++).transform.position, new Quaternion(0, 0, 0, 0), null);
+        if (curPos == maxPos)
+        {
+            doorController.canCount = false;
+        }
         outSpirits.Add(g);
-        dir = (int)(2 * (Random.Range(0, 2) - 0.5f));
-        Vector3 force = new Vector3(Random.Range(minForceX, maxForceX) * dir, Random.Range(minForceY, maxForceY), 0);
-        g.GetComponent<Rigidbody>().velocity = force;
         Base_Spirits bs = g.GetComponentInChildren<Base_Spirits>();
         bs.needCorpse = spirits[id].corpse;
         bs.type = (int)spirits[id].type;
@@ -72,7 +72,7 @@ public class SpiritOutDoor : MonoBehaviour
             {
                 doorController.LionDark(times);
                 RandomSpirit();
-                if (times == doorController.maxSpirits - 1)
+                if (times == doorController.maxSpirits - 1 && curPos < maxPos)
                 {
                     doorController.canCount = true;
                 }