Browse Source

4 types of enemies

master
Josh 2 years ago
parent
commit
ecdb19b4d5
  1. 1896
      unity_project/Assets/BeatEmUp_GameTemplate3D/01_Game.unity
  2. 87
      unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyBlueSkin.mat
  3. 8
      unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyBlueSkin.mat.meta
  4. 87
      unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyChargerSkin.mat
  5. 8
      unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyChargerSkin.mat.meta
  6. 285
      unity_project/Assets/BeatEmUp_GameTemplate3D/Resources/ProjectileEnemyKnife.prefab
  7. 8
      unity_project/Assets/BeatEmUp_GameTemplate3D/Resources/ProjectileEnemyKnife.prefab.meta
  8. 53
      unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Enemy/EnemyAI.cs
  9. 9
      unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Enemy/EnemyActions.cs
  10. 19
      unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Enemy/EnemyManager.cs
  11. 26
      unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Other/Projectile.cs
  12. 1
      unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Player/UnitState.cs
  13. BIN
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/BCharger 1.png
  14. 92
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/BCharger 1.png.meta
  15. BIN
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/ChD 1.png
  16. 92
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/ChD 1.png.meta
  17. BIN
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Blue.png
  18. 92
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Blue.png.meta
  19. BIN
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Charger.png
  20. 92
      unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Charger.png.meta
  21. 23
      unity_project/ProjectSettings/DynamicsManager.asset
  22. 2
      unity_project/ProjectSettings/TagManager.asset

1896
unity_project/Assets/BeatEmUp_GameTemplate3D/01_Game.unity

File diff suppressed because it is too large

87
unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyBlueSkin.mat

@ -0,0 +1,87 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Mat_EnemyBlueSkin
m_Shader: {fileID: 4800000, guid: ab587ef05bd2a724cb41e345bf85b97a, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AOMap:
m_Texture: {fileID: 2800000, guid: 1f933cd2ffae3864ea93db52d653574b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: f92209d7067ea4c49835c8ebf9aa9bf0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 6aa45942c2cf2cc43ade7597a4ef12be, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MatCap:
m_Texture: {fileID: 2800000, guid: 96bd125c3c6e4d04981cbb211d97eeae, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Offset: 0
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.34509805, g: 0.34509805, b: 0.34509805, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

8
unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyBlueSkin.mat.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7f0ad4a5c05085a439a31b106679890f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

87
unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyChargerSkin.mat

@ -0,0 +1,87 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Mat_EnemyChargerSkin
m_Shader: {fileID: 4800000, guid: ab587ef05bd2a724cb41e345bf85b97a, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AOMap:
m_Texture: {fileID: 2800000, guid: 1f933cd2ffae3864ea93db52d653574b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: f92209d7067ea4c49835c8ebf9aa9bf0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: b4ad26106aeffc2409946a48195b0b84, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MatCap:
m_Texture: {fileID: 2800000, guid: 96bd125c3c6e4d04981cbb211d97eeae, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Offset: 0
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.34509805, g: 0.34509805, b: 0.34509805, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

8
unity_project/Assets/BeatEmUp_GameTemplate3D/Materials/Mat_EnemyChargerSkin.mat.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b038eb787a00fa744bef0acb43773fc2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

285
unity_project/Assets/BeatEmUp_GameTemplate3D/Resources/ProjectileEnemyKnife.prefab

@ -0,0 +1,285 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1000010322542792
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4000011925097456}
- component: {fileID: 65225784713525598}
- component: {fileID: 54526216341663494}
- component: {fileID: 96000012231254088}
- component: {fileID: 114000011184243308}
- component: {fileID: 114243203254085832}
m_Layer: 15
m_Name: ProjectileEnemyKnife
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000011925097456
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010322542792}
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: 4090755774628540}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &65225784713525598
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010322542792}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.8, y: 0.3, z: 2}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &54526216341663494
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010322542792}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 124
m_CollisionDetection: 1
--- !u!96 &96000012231254088
TrailRenderer:
serializedVersion: 2
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010322542792}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: d284683e289e0494ca13798d8828e700, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Time: 0.4
m_Parameters:
serializedVersion: 3
widthMultiplier: 0.7
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0.1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 0.84705883}
key2: {r: 1, g: 1, b: 1, a: 0.6392157}
key3: {r: 1, g: 1, b: 1, a: 0.34509805}
key4: {r: 1, g: 1, b: 1, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 16384
ctime2: 32768
ctime3: 49151
ctime4: 65535
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 16384
atime2: 32768
atime3: 49151
atime4: 65535
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 5
m_NumAlphaKeys: 5
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
shadowBias: 0
generateLightingData: 0
m_MinVertexDistance: 0.1
m_Autodestruct: 1
m_Emitting: 1
--- !u!114 &114000011184243308
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010322542792}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d6ce95a39b3125644986bd65106dd1d5, type: 3}
m_Name:
m_EditorClassIdentifier:
LifeTime: 2
--- !u!114 &114243203254085832
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010322542792}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 723dd16cfdfd04740a45177828d2936b, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 15
direction: -1
destroyOnHit: 1
EffectOnSpawn: {fileID: 0}
firedByEnemy: 0
--- !u!1 &1910063761534454
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4090755774628540}
- component: {fileID: 33490788981067122}
- component: {fileID: 23842675587574202}
m_Layer: 10
m_Name: GFX
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4090755774628540
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1910063761534454}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4000011925097456}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!33 &33490788981067122
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1910063761534454}
m_Mesh: {fileID: 4300002, guid: ad9bec502d8361f46a401a91505f41b5, type: 3}
--- !u!23 &23842675587574202
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1910063761534454}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: e8d4b2d8b28d2d24db7bd6c202ffbe27, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}

8
unity_project/Assets/BeatEmUp_GameTemplate3D/Resources/ProjectileEnemyKnife.prefab.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 01a9bf2bf87f2554cac0f0b94754fad3
timeCreated: 1473608195
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

53
unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Enemy/EnemyAI.cs

@ -6,11 +6,16 @@ public class EnemyAI : EnemyActions, IDamagable<DamageObject>{
[Space(10)] [Space(10)]
public bool enableAI; public bool enableAI;
public float chargeTime = 0f;
public bool ranged = false;
public DamageObject rangedDamage;
float _timeToShoot = 4f;
//a list of states where the AI is executed //a list of states where the AI is executed
private List<UNITSTATE> ActiveAIStates = new List<UNITSTATE> { private List<UNITSTATE> ActiveAIStates = new List<UNITSTATE> {
UNITSTATE.IDLE, UNITSTATE.IDLE,
UNITSTATE.WALK UNITSTATE.WALK,
UNITSTATE.CHARGE
}; };
void Start(){ void Start(){
@ -36,8 +41,35 @@ public class EnemyAI : EnemyActions, IDamagable<DamageObject>{
OnLateUpdate(); OnLateUpdate();
} }
void Shoot()
{
_timeToShoot -= Time.deltaTime;
if (ranged && _timeToShoot < 0 && enemyState != UNITSTATE.KNOCKDOWNGROUNDED)
{
//spawn projectile at spawn position
GameObject projectilePrefab = GameObject.Instantiate(Resources.Load("ProjectileEnemyKnife"), this.transform.position + new Vector3(0f, 1f, 0f), Quaternion.identity) as GameObject;
if (!projectilePrefab) return;
//set projectile to current direction
Projectile projectileComponent = projectilePrefab.GetComponent<Projectile>();
if (projectileComponent)
{
projectileComponent.firedByEnemy = true;
projectileComponent.direction = this.currentDirection;
rangedDamage.inflictor = this.gameObject;
projectileComponent.SetDamage(rangedDamage);
}
_timeToShoot = 3f;
}
}
void Update(){ void Update(){
Shoot();
chargeTime -= Time.deltaTime;
//do nothing when there is no target or when AI is disabled //do nothing when there is no target or when AI is disabled
if (target == null || !enableAI) { if (target == null || !enableAI) {
Ready (); Ready ();
@ -65,6 +97,20 @@ public class EnemyAI : EnemyActions, IDamagable<DamageObject>{
void AI(){ void AI(){
LookAtTarget(target.transform); LookAtTarget(target.transform);
if (enemyTactic == ENEMYTACTIC.CHARGE)
{
if (chargeTime < 0)
{
WalkTo(closeRangeDistance, 0f);
chargeTime = 2f;
}
else
{
Charge();
}
}
if (range == RANGE.ATTACKRANGE){ if (range == RANGE.ATTACKRANGE){
//attack the target //attack the target
@ -83,6 +129,8 @@ public class EnemyAI : EnemyActions, IDamagable<DamageObject>{
if (enemyTactic == ENEMYTACTIC.KEEPFARDISTANCE) WalkTo(farRangeDistance, RangeMarging); if (enemyTactic == ENEMYTACTIC.KEEPFARDISTANCE) WalkTo(farRangeDistance, RangeMarging);
if (enemyTactic == ENEMYTACTIC.STANDSTILL) Ready (); if (enemyTactic == ENEMYTACTIC.STANDSTILL) Ready ();
} else { } else {
//actions for CLOSERANGE, MIDRANGE & FARRANGE distances //actions for CLOSERANGE, MIDRANGE & FARRANGE distances
@ -128,6 +176,8 @@ public class EnemyAI : EnemyActions, IDamagable<DamageObject>{
//set an enemy tactic //set an enemy tactic
public void SetEnemyTactic(ENEMYTACTIC tactic){ public void SetEnemyTactic(ENEMYTACTIC tactic){
if (enemyTactic != ENEMYTACTIC.CHARGE)
enemyTactic = tactic; enemyTactic = tactic;
} }
@ -171,6 +221,7 @@ public enum ENEMYTACTIC {
KEEPMEDIUMDISTANCE = 2, KEEPMEDIUMDISTANCE = 2,
KEEPFARDISTANCE = 3, KEEPFARDISTANCE = 3,
STANDSTILL = 4, STANDSTILL = 4,
CHARGE = 5
} }
public enum RANGE { public enum RANGE {

9
unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Enemy/EnemyActions.cs

@ -55,6 +55,7 @@ public class EnemyActions : MonoBehaviour {
public bool randomizeValues = true; //randomize values to avoid enemy synchronization public bool randomizeValues = true; //randomize values to avoid enemy synchronization
[HideInInspector] [HideInInspector]
public float zSpreadMultiplier = 2f; //multiplyer for the z distance between enemies public float zSpreadMultiplier = 2f; //multiplyer for the z distance between enemies
float chargeTime = 0f;
[Header ("Stats")] [Header ("Stats")]
public RANGE range; public RANGE range;
@ -138,8 +139,9 @@ public class EnemyActions : MonoBehaviour {
//late Update //late Update
public void OnLateUpdate(){ public void OnLateUpdate(){
//apply any root motion offsets to parent //apply any root motion offsets to parent
if(animator && animator.GetComponent<Animator>().applyRootMotion && animator.transform.localPosition != Vector3.zero) { if (animator && animator.GetComponent<Animator>().applyRootMotion && animator.transform.localPosition != Vector3.zero) {
Vector3 offset = animator.transform.localPosition; Vector3 offset = animator.transform.localPosition;
animator.transform.localPosition = Vector3.zero; animator.transform.localPosition = Vector3.zero;
transform.position += offset * (int)currentDirection; transform.position += offset * (int)currentDirection;
@ -429,6 +431,11 @@ public class EnemyActions : MonoBehaviour {
#region Movement #region Movement
public void Charge()
{
Move(moveDirection.normalized, walkSpeed);
}
//walk to target //walk to target
public void WalkTo(float proximityRange, float movementMargin){ public void WalkTo(float proximityRange, float movementMargin){
Vector3 dirToTarget; Vector3 dirToTarget;

19
unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Enemy/EnemyManager.cs

@ -19,10 +19,21 @@ public static class EnemyManager {
getActiveEnemies(); getActiveEnemies();
if(activeEnemies.Count > 0){ if(activeEnemies.Count > 0){
for(int i=0; i<activeEnemies.Count; i++){ for(int i=0; i<activeEnemies.Count; i++){
if(i < MaxEnemyAttacking()){ EnemyAI ai = activeEnemies[i].GetComponent<EnemyAI>();
activeEnemies[i].GetComponent<EnemyAI>().SetEnemyTactic(ENEMYTACTIC.ENGAGE); if (ai.ranged)
} else { {
activeEnemies[i].GetComponent<EnemyAI>().SetEnemyTactic(ENEMYTACTIC.KEEPMEDIUMDISTANCE); ai.SetEnemyTactic(ENEMYTACTIC.KEEPFARDISTANCE);
}
else
{
if (i < MaxEnemyAttacking())
{
ai.SetEnemyTactic(ENEMYTACTIC.ENGAGE);
}
else
{
ai.SetEnemyTactic(ENEMYTACTIC.KEEPMEDIUMDISTANCE);
}
} }
} }
} }

26
unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Other/Projectile.cs

@ -10,6 +10,7 @@ public class Projectile : MonoBehaviour {
public bool destroyOnHit; public bool destroyOnHit;
public GameObject EffectOnSpawn; public GameObject EffectOnSpawn;
private DamageObject damage; private DamageObject damage;
public bool firedByEnemy = false;
void Start () { void Start () {
GetComponent<Rigidbody>().velocity = new Vector2((int)direction * speed, 0); GetComponent<Rigidbody>().velocity = new Vector2((int)direction * speed, 0);
@ -27,13 +28,32 @@ public class Projectile : MonoBehaviour {
//tell the player that an item is in range //tell the player that an item is in range
void OnTriggerEnter(Collider coll) { void OnTriggerEnter(Collider coll) {
if(coll.CompareTag("Enemy")) { if (firedByEnemy)
{
if (coll.CompareTag("Player"))
{
//hit a damagable object //hit a damagable object
IDamagable<DamageObject> damagableObject = coll.GetComponent(typeof(IDamagable<DamageObject>)) as IDamagable<DamageObject>; IDamagable<DamageObject> damagableObject = coll.GetComponent(typeof(IDamagable<DamageObject>)) as IDamagable<DamageObject>;
if(damagableObject != null) { if (damagableObject != null)
{
damagableObject.Hit(damage); damagableObject.Hit(damage);
if(destroyOnHit) Destroy(gameObject); if (destroyOnHit) Destroy(gameObject);
}
}
}
else
{
if (coll.CompareTag("Enemy"))
{
//hit a damagable object
IDamagable<DamageObject> damagableObject = coll.GetComponent(typeof(IDamagable<DamageObject>)) as IDamagable<DamageObject>;
if (damagableObject != null)
{
damagableObject.Hit(damage);
if (destroyOnHit) Destroy(gameObject);
}
} }
} }
} }

1
unity_project/Assets/BeatEmUp_GameTemplate3D/Scripts/Player/UnitState.cs

@ -13,6 +13,7 @@ public enum UNITSTATE {
IDLE, IDLE,
WALK, WALK,
RUN, RUN,
CHARGE,
JUMPING, JUMPING,
LAND, LAND,
JUMPKICK, JUMPKICK,

BIN
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/BCharger 1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

92
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/BCharger 1.png.meta

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 166b0da9c41288040970bcc3b367aae1
timeCreated: 1501747357
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 5
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

BIN
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/ChD 1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

92
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/ChD 1.png.meta

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 79f21866848f61e42a06f818d2706dd0
timeCreated: 1501747357
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 5
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

BIN
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Blue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

92
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Blue.png.meta

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 6aa45942c2cf2cc43ade7597a4ef12be
timeCreated: 1501747357
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 5
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

BIN
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Charger.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

92
unity_project/Assets/BeatEmUp_GameTemplate3D/Textures/Enemy_Charger.png.meta

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: b4ad26106aeffc2409946a48195b0b84
timeCreated: 1501747357
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 5
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

23
unity_project/ProjectSettings/DynamicsManager.asset

@ -3,10 +3,11 @@
--- !u!55 &1 --- !u!55 &1
PhysicsManager: PhysicsManager:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 3 serializedVersion: 13
m_Gravity: {x: 0, y: -17, z: 0} m_Gravity: {x: 0, y: -17, z: 0}
m_DefaultMaterial: {fileID: 13400000, guid: 23b3e65e8933f4540933b43e8033912b, type: 2} m_DefaultMaterial: {fileID: 13400000, guid: 23b3e65e8933f4540933b43e8033912b, type: 2}
m_BounceThreshold: 2 m_BounceThreshold: 2
m_DefaultMaxDepenetrationVelocity: 10
m_SleepThreshold: 0.003 m_SleepThreshold: 0.003
m_DefaultContactOffset: 0.01 m_DefaultContactOffset: 0.01
m_DefaultSolverIterations: 6 m_DefaultSolverIterations: 6
@ -14,7 +15,23 @@ PhysicsManager:
m_QueriesHitBackfaces: 0 m_QueriesHitBackfaces: 0
m_QueriesHitTriggers: 1 m_QueriesHitTriggers: 1
m_EnableAdaptiveForce: 0 m_EnableAdaptiveForce: 0
m_EnablePCM: 1 m_ClothInterCollisionDistance: 0.1
m_LayerCollisionMatrix: c888ffffc880ffffc880ffffffffffffc880ffffc880ffffffffffffffffffffc8bcffffc8e8ffffc889ffffc987ffffc881ffffc883ffffc882ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_ClothInterCollisionStiffness: 0.2
m_ContactsGeneration: 1
m_LayerCollisionMatrix: c808ffffc800ffffc800ffffffffffffc800ffffc800ffffffffffffffffffffc87cffffc8e8ffffc809ffffc907ffffc801ffffc803ffffc803ffffc802ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1 m_AutoSimulation: 1
m_AutoSyncTransforms: 1 m_AutoSyncTransforms: 1
m_ReuseCollisionCallbacks: 0
m_ClothInterCollisionSettingsToggle: 0
m_ClothGravity: {x: 0, y: -9.81, z: 0}
m_ContactPairsMode: 0
m_BroadphaseType: 0
m_WorldBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 250, y: 250, z: 250}
m_WorldSubdivisions: 8
m_FrictionType: 0
m_EnableEnhancedDeterminism: 0
m_EnableUnifiedHeightmaps: 1
m_SolverType: 0
m_DefaultMaxAngularSpeed: 7

2
unity_project/ProjectSettings/TagManager.asset

@ -22,7 +22,7 @@ TagManager:
- Projectile - Projectile
- DestroyableObject - DestroyableObject
- AreaCollider - AreaCollider
- - EnemyProjectile
- -
- -
- -

Loading…
Cancel
Save