Skip to content

Commit

Permalink
Add bite attack to example creature
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTwentyThree committed Jan 3, 2024
1 parent a49dfc9 commit c5e8ffc
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
8 changes: 6 additions & 2 deletions ECCLibrary/ECCLibrary/Examples/ExamplePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,20 @@ public static void PatchExampleCreatures()
SizeDistribution = new AnimationCurve(new Keyframe(0, 0.5f), new Keyframe(1, 1f)),
AnimateByVelocityData = new AnimateByVelocityData(6f),
FleeOnDamageData = new FleeOnDamageData(0.8f, 8f),
AggressiveWhenSeeTargetList = new List<AggressiveWhenSeeTargetData> { new(EcoTargetType.Shark, 1, 20, 1) },
AggressiveWhenSeeTargetList = new List<AggressiveWhenSeeTargetData> { new(EcoTargetType.Shark, 1, 20, 1), new(EcoTargetType.SmallFish, 1, 20, 1) },
AttackLastTargetData = new AttackLastTargetData(0.7f, 8f, 0.5f, 7f)
}.SetWaterParkCreatureData(new WaterParkCreatureDataStruct(0.1f, 1f, 1f, 1f, false, true, "ExampleShark", "ExampleShark")),
ModifyExampleShark
);
exampleShark.CustomPrefab.SetSpawns(new SpawnLocation(new Vector3(5, -800, 500)));
exampleShark.Register();
}

private static IEnumerator ModifyExampleShark(GameObject obj1, CreatureComponents obj2)
private static IEnumerator ModifyExampleShark(GameObject obj, CreatureComponents components)
{
CreaturePrefabUtils.AddMeleeAttack<MeleeAttack>(obj, components,
obj.transform.Find("MouthDamageTrigger").gameObject, true, 20);

yield break;
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ManifestFileVersion: 0
CRC: 2060326997
CRC: 3019739633
AssetBundleManifest:
AssetBundleInfos:
Info_0:
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ManifestFileVersion: 0
CRC: 3347110415
CRC: 2715776638
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: e1e482129d970110a24bbc7969c77bec
Hash: 482e5cb9227572eae4c42a59253b9b57
TypeTreeHash:
serializedVersion: 2
Hash: 9e8aa562a4952e35214c7b4193eb501d
Hash: cb233af9f3e06ec66fb7c67328d00d0e
HashAppended: 0
ClassTypes:
- Class: 1
Expand All @@ -31,6 +31,8 @@ ClassTypes:
Script: {instanceID: 0}
- Class: 95
Script: {instanceID: 0}
- Class: 135
Script: {instanceID: 0}
- Class: 136
Script: {instanceID: 0}
- Class: 137
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3329288015749037229
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1245183316352267115}
- component: {fileID: 7937240193909162494}
m_Layer: 0
m_Name: MouthDamageTrigger
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1245183316352267115
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3329288015749037229}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.244, z: 2.822}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6148085361877137314}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &7937240193909162494
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3329288015749037229}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!95 &4985929828499421219
Animator:
serializedVersion: 3
Expand Down Expand Up @@ -48,6 +92,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5042902745165785087}
- {fileID: 1245183316352267115}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down

0 comments on commit c5e8ffc

Please sign in to comment.