-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added RagdollSpawnPointObject and fixed some stuff
- Loading branch information
1 parent
6538060
commit e982220
Showing
14 changed files
with
264 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace MapEditorReborn.API | ||
{ | ||
using Exiled.API.Features; | ||
using Mirror; | ||
using UnityEngine; | ||
|
||
public class RagdollObjectComponent : MonoBehaviour | ||
{ | ||
public string RagdollName = string.Empty; | ||
|
||
public RoleType RagdollRoleType = RoleType.ClassD; | ||
|
||
public Ragdoll AttachedRagdoll = null; | ||
|
||
private void Start() | ||
{ | ||
AttachedRagdoll = Map.SpawnRagdoll(RagdollRoleType, DamageTypes.None, RagdollName, gameObject.transform.position, gameObject.transform.rotation); | ||
} | ||
|
||
private void OnDestroy() | ||
{ | ||
if (AttachedRagdoll != null) | ||
NetworkServer.Destroy(AttachedRagdoll.gameObject); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
namespace MapEditorReborn.API | ||
{ | ||
using Exiled.API.Enums; | ||
using System; | ||
using UnityEngine; | ||
|
||
[Serializable] | ||
public class RagdollSpawnPointObject | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="RagdollSpawnPointObject"/> class. | ||
/// </summary> | ||
public RagdollSpawnPointObject() | ||
{ | ||
} | ||
|
||
public RagdollSpawnPointObject(string name, RoleType roleType, Vector3 position, Vector3 rotation, RoomType roomType) | ||
{ | ||
Name = name; | ||
RoleType = roleType; | ||
Position = position; | ||
Rotation = rotation; | ||
RoomType = roomType; | ||
} | ||
|
||
public string Name { get; private set; } = string.Empty; | ||
|
||
public RoleType RoleType { get; private set; } = RoleType.ClassD; | ||
|
||
public SerializableVector3 Position { get; private set; } = SerializableVector3.Zero; | ||
|
||
public SerializableVector3 Rotation { get; private set; } = SerializableVector3.Zero; | ||
|
||
public RoomType RoomType { get; private set; } = RoomType.Unknown; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.