We got enemy spawning!!!

This commit is contained in:
BOTAlex 2024-02-29 20:21:36 +01:00
parent d8f8cdc37a
commit 49580e68f1
2 changed files with 54 additions and 4 deletions

View File

@ -13,7 +13,9 @@ GameObject:
- component: {fileID: 5063378671874793948}
- component: {fileID: -2259174063119120971}
- component: {fileID: -9003688753200063495}
- component: {fileID: 7159876145595507269}
- component: {fileID: -3563373198581541198}
- component: {fileID: 5669020798899338457}
- component: {fileID: 7025838755278696983}
m_Layer: 0
m_Name: EnemyBase
m_TagString: Enemy
@ -107,13 +109,14 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7065654593080984807}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c66441ada081b6c4c841000e83cc2b7a, type: 3}
m_Name:
m_EditorClassIdentifier:
flipTrans: {fileID: 0}
body: {fileID: 0}
--- !u!114 &-3563373198581541198
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -125,7 +128,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier:
GlobalObjectIdHash: 0
GlobalObjectIdHash: 1810720538
InScenePlacedSourceGlobalObjectIdHash: 0
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
@ -134,3 +137,50 @@ MonoBehaviour:
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
--- !u!114 &5669020798899338457
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7065654593080984807}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3}
m_Name:
m_EditorClassIdentifier:
UseUnreliableDeltas: 0
SyncPositionX: 1
SyncPositionY: 1
SyncPositionZ: 0
SyncRotAngleX: 0
SyncRotAngleY: 0
SyncRotAngleZ: 0
SyncScaleX: 0
SyncScaleY: 0
SyncScaleZ: 0
PositionThreshold: 0.001
RotAngleThreshold: 0.01
ScaleThreshold: 0.01
UseQuaternionSynchronization: 0
UseQuaternionCompression: 0
UseHalfFloatPrecision: 0
InLocalSpace: 0
Interpolate: 1
SlerpPosition: 0
--- !u!114 &7025838755278696983
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7065654593080984807}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2d19183357399174e9b76aff8bde44d3, type: 3}
m_Name:
m_EditorClassIdentifier:
KeepEnabledIf: 0
objectsToDisable:
- {fileID: -2259174063119120971}
- {fileID: 5063378671874793948}

View File

@ -156,7 +156,7 @@ public class EnemySpawner : NetworkBehaviour
float x = position.x + radius * Mathf.Cos(radians);
float y = position.y + radius * Mathf.Sin(radians);
point = new Vector3(x, y, position.z);
point = new Vector3(x, y, 0);
} while (IsPointOnNavMesh(point));
return point;