From 83c8df59b73b10e529bba006ca13a14f45e2e385 Mon Sep 17 00:00:00 2001 From: Govorunb Date: Fri, 3 Nov 2023 03:02:46 +1100 Subject: [PATCH 1/2] maybe fix a couple things fix tutel not having a VM in SN fix? CarryCreature picking up VMs from player's hands add a timeout to GetCarried swapping parents make CarryCreature drop carried creature when taking damage --- SCHIZO/Creatures/Components/CarryCreature.cs | 58 +++++- SCHIZO/Creatures/Components/GetCarried.cs | 12 +- SCHIZO/Creatures/Components/IOnMeleeAttack.cs | 14 ++ SCHIZO/Creatures/Ermshark/Ermshark.cs | 11 +- SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs | 33 +-- SCHIZO/Helpers/RetargetHelpers.cs | 33 +++ .../Creatures/Components/CarryCreature.cs | 2 +- .../Creatures/Components/IOnMeleeAttack.cs | 6 + .../Components/IOnMeleeAttack.cs.meta | 11 + Unity/Assets/Tutel/Tutel.prefab | 189 +++++++++++++++--- 10 files changed, 308 insertions(+), 61 deletions(-) create mode 100644 SCHIZO/Creatures/Components/IOnMeleeAttack.cs create mode 100644 Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs create mode 100644 Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta diff --git a/SCHIZO/Creatures/Components/CarryCreature.cs b/SCHIZO/Creatures/Components/CarryCreature.cs index 4453ea13..3750d984 100644 --- a/SCHIZO/Creatures/Components/CarryCreature.cs +++ b/SCHIZO/Creatures/Components/CarryCreature.cs @@ -1,9 +1,10 @@ +using System.Collections; using UnityEngine; namespace SCHIZO.Creatures.Components; /// Adapted from -partial class CarryCreature +partial class CarryCreature : IOnTakeDamage { private GetCarried target; private bool targetPickedUp; @@ -13,6 +14,41 @@ partial class CarryCreature public EcoTargetType EcoTargetType => (EcoTargetType) _ecoTargetType; + void IOnTakeDamage.OnTakeDamage(DamageInfo damageInfo) + { + if (damageInfo.damage > 0) Drop(); + } + + bool IOnMeleeAttack.HandleMeleeAttack(GameObject target) + { + // prevent bite after releasing + if (target.GetComponent()) return true; + + // pick up held creature instead of eating it + Player player = target.GetComponent(); + if (!player) return false; + + GameObject heldObject = Inventory.main.GetHeldObject(); + if (!heldObject) return false; + + GetCarried heldCarryable = heldObject.GetComponent(); + if (!heldCarryable) return false; + + if (EcoTargetType != heldObject.GetComponent()?.GetTargetType()) return false; + + Inventory.main.DropHeldItem(false); + heldObject.SetActive(true); // really makes you think + StartCoroutine(DelayedPickupHack()); + creature.SetFriend(player.gameObject, 120f); + return true; + + IEnumerator DelayedPickupHack() // not sure how or why but WM sometimes doesn't get scaled correctly unless we wait a frame + { + yield return null; + TryPickup(heldCarryable); + } + } + public override float Evaluate(float time) { if (timeNextFindTarget < time) @@ -38,6 +74,7 @@ public bool TryPickup(GetCarried getCarried) private bool TryPickupTarget() { if (!target || !target.gameObject || !target.gameObject.activeInHierarchy) return false; + if (!target.CanBePickedUp()) return false; if (target.GetComponentInParent()) { @@ -56,11 +93,21 @@ private bool TryPickupTarget() targetPickedUp = true; RepositionTarget(target); + StartCoroutine(DelayedReposition()); // some component just really likes running updates for a few frames after it gets disabled swimBehaviour.SwimTo(transform.position + Vector3.up + 5f * Random.onUnitSphere, Vector3.up, swimVelocity); timeNextUpdate = Time.time + 1f; return true; + + IEnumerator DelayedReposition() + { + for (int i = 0; i < 5; i++) + { + yield return new WaitForSeconds(0.05f); + RepositionTarget(target); + } + } } private void RepositionTarget(GetCarried getCarried) @@ -72,7 +119,7 @@ private void RepositionTarget(GetCarried getCarried) Vector3 offset = getCarried.pickupPoint ? -getCarried.pickupPoint.localPosition : Vector3.zero; - offset.Scale(attachPoint.lossyScale); + offset.Scale(new Vector3(1f / targetTransform.localScale.x, 1f / targetTransform.localScale.y, 1f / targetTransform.localScale.z)); targetTransform.localPosition = offset; } @@ -90,7 +137,10 @@ private void Drop() private void DropTarget(GameObject targetObject) { targetObject.transform.SetParent(null, true); - UWE.Utils.SetCollidersEnabled(targetObject, true); + GameObject colliderTarget = targetObject; + FPModel fpModel = targetObject.GetComponent(); + if (fpModel) colliderTarget = fpModel.propModel; + UWE.Utils.SetCollidersEnabled(colliderTarget, true); UWE.Utils.SetIsKinematic(targetObject.GetComponent(), false); if (targetObject.GetComponent() is { } lwe) LargeWorldStreamer.main!?.cellManager.RegisterEntity(lwe); @@ -158,7 +208,7 @@ public override void Perform(float time, float deltaTime) float roll = Random.value; if (roll < ADHD) { - LOGGER.LogWarning($"dropping because {roll}<{ADHD}"); + //LOGGER.LogWarning($"dropping because {roll}<{ADHD}"); Drop(); } } diff --git a/SCHIZO/Creatures/Components/GetCarried.cs b/SCHIZO/Creatures/Components/GetCarried.cs index 5a3746b8..6087cca9 100644 --- a/SCHIZO/Creatures/Components/GetCarried.cs +++ b/SCHIZO/Creatures/Components/GetCarried.cs @@ -11,7 +11,8 @@ partial class GetCarried { public bool isCarried; - private float nextCarryNoiseTime; + private float _nextCarryNoiseTime; + private float _lastPickedUpTime; private List<(MonoBehaviour component, bool wasEnabled)> _disabledComponents; private static readonly List toDisable = new() { @@ -34,6 +35,8 @@ public override void Awake() } public override float Evaluate(float time) => isCarried ? 99f : -99f; // manual start/end + public bool CanBePickedUp() => Time.time - _lastPickedUpTime > 5f; + private void DisableComponents() { _disabledComponents.Clear(); @@ -60,6 +63,7 @@ public void OnPickedUp() { pickupSounds!?.Play(emitter); isCarried = true; + _lastPickedUpTime = Time.time; StartPerform(Time.time); } @@ -73,7 +77,7 @@ public void OnDropped() public override void StartPerform(float time) { DisableComponents(); - nextCarryNoiseTime = time + carryNoiseInterval * (1 + Random.value); + _nextCarryNoiseTime = time + carryNoiseInterval * (1 + Random.value); if (!isCarried) OnPickedUp(); } @@ -95,9 +99,9 @@ public override void Perform(float time, float deltaTime) creature.Tired.Add(deltaTime / 2f); } - if (time > nextCarryNoiseTime) + if (time > _nextCarryNoiseTime) { - nextCarryNoiseTime = time + carryNoiseInterval * (1 + Random.value); + _nextCarryNoiseTime = time + carryNoiseInterval * (1 + Random.value); carrySounds!?.Play(emitter); } } diff --git a/SCHIZO/Creatures/Components/IOnMeleeAttack.cs b/SCHIZO/Creatures/Components/IOnMeleeAttack.cs new file mode 100644 index 00000000..a28aaf8d --- /dev/null +++ b/SCHIZO/Creatures/Components/IOnMeleeAttack.cs @@ -0,0 +1,14 @@ +using UnityEngine; + +namespace SCHIZO.Creatures.Components; + +public partial interface IOnMeleeAttack +{ + /// + /// Handle an attack before it does damage to the target.
+ /// Useful if you want to do something else instead. + ///
+ /// Whether the attack was "handled" (i.e. whether to cancel the attack). + // don't rename this to OnMeleeAttack, MeleeAttack sends a message named "OnMeleeAttack" to a completely different component + bool HandleMeleeAttack(GameObject target); +} diff --git a/SCHIZO/Creatures/Ermshark/Ermshark.cs b/SCHIZO/Creatures/Ermshark/Ermshark.cs index cf66b734..b68ac7a8 100644 --- a/SCHIZO/Creatures/Ermshark/Ermshark.cs +++ b/SCHIZO/Creatures/Ermshark/Ermshark.cs @@ -1,4 +1,6 @@ using System.Collections; +using SCHIZO.Helpers; +using SCHIZO.Sounds.Players; using UnityEngine; using UWE; @@ -27,6 +29,8 @@ public void OnTakeDamage(DamageInfo damageInfo) { if (liveMixin.health > 0) return; + actions.ForEach(action => action.StopPerform()); + if (mitosisRemaining > 0) { Mitosis(damageInfo.position, liveMixin.damageEffect); @@ -39,7 +43,7 @@ public void OnTakeDamage(DamageInfo damageInfo) } else { - gameObject.SetActive(false); // todo verify this works + gameObject.SetActive(false); Destroy(gameObject, 5); } } @@ -50,10 +54,9 @@ private void SOS() // Save the shark from dying (reloading the save will respawn transform.GetChild(0).localScale = Vector3.zero; liveMixin.ResetHealth(); - enabled = false; + OnKill(); // disables self and SwimBehaviour locomotion.enabled = false; - hurtSoundPlayer.enabled = false; - ambientSoundPlayer.enabled = false; + GetComponents().ForEach(soundPlayer => soundPlayer.enabled = false); } private void Mitosis(Vector3 position, GameObject hurtEffect) diff --git a/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs b/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs index 55cb473e..1fdccbd1 100644 --- a/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs +++ b/SCHIZO/Creatures/Ermshark/ErmsharkAttack.cs @@ -1,5 +1,7 @@ +using System.Linq; using Nautilus.Utility; using SCHIZO.Creatures.Components; +using SCHIZO.Helpers; using UnityEngine; namespace SCHIZO.Creatures.Ermshark; @@ -19,31 +21,20 @@ public override void OnTouch(Collider collider) GameObject target = GetTarget(collider); if (global::CreatureData.GetCreatureType(gameObject) == global::CreatureData.GetCreatureType(target)) return; - if (target.GetComponent()) return; // prevents tutel scream when released + if (GetComponentsInParent().Any(handler => handler.HandleMeleeAttack(target))) return; Player player = target.GetComponent(); if (player) { GameObject heldObject = Inventory.main.GetHeldObject(); - if (heldObject) + if (heldObject && canBeFed && player.CanBeAttacked() && TryEat(heldObject, true)) { - if (heldObject.GetComponent() is { } heldTutel) - { - Inventory.main.DropHeldItem(false); - creature.GetComponent().TryPickup(heldTutel); - creature.SetFriend(player.gameObject, 120f); - return; - } - else if (canBeFed && player.CanBeAttacked() && TryEat(heldObject, true)) - { - // if (attackSound) Utils.PlayEnvSound(attackSound, mouth.transform.position); - gameObject.SendMessage("OnMeleeAttack", heldObject, SendMessageOptions.DontRequireReceiver); - return; - } + if (this.GetBiteSound()) Utils.PlayEnvSound(this.GetBiteSound(), mouth.transform.position); + gameObject.SendMessage("OnMeleeAttack", heldObject, SendMessageOptions.DontRequireReceiver); + return; } } - // TODO: verify if ermshark can attack vehicles and cyclopses if (CanBite(target)) { timeLastBite = Time.time; @@ -54,14 +45,8 @@ public override void OnTouch(Collider collider) living.NotifyCreatureDeathsOfCreatureAttack(); } Vector3 damageFxPos = collider.ClosestPointOnBounds(mouth.transform.position); - if (damageFX != null) - { - Instantiate(damageFX, damageFxPos, damageFX.transform.rotation); - } - /*if (attackSound != null) - { - Utils.PlayEnvSound(attackSound, damageFxPos); - }*/ + if (damageFX) Instantiate(damageFX, damageFxPos, damageFX.transform.rotation); + if (this.GetBiteSound()) Utils.PlayEnvSound(this.GetBiteSound(), damageFxPos); if (attackSounds) attackSounds.Play(emitter); diff --git a/SCHIZO/Helpers/RetargetHelpers.cs b/SCHIZO/Helpers/RetargetHelpers.cs index 5d2f83d0..08d296f8 100644 --- a/SCHIZO/Helpers/RetargetHelpers.cs +++ b/SCHIZO/Helpers/RetargetHelpers.cs @@ -1,4 +1,5 @@ using System.Runtime.CompilerServices; +using UnityEngine; namespace SCHIZO.Helpers; @@ -19,4 +20,36 @@ 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); + } diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs index 7227fa0e..9c3eea82 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs @@ -4,7 +4,7 @@ namespace SCHIZO.Creatures.Components { - public sealed partial class CarryCreature : CustomCreatureAction + public sealed partial class CarryCreature : CustomCreatureAction, IOnMeleeAttack { [SerializeField] private EcoTargetType_All _ecoTargetType; diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs new file mode 100644 index 00000000..ff8d4e80 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs @@ -0,0 +1,6 @@ +namespace SCHIZO.Creatures.Components +{ + public partial interface IOnMeleeAttack + { + } +} \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta new file mode 100644 index 00000000..921c0275 --- /dev/null +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30a535428fa28c34795a18413a0f0712 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Tutel/Tutel.prefab b/Unity/Assets/Tutel/Tutel.prefab index 9238a11d..99b69dd3 100644 --- a/Unity/Assets/Tutel/Tutel.prefab +++ b/Unity/Assets/Tutel/Tutel.prefab @@ -29,6 +29,37 @@ Transform: m_Children: - {fileID: 374628843016702387} m_Father: {fileID: 4486286122742271350} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3643430878512789362 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5336982647614161068} + m_Layer: 0 + m_Name: Subnautica + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5336982647614161068 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3643430878512789362} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 9007695053246786571} + m_Father: {fileID: 4486286122742271350} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &-2056190791625996711 @@ -431,6 +462,91 @@ MonoBehaviour: assetStart: {fileID: 0} assetStop: {fileID: 0} stopSoundInterval: 0 +--- !u!1001 &3138311200081660477 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 5336982647614161068} + m_Modifications: + - target: {fileID: 560420996949097002, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_Name + value: Tutel prefab + objectReference: {fileID: 0} + - target: {fileID: 1858158595937725212, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1858158595937725212, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_IsTrigger + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 9a41a55919175c34b93f91f532e743b8, type: 3} +--- !u!4 &9007695053246786571 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6236438223353947702, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + m_PrefabInstance: {fileID: 3138311200081660477} + m_PrefabAsset: {fileID: 0} --- !u!1001 &4020549068864914281 PrefabInstance: m_ObjectHideFlags: 0 @@ -560,11 +676,21 @@ PrefabInstance: propertyPath: ikAimLeftArm value: 1 objectReference: {fileID: 0} + - target: {fileID: -1704340371831134875, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + propertyPath: mainCollider + value: + objectReference: {fileID: 3315315038906771573} - target: {fileID: -1704340371831134875, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} propertyPath: belowZeroModel value: objectReference: {fileID: 3020011672160239600} + - target: {fileID: -1704340371831134875, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + propertyPath: subnauticaModel + value: + objectReference: {fileID: 3643430878512789362} - target: {fileID: -1704340371831134875, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} propertyPath: referenceAnimation @@ -575,6 +701,11 @@ PrefabInstance: propertyPath: m_Mass value: 20 objectReference: {fileID: 0} + - target: {fileID: 206030070557398098, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + propertyPath: m_CollisionDetection + value: 3 + objectReference: {fileID: 0} - target: {fileID: 666221737875956283, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} propertyPath: animator @@ -708,6 +839,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4714682939814807485, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4743098428888258313, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} propertyPath: swimBehaviour @@ -806,18 +942,6 @@ PrefabInstance: - {fileID: 8106314337621275068, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} - {fileID: -2914789318229432670, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 5ff80f47f2822bb438251c8a7a1370ca, type: 3} ---- !u!114 &7004812872329714809 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 3036659393320280015, guid: 5ff80f47f2822bb438251c8a7a1370ca, - type: 3} - m_PrefabInstance: {fileID: 5409519764626113462} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 936897676119936064} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 66e630f68f9446108b3deb81bd1e09e5, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!114 &1989495301154876912 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: -3418686219161457082, guid: 5ff80f47f2822bb438251c8a7a1370ca, @@ -842,12 +966,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 02cc032310034950a8c74708fd12ddea, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!4 &4486286122742271350 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8453261883060768448, guid: 5ff80f47f2822bb438251c8a7a1370ca, - type: 3} - m_PrefabInstance: {fileID: 5409519764626113462} - m_PrefabAsset: {fileID: 0} --- !u!114 &6760105382927116189 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 1640086072332198955, guid: 5ff80f47f2822bb438251c8a7a1370ca, @@ -872,6 +990,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 49a33a91de98493e82c6af9b1a6f232c, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!4 &1139033297552060113 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4962070890995002727, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + m_PrefabInstance: {fileID: 5409519764626113462} + m_PrefabAsset: {fileID: 0} --- !u!1 &936897676119936064 stripped GameObject: m_CorrespondingSourceObject: {fileID: 5049378406231838710, guid: 5ff80f47f2822bb438251c8a7a1370ca, @@ -884,12 +1008,6 @@ Transform: type: 3} m_PrefabInstance: {fileID: 5409519764626113462} m_PrefabAsset: {fileID: 0} ---- !u!4 &1139033297552060113 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 4962070890995002727, guid: 5ff80f47f2822bb438251c8a7a1370ca, - type: 3} - m_PrefabInstance: {fileID: 5409519764626113462} - m_PrefabAsset: {fileID: 0} --- !u!54 &5316937864852920292 stripped Rigidbody: m_CorrespondingSourceObject: {fileID: 206030070557398098, guid: 5ff80f47f2822bb438251c8a7a1370ca, @@ -908,6 +1026,24 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3af24dbe2e70427cb93275ef00f34823, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &7004812872329714809 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3036659393320280015, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + m_PrefabInstance: {fileID: 5409519764626113462} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 936897676119936064} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66e630f68f9446108b3deb81bd1e09e5, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &4486286122742271350 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8453261883060768448, guid: 5ff80f47f2822bb438251c8a7a1370ca, + type: 3} + m_PrefabInstance: {fileID: 5409519764626113462} + m_PrefabAsset: {fileID: 0} --- !u!1001 &6034460073429725061 PrefabInstance: m_ObjectHideFlags: 0 @@ -920,6 +1056,11 @@ PrefabInstance: propertyPath: m_Name value: Tutel prefab objectReference: {fileID: 0} + - target: {fileID: 1858158595937725212, guid: 9a41a55919175c34b93f91f532e743b8, + type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} - target: {fileID: 1858158595937725212, guid: 9a41a55919175c34b93f91f532e743b8, type: 3} propertyPath: m_IsTrigger From e4b1df12801011ce88ea6df6dab4ca2b69622220 Mon Sep 17 00:00:00 2001 From: Govorunb Date: Fri, 3 Nov 2023 03:57:52 +1100 Subject: [PATCH 2/2] classic post-push refactor --- SCHIZO/Creatures/Components/CarryCreature.cs | 2 +- .../SCHIZO/Creatures/Components/CarryCreature.cs | 2 +- .../SCHIZO/Creatures/Components/IOnMeleeAttack.cs | 6 ------ .../Creatures/Components/IOnMeleeAttack.cs.meta | 11 ----------- 4 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs delete mode 100644 Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta diff --git a/SCHIZO/Creatures/Components/CarryCreature.cs b/SCHIZO/Creatures/Components/CarryCreature.cs index 3750d984..def87ff7 100644 --- a/SCHIZO/Creatures/Components/CarryCreature.cs +++ b/SCHIZO/Creatures/Components/CarryCreature.cs @@ -4,7 +4,7 @@ namespace SCHIZO.Creatures.Components; /// Adapted from -partial class CarryCreature : IOnTakeDamage +partial class CarryCreature : IOnTakeDamage, IOnMeleeAttack { private GetCarried target; private bool targetPickedUp; diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs index 9c3eea82..7227fa0e 100644 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs +++ b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/CarryCreature.cs @@ -4,7 +4,7 @@ namespace SCHIZO.Creatures.Components { - public sealed partial class CarryCreature : CustomCreatureAction, IOnMeleeAttack + public sealed partial class CarryCreature : CustomCreatureAction { [SerializeField] private EcoTargetType_All _ecoTargetType; diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs deleted file mode 100644 index ff8d4e80..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SCHIZO.Creatures.Components -{ - public partial interface IOnMeleeAttack - { - } -} \ No newline at end of file diff --git a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta b/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta deleted file mode 100644 index 921c0275..00000000 --- a/Unity/Assets/Scripts/SCHIZO/Creatures/Components/IOnMeleeAttack.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 30a535428fa28c34795a18413a0f0712 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: