Added superjump targeting UI. Fixed bomb effect. Fixed attack speed, attack energy.
This commit is contained in:
parent
c5f883829f
commit
03ec2c7d7c
13484
Assets/Animation/Character/JumpAtoB_New.anim
Normal file
13484
Assets/Animation/Character/JumpAtoB_New.anim
Normal file
File diff suppressed because it is too large
Load Diff
8
Assets/Animation/Character/JumpAtoB_New.anim.meta
Normal file
8
Assets/Animation/Character/JumpAtoB_New.anim.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f4bfcb0bd8f4807429f6f6d3dd70cc15
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -575,7 +575,7 @@ AnimatorState:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: Movement
|
m_Name: Movement
|
||||||
m_Speed: 3
|
m_Speed: 1
|
||||||
m_CycleOffset: 0
|
m_CycleOffset: 0
|
||||||
m_Transitions:
|
m_Transitions:
|
||||||
- {fileID: 354894258193955894}
|
- {fileID: 354894258193955894}
|
||||||
@ -588,7 +588,7 @@ AnimatorState:
|
|||||||
m_MirrorParameterActive: 0
|
m_MirrorParameterActive: 0
|
||||||
m_CycleOffsetParameterActive: 0
|
m_CycleOffsetParameterActive: 0
|
||||||
m_TimeParameterActive: 0
|
m_TimeParameterActive: 0
|
||||||
m_Motion: {fileID: 7400000, guid: e7006fe6c17756e48b0b263f58b993dd, type: 2}
|
m_Motion: {fileID: 7400000, guid: f4bfcb0bd8f4807429f6f6d3dd70cc15, type: 2}
|
||||||
m_Tag:
|
m_Tag:
|
||||||
m_SpeedParameter:
|
m_SpeedParameter:
|
||||||
m_MirrorParameter:
|
m_MirrorParameter:
|
||||||
|
79
Assets/Material/Zone/MZone_Transparent_Bad.mat
Normal file
79
Assets/Material/Zone/MZone_Transparent_Bad.mat
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
%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: MZone_Transparent_Bad
|
||||||
|
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: 3000
|
||||||
|
stringTagMap:
|
||||||
|
RenderType: Transparent
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
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: 0}
|
||||||
|
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: 10
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 3
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 0
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 1, g: 0, b: 0.008962631, a: 0.16862746}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
8
Assets/Material/Zone/MZone_Transparent_Bad.mat.meta
Normal file
8
Assets/Material/Zone/MZone_Transparent_Bad.mat.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f89db1fad2a6ff94d97ef6ceb27152b6
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
79
Assets/Material/Zone/MZone_Transparent_Good.mat
Normal file
79
Assets/Material/Zone/MZone_Transparent_Good.mat
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
%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: MZone_Transparent_Good
|
||||||
|
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: 3000
|
||||||
|
stringTagMap:
|
||||||
|
RenderType: Transparent
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
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: 0}
|
||||||
|
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: 10
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 3
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 0
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 0.0014920235, g: 1, b: 0, a: 0.16862746}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
8
Assets/Material/Zone/MZone_Transparent_Good.mat.meta
Normal file
8
Assets/Material/Zone/MZone_Transparent_Good.mat.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f73cc48238593e945be63825152f2971
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -48,8 +48,9 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
owner: 1
|
owner: 1
|
||||||
damage: 100
|
damage: 100
|
||||||
collisionVFX: {fileID: 2214609422064327837, guid: 234698f23c9068940b633be5a4f146ea,
|
collisionVFX: {fileID: 2307028534112872116, guid: 79d768bf87aadec478a5722da8c6d516,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
timeToDamage: 2
|
||||||
--- !u!135 &8305872390849316386
|
--- !u!135 &8305872390849316386
|
||||||
SphereCollider:
|
SphereCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -12,9 +12,9 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: ef86a7fd23f3f604d945074968fd7063, type: 3}
|
m_Script: {fileID: 11500000, guid: ef86a7fd23f3f604d945074968fd7063, type: 3}
|
||||||
m_Name: StandartAttack
|
m_Name: StandartAttack
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
duration: 0.3
|
duration: 0.5
|
||||||
distance: 1
|
distance: 1
|
||||||
actionState: 3
|
actionType: 1
|
||||||
standartAttackPref: {fileID: 8121987183708165570, guid: a69f2bfc3db12bf429b2420ae3b5ca1d,
|
standartAttackPref: {fileID: 8121987183708165570, guid: a69f2bfc3db12bf429b2420ae3b5ca1d,
|
||||||
type: 3}
|
type: 3}
|
||||||
standartAttackGroundImpact: {fileID: 8619867339336636724, guid: fb745cfc34702fc4daee97f8f3273f09,
|
standartAttackGroundImpact: {fileID: 8619867339336636724, guid: fb745cfc34702fc4daee97f8f3273f09,
|
||||||
|
83
Assets/Prefabs_NEW/ZoneTransparentPref.prefab
Normal file
83
Assets/Prefabs_NEW/ZoneTransparentPref.prefab
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &2910955384744457751
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2534993135843699885}
|
||||||
|
- component: {fileID: 1477674660153484040}
|
||||||
|
- component: {fileID: 3703425710226642882}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: ZoneTransparentPref
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &2534993135843699885
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2910955384744457751}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0.2, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!33 &1477674660153484040
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2910955384744457751}
|
||||||
|
m_Mesh: {fileID: 1095898118798147751, guid: 0140277f2a2384e48aac3ffd0a426811, type: 3}
|
||||||
|
--- !u!23 &3703425710226642882
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2910955384744457751}
|
||||||
|
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: f73cc48238593e945be63825152f2971, 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: 1
|
||||||
|
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}
|
7
Assets/Prefabs_NEW/ZoneTransparentPref.prefab.meta
Normal file
7
Assets/Prefabs_NEW/ZoneTransparentPref.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9af035438521f83428bd37aa790a13ed
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -18,11 +18,18 @@ public class ActionTargetingSystem : MonoBehaviour
|
|||||||
if (_playerState.controlType == ControlType.Player)
|
if (_playerState.controlType == ControlType.Player)
|
||||||
{
|
{
|
||||||
CustomInput.OnTouchDown += StartTargeting;
|
CustomInput.OnTouchDown += StartTargeting;
|
||||||
|
CustomInput.OnTouchUp += EndTargeting;
|
||||||
}
|
}
|
||||||
|
|
||||||
//OnFoundTarget += WriteSome;
|
//OnFoundTarget += WriteSome;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EndTargeting()
|
||||||
|
{
|
||||||
|
OnLostTarget?.Invoke();
|
||||||
|
StopAllCoroutines();
|
||||||
|
}
|
||||||
|
|
||||||
/*private void WriteSome(TileInfo target)
|
/*private void WriteSome(TileInfo target)
|
||||||
{
|
{
|
||||||
Debug.Log("set new target");
|
Debug.Log("set new target");
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -15,13 +16,40 @@ public class Trap : PlayerAction
|
|||||||
bool permission = base.IsActionAllowed(targetTile, playerState);
|
bool permission = base.IsActionAllowed(targetTile, playerState);
|
||||||
bool isMyTile = targetTile.tileOwnerIndex == playerState.ownerIndex;
|
bool isMyTile = targetTile.tileOwnerIndex == playerState.ownerIndex;
|
||||||
permission = permission && targetTile.canBuildHere && isMyTile;
|
permission = permission && targetTile.canBuildHere && isMyTile;
|
||||||
|
|
||||||
|
bool ifCanPlaceAnotherTrap = CheckExit(playerState);
|
||||||
|
if (!ifCanPlaceAnotherTrap)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return permission;
|
return permission;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool CheckExit(PlayerState playerState)
|
||||||
|
{
|
||||||
|
bool permision = false;
|
||||||
|
int possibleMoveTiles = 0;
|
||||||
|
List<TileInfo> adjacentTiles = TileManagment.GetAllAdjacentTiles(playerState.currentTile);
|
||||||
|
foreach (var tile in adjacentTiles)
|
||||||
|
{
|
||||||
|
if (tile.canMove && tile.buildingOnTile == null)
|
||||||
|
{
|
||||||
|
possibleMoveTiles++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Debug.Log(possibleMoveTiles);
|
||||||
|
if (possibleMoveTiles > 1)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return permision;
|
||||||
|
}
|
||||||
|
|
||||||
public override void StartActionOperations(TileInfo targetTile, PlayerState currentPlayer)
|
public override void StartActionOperations(TileInfo targetTile, PlayerState currentPlayer)
|
||||||
{
|
{
|
||||||
base.StartActionOperations(targetTile, currentPlayer);
|
base.StartActionOperations(targetTile, currentPlayer);
|
||||||
_target = targetTile;
|
_target = targetTile;
|
||||||
|
_target.canBuildHere = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void FinishActionOperations(PlayerState currentPlayer)
|
public override void FinishActionOperations(PlayerState currentPlayer)
|
||||||
|
@ -6,7 +6,7 @@ public class BonusObject : MonoBehaviour
|
|||||||
{
|
{
|
||||||
public Bonus bonus;
|
public Bonus bonus;
|
||||||
|
|
||||||
public float aliveTime = 5f;
|
public float aliveTime = 3f;
|
||||||
|
|
||||||
private float spawnTime;
|
private float spawnTime;
|
||||||
|
|
||||||
|
@ -152,6 +152,7 @@ public enum CharacterState
|
|||||||
Capture,
|
Capture,
|
||||||
Move,
|
Move,
|
||||||
Action,
|
Action,
|
||||||
|
Frozen,
|
||||||
/*Attack,
|
/*Attack,
|
||||||
Build,
|
Build,
|
||||||
TreeAttack,*/
|
TreeAttack,*/
|
||||||
|
@ -10,6 +10,8 @@ public class TrapObj : MonoBehaviour
|
|||||||
|
|
||||||
public GameObject collisionVFX;
|
public GameObject collisionVFX;
|
||||||
|
|
||||||
|
public float timeToDamage = 1f;
|
||||||
|
|
||||||
public void SetOwner(TileOwner newOwner)
|
public void SetOwner(TileOwner newOwner)
|
||||||
{
|
{
|
||||||
owner = newOwner;
|
owner = newOwner;
|
||||||
@ -21,13 +23,29 @@ public class TrapObj : MonoBehaviour
|
|||||||
var playerState = other.gameObject.GetComponent<PlayerState>();
|
var playerState = other.gameObject.GetComponent<PlayerState>();
|
||||||
if (healthController && owner != playerState.ownerIndex)
|
if (healthController && owner != playerState.ownerIndex)
|
||||||
{
|
{
|
||||||
healthController.TakeDamage(damage);
|
if (collisionVFX != null)
|
||||||
if(collisionVFX!=null)
|
|
||||||
{
|
{
|
||||||
Instantiate(collisionVFX, collisionVFX.transform.position + transform.position, collisionVFX.transform.rotation);
|
Instantiate(collisionVFX, collisionVFX.transform.position + transform.position, collisionVFX.transform.rotation);
|
||||||
}
|
}
|
||||||
Destroy(gameObject);
|
playerState.SetNewState(CharacterState.Frozen);
|
||||||
|
StartCoroutine(WaitToDamage(timeToDamage, healthController, playerState));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IEnumerator WaitToDamage(float time, HealthController healthController, PlayerState player)
|
||||||
|
{
|
||||||
|
float timer = 0f;
|
||||||
|
while (timer < time)
|
||||||
|
{
|
||||||
|
timer += Time.fixedDeltaTime;
|
||||||
|
player.currentState = CharacterState.Frozen;
|
||||||
|
yield return new WaitForFixedUpdate();
|
||||||
|
}
|
||||||
|
healthController.TakeDamage(damage);
|
||||||
|
|
||||||
|
Destroy(gameObject);
|
||||||
|
player.SetNewState(CharacterState.Idle);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,10 @@ public class BonusUI : MonoBehaviour
|
|||||||
|
|
||||||
public void SetSelectedSlot(BonusSlot selection)
|
public void SetSelectedSlot(BonusSlot selection)
|
||||||
{
|
{
|
||||||
|
if (bonusController.GetComponent<PlayerState>().currentState != CharacterState.Idle)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (selectedSlot != selection)
|
if (selectedSlot != selection)
|
||||||
{
|
{
|
||||||
selectedSlot = selection;
|
selectedSlot = selection;
|
||||||
|
@ -11,9 +11,11 @@ public class PlayerUIController : MonoBehaviour
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private UI_Progress _progressUI;
|
private UI_Progress _progressUI;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private UI_Quantity healthUI;
|
private UI_Quantity _healthUI;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private UI_Quantity attackEnergyUI;
|
private UI_Quantity _attackEnergyUI;
|
||||||
|
[SerializeField]
|
||||||
|
private UI_SuperJump _superJumpUI;
|
||||||
|
|
||||||
private PlayerState _playerState;
|
private PlayerState _playerState;
|
||||||
private ActionTargetingSystem _targetingSystem;
|
private ActionTargetingSystem _targetingSystem;
|
||||||
@ -38,7 +40,7 @@ public class PlayerUIController : MonoBehaviour
|
|||||||
|
|
||||||
|
|
||||||
_targetingSystem.OnFoundTarget += UpdateActionUI;
|
_targetingSystem.OnFoundTarget += UpdateActionUI;
|
||||||
_targetingSystem.OnLostTarget += StopUpdateAttackUI;
|
_targetingSystem.OnLostTarget += StopUpdateActionUI;
|
||||||
|
|
||||||
_playerState.OnCharStateChanged += StartUpdatingProgressUI;
|
_playerState.OnCharStateChanged += StartUpdatingProgressUI;
|
||||||
|
|
||||||
@ -48,6 +50,20 @@ public class PlayerUIController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateActionUI(TileInfo target, ActionType actionType)
|
private void UpdateActionUI(TileInfo target, ActionType actionType)
|
||||||
|
{
|
||||||
|
switch (actionType)
|
||||||
|
{
|
||||||
|
case ActionType.SuperJump:
|
||||||
|
_superJumpUI.UpdateUI(target);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
UpdateAttackUI(target);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateAttackUI(TileInfo target)
|
||||||
{
|
{
|
||||||
Vector3 targetPos = target.tilePosition;
|
Vector3 targetPos = target.tilePosition;
|
||||||
if (targetPos != null)
|
if (targetPos != null)
|
||||||
@ -59,12 +75,12 @@ public class PlayerUIController : MonoBehaviour
|
|||||||
|
|
||||||
private void UpdateEnergyUI(float curEnergy, float maxEnergy)
|
private void UpdateEnergyUI(float curEnergy, float maxEnergy)
|
||||||
{
|
{
|
||||||
attackEnergyUI.UpdateBar(curEnergy, maxEnergy);
|
_attackEnergyUI.UpdateBar(curEnergy, maxEnergy);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateHealthUI(float curHealth, float maxHealth)
|
private void UpdateHealthUI(float curHealth, float maxHealth)
|
||||||
{
|
{
|
||||||
healthUI.UpdateBar(curHealth, maxHealth);
|
_healthUI.UpdateBar(curHealth, maxHealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartUpdatingProgressUI(CharacterState newState)
|
private void StartUpdatingProgressUI(CharacterState newState)
|
||||||
@ -170,9 +186,10 @@ public class PlayerUIController : MonoBehaviour
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StopUpdateAttackUI()
|
private void StopUpdateActionUI()
|
||||||
{
|
{
|
||||||
_attackUI.gameObject.SetActive(false);
|
_attackUI.gameObject.SetActive(false);
|
||||||
|
_superJumpUI.StopUpdateUI() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
86
Assets/Scripts/UI_SuperJump.cs
Normal file
86
Assets/Scripts/UI_SuperJump.cs
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class UI_SuperJump : MonoBehaviour
|
||||||
|
{
|
||||||
|
public float updateTime = 0.1f;
|
||||||
|
[SerializeField]
|
||||||
|
private Material capAllow, capForbid;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private List<GameObject> _allCapTargets = new List<GameObject>();
|
||||||
|
|
||||||
|
public List<GameObject> _actualTargets = new List<GameObject>();
|
||||||
|
|
||||||
|
public void UpdateUI(TileInfo target)
|
||||||
|
{
|
||||||
|
transform.LookAt(target.tilePosition);
|
||||||
|
_actualTargets = GetActiveCapTiles(GameData.playerLevel);
|
||||||
|
StartCoroutine(Checker(updateTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<GameObject> GetActiveCapTiles(int playerLevel)
|
||||||
|
{
|
||||||
|
List<GameObject> actualTargets = new List<GameObject>();
|
||||||
|
for (int i = 0; i <= playerLevel; i++)
|
||||||
|
{
|
||||||
|
GameObject curTargetTile = _allCapTargets[i];
|
||||||
|
curTargetTile.SetActive(true);
|
||||||
|
Debug.Log(curTargetTile.name);
|
||||||
|
actualTargets.Add(curTargetTile);
|
||||||
|
}
|
||||||
|
|
||||||
|
return actualTargets;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator Checker(float updateTime)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(updateTime);
|
||||||
|
CheckPlayerOnTiles(GameManager.activePlayers);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckPlayerOnTiles(List<PlayerState> activePlayers)
|
||||||
|
{
|
||||||
|
List<TileInfo> actualTiles = new List<TileInfo>();
|
||||||
|
foreach (var target in _actualTargets)
|
||||||
|
{
|
||||||
|
actualTiles.Add(TileManagment.GetTile(target.transform.position));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var player in activePlayers)
|
||||||
|
{
|
||||||
|
if (actualTiles.Contains(player.currentTile))
|
||||||
|
{
|
||||||
|
SetmaterialForObects(capForbid, _actualTargets);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
SetmaterialForObects(capAllow, _actualTargets);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetmaterialForObects(Material mat, List<GameObject> tiles)
|
||||||
|
{
|
||||||
|
foreach (GameObject tile in tiles)
|
||||||
|
{
|
||||||
|
tile.GetComponent<Renderer>().material = mat;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StopUpdateUI()
|
||||||
|
{
|
||||||
|
StopAllCoroutines();
|
||||||
|
if (_actualTargets == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foreach (var obj in _actualTargets)
|
||||||
|
{
|
||||||
|
obj.SetActive(false);
|
||||||
|
}
|
||||||
|
_actualTargets = null;
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/UI_SuperJump.cs.meta
Normal file
11
Assets/Scripts/UI_SuperJump.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: de98d1c294c49834c80c35c3bbfa741e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user