-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add atmosblocker and some refactoring
- Loading branch information
Showing
9 changed files
with
108 additions
and
93 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
11 changes: 11 additions & 0 deletions
11
Assets/Scripts/SS3D/Systems/Atmospherics/AtmosRework/AtmosBlocker.cs
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,11 @@ | ||
using SS3D.Core; | ||
using SS3D.Core.Behaviours; | ||
using SS3D.Engine.AtmosphericsRework; | ||
|
||
public class AtmosBlocker : NetworkActor | ||
{ | ||
public override void OnStartServer(){ | ||
base.OnStartServer(); | ||
Subsystems.Get<AtmosManager>().ChangeState(Position, AtmosState.Blocked); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...spherics/Machinery/InjectorObject.cs.meta → ...spherics/AtmosRework/AtmosBlocker.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
38 changes: 38 additions & 0 deletions
38
Assets/Scripts/SS3D/Systems/Atmospherics/AtmosRework/TrinaryAtmosDevice.cs
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,38 @@ | ||
using SS3D.Core; | ||
using SS3D.Interactions; | ||
using SS3D.Interactions.Interfaces; | ||
using SS3D.Systems.Atmospherics.AtmosRework.Machinery; | ||
using SS3D.Systems.Tile; | ||
using UnityEngine; | ||
|
||
public abstract class TrinaryAtmosDevice : BasicAtmosDevice, IInteractionTarget | ||
{ | ||
protected Vector3 FrontPipePosition; | ||
protected Vector3 BackPipePosition; | ||
protected Vector3 SidePipePosition; | ||
|
||
protected IAtmosPipe FrontPipe; | ||
protected IAtmosPipe BackPipe; | ||
protected IAtmosPipe SidePipe; | ||
|
||
|
||
protected TileLayer Pipelayer = TileLayer.PipeLeft; | ||
|
||
[SerializeField] | ||
private bool _sideOnRight; | ||
|
||
protected bool AllPipesConnected => FrontPipe != null && BackPipe != null && SidePipe != null; | ||
|
||
public override void StepAtmos(float dt) | ||
{ | ||
FrontPipePosition = transform.position + transform.forward; | ||
BackPipePosition = transform.position - transform.forward; | ||
SidePipePosition = _sideOnRight ? transform.position + transform.right : transform.position - transform.right; | ||
|
||
Subsystems.Get<PipeSystem>().TryGetAtmosPipe(FrontPipePosition, Pipelayer, out FrontPipe); | ||
Subsystems.Get<PipeSystem>().TryGetAtmosPipe(BackPipePosition, Pipelayer, out BackPipe); | ||
Subsystems.Get<PipeSystem>().TryGetAtmosPipe(SidePipePosition, Pipelayer, out SidePipe); | ||
} | ||
|
||
public abstract IInteraction[] CreateTargetInteractions(InteractionEvent interactionEvent); | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Scripts/SS3D/Systems/Atmospherics/AtmosRework/TrinaryAtmosDevice.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
Assets/Scripts/SS3D/Systems/Atmospherics/Machinery/InjectorObject.cs
This file was deleted.
Oops, something went wrong.