Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Added CursedDoor.cs, not everything, but the base is ready #4

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CursedMod/CursedMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<Compile Include="Features\Wrappers\CursedPrefabManager.cs" />
<Compile Include="Features\Wrappers\Facility\CursedFacility.cs" />
<Compile Include="Features\Wrappers\Facility\CursedWarhead.cs" />
<Compile Include="Features\Wrappers\Facility\CursedDoor.cs" />
<Compile Include="Features\Wrappers\Facility\Props\CursedBreakableWindow.cs" />
<Compile Include="Features\Wrappers\Facility\Rooms\CursedLightningController.cs" />
<Compile Include="Features\Wrappers\Player\CursedPlayer.cs" />
Expand Down
49 changes: 49 additions & 0 deletions CursedMod/Features/Wrappers/Facility/CursedDoor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Interactables.Interobjects.DoorUtils;
using UnityEngine;

namespace CursedMod.Features.Wrappers.Facility.Props;

public class CursedDoor
{
public DoorVariant Base { get; }

public GameObject GameObject => Base.gameObject;

public Transform Transform => Base.transform;

public int DoorId => Base.DoorId;

public Vector3 Position
{
get => Base.transform.position;
set => Base.transform.position = value;
}

public Quaternion Rotation
{
get => Base.transform.rotation;
set => Base.transform.rotation = value;
}

public Vector3 Scale
{
get => Base.transform.localScale;
set => Base.transform.localScale = value;
}

public DoorPermissions RequiredPermissions
{
get => Base.RequiredPermissions;
set => Base.RequiredPermissions = value;
}

public bool IsOpen
{
get => !Base._prevState;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base.TargetState, but dont worry, will pr it by myself

set => Base.NetworkTargetState = value;
}

public void TriggerState() => Base.NetworkTargetState = !Base.TargetState;

public void ServerChangeLock(DoorLockReason reason, bool newState) => Base.ServerChangeLock(reason, newState);
}