Skip to content

Commit

Permalink
extra changes related to #40
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexejhero committed Nov 2, 2023
1 parent 3c8dd84 commit 94247b7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 36 deletions.
1 change: 0 additions & 1 deletion SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Linq;
using Nautilus.Utility;
using SCHIZO.Creatures.Components;
using SCHIZO.Helpers;
using UnityEngine;
Expand Down
34 changes: 34 additions & 0 deletions SCHIZO/Helpers/CreatureActionHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using UnityEngine;

namespace SCHIZO.Helpers;

public static class CreatureActionHelpers
{
#if SUBNAUTICA
public static float Evaluate(this CreatureAction action, float time)
=> action.Evaluate(action.creature, time);
public static void StartPerform(this CreatureAction action, float time)
=> action.StartPerform(action.creature, time);
public static void Perform(this CreatureAction action, float time, float deltaTime)
=> action.Perform(action.creature, time, deltaTime);
public static void StopPerform(this CreatureAction action, float time)
=> action.StopPerform(action.creature, time);
#endif

public static float Evaluate(this CreatureAction action)
=> action.Evaluate(Time.time);
public static void StartPerform(this CreatureAction action)
=> action.StartPerform(Time.time);
public static void Perform(this CreatureAction action)
=> action.Perform(Time.time, Time.deltaTime);
public static void StopPerform(this CreatureAction action)
=> action.StopPerform(Time.time);

#if BELOWZERO
public static FMOD_CustomEmitter GetBiteSound(this MeleeAttack attack)
=> attack.biteSound;
#else
public static FMOD_StudioEventEmitter GetBiteSound(this MeleeAttack attack)
=> attack.attackSound;
#endif
}
33 changes: 0 additions & 33 deletions SCHIZO/Helpers/RetargetHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Runtime.CompilerServices;
using UnityEngine;

namespace SCHIZO.Helpers;

Expand All @@ -20,36 +19,4 @@ public static
return belowZero;
#endif
}
#if BELOWZERO
public static float Evaluate(this CreatureAction action, Creature creature, float time)
=> action.Evaluate(time);
public static void StartPerform(this CreatureAction action, Creature creature, float time)
=> action.StartPerform(time);
public static void Perform(this CreatureAction action, Creature creature, float time, float deltaTime)
=> action.Perform(time, deltaTime);
public static void StopPerform(this CreatureAction action, Creature creature, float time)
=> action.StopPerform(time);
public static FMOD_CustomEmitter GetBiteSound(this MeleeAttack attack)
=> attack.biteSound;
#else
public static float Evaluate(this CreatureAction action, float time)
=> action.Evaluate(action.creature, time);
public static void StartPerform(this CreatureAction action, float time)
=> action.StartPerform(action.creature, time);
public static void Perform(this CreatureAction action, float time, float deltaTime)
=> action.Perform(action.creature, time, deltaTime);
public static void StopPerform(this CreatureAction action, float time)
=> action.StopPerform(action.creature, time);
public static FMOD_StudioEventEmitter GetBiteSound(this MeleeAttack attack)
=> attack.attackSound;
#endif
public static float Evaluate(this CreatureAction action)
=> action.Evaluate(Time.time);
public static void StartPerform(this CreatureAction action)
=> action.StartPerform(action.creature, Time.time);
public static void Perform(this CreatureAction action)
=> action.Perform(action.creature, Time.time, Time.deltaTime);
public static void StopPerform(this CreatureAction action)
=> action.StopPerform(action.creature, Time.time);

}
1 change: 0 additions & 1 deletion SCHIZO/Sounds/Collections/SoundCollectionInstance.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Nautilus.Utility;

namespace SCHIZO.Sounds.Collections;

Expand Down
1 change: 0 additions & 1 deletion SCHIZO/Sounds/FMODSoundCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using FMOD;
using FMOD.Studio;
using FMODUnity;
using Nautilus.FMod.Interfaces;
using Nautilus.Handlers;
using Nautilus.Utility;
using SCHIZO.DataStructures;
Expand Down

0 comments on commit 94247b7

Please sign in to comment.