Commit 07acc0ce authored by 16도재형's avatar 16도재형

Merge branch 'enemy'

parents 94858f5a e7a1ad84
This diff is collapsed.
fileFormatVersion: 2
guid: c8563e7de963bcc4a90cafd485471e9b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
...@@ -29,7 +29,7 @@ AnimationClip: ...@@ -29,7 +29,7 @@ AnimationClip:
inWeight: 0 inWeight: 0
outWeight: 0 outWeight: 0
- serializedVersion: 3 - serializedVersion: 3
time: 0.41666666 time: 0.46666667
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -61,11 +61,11 @@ AnimationClip: ...@@ -61,11 +61,11 @@ AnimationClip:
value: {fileID: 21300000, guid: 37e5cfde8d3541845a184c4d6ab25e21, type: 3} value: {fileID: 21300000, guid: 37e5cfde8d3541845a184c4d6ab25e21, type: 3}
- time: 0.16666667 - time: 0.16666667
value: {fileID: 21300000, guid: 2806c6904b006114bad1fb3f64d64c14, type: 3} value: {fileID: 21300000, guid: 2806c6904b006114bad1fb3f64d64c14, type: 3}
- time: 0.41666666 - time: 0.46666667
value: {fileID: 21300000, guid: 6234b3bf70d0272478b444abdd572f09, type: 3} value: {fileID: 21300000, guid: 6234b3bf70d0272478b444abdd572f09, type: 3}
- time: 0.6 - time: 0.5833333
value: {fileID: 21300000, guid: f7d12f4a971df594c8d297610a3f9e57, type: 3} value: {fileID: 21300000, guid: f7d12f4a971df594c8d297610a3f9e57, type: 3}
- time: 0.6666667 - time: 1.25
value: {fileID: 21300000, guid: b2382ef0803ec1c4c811783916c7aa49, type: 3} value: {fileID: 21300000, guid: b2382ef0803ec1c4c811783916c7aa49, type: 3}
attribute: m_Sprite attribute: m_Sprite
path: path:
...@@ -104,7 +104,7 @@ AnimationClip: ...@@ -104,7 +104,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0 m_AdditiveReferencePoseTime: 0
m_StartTime: 0 m_StartTime: 0
m_StopTime: 0.68333334 m_StopTime: 1.2666667
m_OrientationOffsetY: 0 m_OrientationOffsetY: 0
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
...@@ -133,7 +133,7 @@ AnimationClip: ...@@ -133,7 +133,7 @@ AnimationClip:
inWeight: 0 inWeight: 0
outWeight: 0 outWeight: 0
- serializedVersion: 3 - serializedVersion: 3
time: 0.41666666 time: 0.46666667
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -163,7 +163,7 @@ AnimationClip: ...@@ -163,7 +163,7 @@ AnimationClip:
m_GenerateMotionCurves: 0 m_GenerateMotionCurves: 0
m_Events: m_Events:
- time: 0 - time: 0
functionName: ChangeVelocityX functionName: ChangeVelocityX_noOption
data: data:
objectReferenceParameter: {fileID: 0} objectReferenceParameter: {fileID: 0}
floatParameter: 0 floatParameter: 0
......
...@@ -109,7 +109,7 @@ AnimationClip: ...@@ -109,7 +109,7 @@ AnimationClip:
m_GenerateMotionCurves: 0 m_GenerateMotionCurves: 0
m_Events: m_Events:
- time: 0 - time: 0
functionName: ChangeVelocityX functionName: ChangeVelocityX_noOption
data: data:
objectReferenceParameter: {fileID: 0} objectReferenceParameter: {fileID: 0}
floatParameter: 0 floatParameter: 0
......
...@@ -5,7 +5,7 @@ AnimatorController: ...@@ -5,7 +5,7 @@ AnimatorController:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_Name: melee m_Name: GroundMelee
serializedVersion: 5 serializedVersion: 5
m_AnimatorParameters: m_AnimatorParameters:
- m_Name: TrackTrigger - m_Name: TrackTrigger
...@@ -146,6 +146,27 @@ AnimatorStateTransition: ...@@ -146,6 +146,27 @@ AnimatorStateTransition:
m_InterruptionSource: 0 m_InterruptionSource: 0
m_OrderedInterruption: 1 m_OrderedInterruption: 1
m_CanTransitionToSelf: 1 m_CanTransitionToSelf: 1
--- !u!1101 &1101325659652078070
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102455672269219010}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.516129
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101374430603555350 --- !u!1101 &1101374430603555350
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
...@@ -287,6 +308,27 @@ AnimatorStateTransition: ...@@ -287,6 +308,27 @@ AnimatorStateTransition:
m_InterruptionSource: 0 m_InterruptionSource: 0
m_OrderedInterruption: 1 m_OrderedInterruption: 1
m_CanTransitionToSelf: 1 m_CanTransitionToSelf: 1
--- !u!1101 &1101891476493562990
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102455672269219010}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.516129
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102078500202870446 --- !u!1102 &1102078500202870446
AnimatorState: AnimatorState:
serializedVersion: 5 serializedVersion: 5
......
fileFormatVersion: 2
guid: 3277ff2aa5f84f945815b90b5dc1295c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Spider Dead
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
- time: 0.16666667
value: {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
- time: 0.33333334
value: {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
- {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
- {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.35000002
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events:
- time: 0
functionName: ChangeVelocityXY_zero
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
- time: 0.33333334
functionName: DeadEvent
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
fileFormatVersion: 2
guid: a18ed8217cce17348a342f01a47efb4f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Spider Idle
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.016666668
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
fileFormatVersion: 2
guid: e38ac228fc296204b80018c3350e6b3d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
스테이지,ID,이름,드랍하지 않음,생명석 1개,생명석 2개,생명석 3개,생명석 4개,생명석 5개,금 포션,자수정 포션,습작 아이템,범작,수작,걸작 아이템,습작 애드온,범작,수작,걸작 애드온 스테이지,ID,이름,드랍하지 않음,생명석 1개,생명석 2개,생명석 3개,생명석 4개,생명석 5개,금 포션,자수정 포션,습작 아이템,범작,수작,걸작 아이템,습작 애드온,범작,수작,걸작 애드온
고대유적,,,,,,,,,,,,,,,,,, 고대유적,,,,,,,,,,,,,,,,,,
고대유적,42,전갈,7,4,1,0,0,0,0,0,2,0,0,0,2,1,0,0
고대유적,101,고블린,7,4,1,0,0,0,0,0,2,0,0,0,2,1,0,0 고대유적,101,고블린,7,4,1,0,0,0,0,0,2,0,0,0,2,1,0,0
고대유적,102,고블린 보초병,4,3,0,0,0,0,0,0,0,0,0,0,1,0,0,0 고대유적,102,고블린 보초병,4,3,0,0,0,0,0,0,0,0,0,0,1,0,0,0
고대유적,103,날쌘 고블린,3,5,1,0,0,0,0,0,2,0,0,0,2,1,0,0 고대유적,103,날쌘 고블린,3,5,1,0,0,0,0,0,2,0,0,0,2,1,0,0
...@@ -17,7 +16,7 @@ ...@@ -17,7 +16,7 @@
고대유적,1230,새끼 박쥐,5,4,0,0,0,0,0,0,1,0,0,0,2,0,0,0 고대유적,1230,새끼 박쥐,5,4,0,0,0,0,0,0,1,0,0,0,2,0,0,0
고대유적,115,엘리게이터-1,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0 고대유적,115,엘리게이터-1,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0
고대유적,116,엘리게이터-2,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0 고대유적,116,엘리게이터-2,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0
고대유적,117,테스트용데이터,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0 고대유적,42,테스트거미,7,4,1,0,0,0,0,0,2,0,0,0,2,1,0,0
고대유적,,,,,,,,,,,,,,,,,, 고대유적,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyPhysics : MonoBehaviour {
}
...@@ -61,7 +61,7 @@ GameObject: ...@@ -61,7 +61,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!1 &1734061800721222 --- !u!1 &1734061800721222
GameObject: GameObject:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
...@@ -286,7 +286,7 @@ MonoBehaviour: ...@@ -286,7 +286,7 @@ MonoBehaviour:
m_GameObject: {fileID: 1225288737757304} m_GameObject: {fileID: 1225288737757304}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2d73d07fdab522c4aa045e1cb6a92e8c, type: 3} m_Script: {fileID: 11500000, guid: a11d071a77ab21c48882c6c6e4db8f17, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
monsterID: 101 monsterID: 101
...@@ -294,11 +294,11 @@ MonoBehaviour: ...@@ -294,11 +294,11 @@ MonoBehaviour:
weight: 15 weight: 15
patrolRange: 3 patrolRange: 3
noticeRange: 2 noticeRange: 2
attackRange: 1.2
patrolSpeed: 1 patrolSpeed: 1
trackSpeed: 2.5 trackSpeed: 2.5
knockbackPercentage: knockbackPercentage:
- 0.5 - 0.5
attackRange: 1.2
--- !u!114 &114173716467154830 --- !u!114 &114173716467154830
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
...@@ -323,6 +323,7 @@ MonoBehaviour: ...@@ -323,6 +323,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
damage: 4 damage: 4
damageOnce: 1
--- !u!114 &114851997656688694 --- !u!114 &114851997656688694
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
...@@ -373,7 +374,7 @@ SpriteRenderer: ...@@ -373,7 +374,7 @@ SpriteRenderer:
m_AutoUVMaxAngle: 89 m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -2078941185 m_SortingLayerID: -2078941185
m_SortingLayer: 6 m_SortingLayer: 7
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 71335108d30aa0e4a90179a09895440e, type: 3} m_Sprite: {fileID: 21300000, guid: 71335108d30aa0e4a90179a09895440e, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
......
...@@ -19,25 +19,56 @@ GameObject: ...@@ -19,25 +19,56 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 4804976410232030} - component: {fileID: 4804976410232030}
- component: {fileID: 212906216626823524} - component: {fileID: 50573848117970958}
- component: {fileID: 50615514765813310}
- component: {fileID: 61188111102399610} - component: {fileID: 61188111102399610}
- component: {fileID: 95600343560029758} m_Layer: 16
- component: {fileID: 114425347246421446} m_Name: Spider
m_Layer: 0
m_Name: DummyScorpion
m_TagString: Enemy m_TagString: Enemy
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &1822069857481414
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 4205286087293746}
- component: {fileID: 114337624805266014}
m_Layer: 0
m_Name: HPBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!1 &1923610854882692 --- !u!1 &1860030746010208
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 4001151502382822}
- component: {fileID: 212993065858080250}
- component: {fileID: 95156341909549574}
- component: {fileID: 114803474034076246}
m_Layer: 0
m_Name: Body
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1923610854882692
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 4370838883948786} - component: {fileID: 4370838883948786}
- component: {fileID: 61019308264186112} - component: {fileID: 61019308264186112}
- component: {fileID: 114106922099255344} - component: {fileID: 114106922099255344}
...@@ -48,17 +79,44 @@ GameObject: ...@@ -48,17 +79,44 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!4 &4001151502382822
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1860030746010208}
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: 4370838883948786}
m_Father: {fileID: 4804976410232030}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4205286087293746
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1822069857481414}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 4804976410232030}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4370838883948786 --- !u!4 &4370838883948786
Transform: Transform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1923610854882692} m_GameObject: {fileID: 1923610854882692}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 4804976410232030} m_Father: {fileID: 4001151502382822}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4804976410232030 --- !u!4 &4804976410232030
...@@ -68,21 +126,22 @@ Transform: ...@@ -68,21 +126,22 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1346522711063220} m_GameObject: {fileID: 1346522711063220}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.2689643, y: 1.8663561, z: 0} m_LocalPosition: {x: 5, y: 1, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 1} m_LocalScale: {x: 0.5, y: 0.5, z: 1}
m_Children: m_Children:
- {fileID: 4370838883948786} - {fileID: 4001151502382822}
- {fileID: 4205286087293746}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &50615514765813310 --- !u!50 &50573848117970958
Rigidbody2D: Rigidbody2D:
serializedVersion: 4 serializedVersion: 4
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1346522711063220} m_GameObject: {fileID: 1346522711063220}
m_BodyType: 0 m_BodyType: 1
m_Simulated: 1 m_Simulated: 1
m_UseFullKinematicContacts: 0 m_UseFullKinematicContacts: 0
m_UseAutoMass: 0 m_UseAutoMass: 0
...@@ -94,31 +153,31 @@ Rigidbody2D: ...@@ -94,31 +153,31 @@ Rigidbody2D:
m_Interpolate: 0 m_Interpolate: 0
m_SleepingMode: 1 m_SleepingMode: 1
m_CollisionDetection: 0 m_CollisionDetection: 0
m_Constraints: 4 m_Constraints: 3
--- !u!61 &61019308264186112 --- !u!61 &61019308264186112
BoxCollider2D: BoxCollider2D:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1923610854882692} m_GameObject: {fileID: 1923610854882692}
m_Enabled: 0 m_Enabled: 1
m_Density: 1 m_Density: 1
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 1 m_IsTrigger: 1
m_UsedByEffector: 0 m_UsedByEffector: 0
m_UsedByComposite: 0 m_UsedByComposite: 0
m_Offset: {x: -2.21024, y: 0.47439384} m_Offset: {x: -0.00001335144, y: 0.00009530783}
m_SpriteTilingProperty: m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0} pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0, y: 0} oldSize: {x: 6.64, y: 5.48}
newSize: {x: 0, y: 0} newSize: {x: 6.64, y: 5.48}
adaptiveTilingThreshold: 0 adaptiveTilingThreshold: 0.5
drawMode: 0 drawMode: 0
adaptiveTiling: 0 adaptiveTiling: 0
m_AutoTiling: 0 m_AutoTiling: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 5.42048, y: 3.3288422} m_Size: {x: 1.2499847, y: 1.250398}
m_EdgeRadius: 0 m_EdgeRadius: 0
--- !u!61 &61188111102399610 --- !u!61 &61188111102399610
BoxCollider2D: BoxCollider2D:
...@@ -128,11 +187,11 @@ BoxCollider2D: ...@@ -128,11 +187,11 @@ BoxCollider2D:
m_GameObject: {fileID: 1346522711063220} m_GameObject: {fileID: 1346522711063220}
m_Enabled: 1 m_Enabled: 1
m_Density: 1 m_Density: 1
m_Material: {fileID: 0} m_Material: {fileID: 6200000, guid: 90e689a435f304c469db49daef28ed89, type: 2}
m_IsTrigger: 0 m_IsTrigger: 0
m_UsedByEffector: 0 m_UsedByEffector: 0
m_UsedByComposite: 0 m_UsedByComposite: 0
m_Offset: {x: 0, y: 0} m_Offset: {x: 0.004562378, y: 0}
m_SpriteTilingProperty: m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5} pivot: {x: 0.5, y: 0.5}
...@@ -143,18 +202,18 @@ BoxCollider2D: ...@@ -143,18 +202,18 @@ BoxCollider2D:
adaptiveTiling: 0 adaptiveTiling: 0
m_AutoTiling: 0 m_AutoTiling: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 6.64, y: 5.48} m_Size: {x: 1.250679, y: 1.2505887}
m_EdgeRadius: 0 m_EdgeRadius: 0
--- !u!95 &95600343560029758 --- !u!95 &95156341909549574
Animator: Animator:
serializedVersion: 3 serializedVersion: 3
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1346522711063220} m_GameObject: {fileID: 1860030746010208}
m_Enabled: 1 m_Enabled: 1
m_Avatar: {fileID: 0} m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: a2991abac35f9ff4b933c50e1d598f38, type: 2} m_Controller: {fileID: 9100000, guid: c8563e7de963bcc4a90cafd485471e9b, type: 2}
m_CullingMode: 0 m_CullingMode: 0
m_UpdateMode: 0 m_UpdateMode: 0
m_ApplyRootMotion: 0 m_ApplyRootMotion: 0
...@@ -175,33 +234,51 @@ MonoBehaviour: ...@@ -175,33 +234,51 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
damage: 0 damage: 0
--- !u!114 &114425347246421446 isBumpAttack: 1
--- !u!114 &114337624805266014
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1346522711063220} m_GameObject: {fileID: 1822069857481414}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 493db5529c03fce44a56a2211507667e, type: 3}
m_Name:
m_EditorClassIdentifier:
width: 0.4
height: 0.1
yOffset: 1.3
barPrefab: {fileID: 1489501648010076, guid: bd708b07601179842bbd803b54afda40, type: 2}
bor: {fileID: 21300000, guid: f978754916ff69444aa0bd613b44f2c5, type: 3}
red: {fileID: 21300000, guid: 014c5204ddcb6e54e86aadaa34227552, type: 3}
--- !u!114 &114803474034076246
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1860030746010208}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2d73d07fdab522c4aa045e1cb6a92e8c, type: 3} m_Script: {fileID: 11500000, guid: 7ce0adb34b612484eb45a52b7a457aba, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
monsterID: 42 monsterID: 42
maxHealth: 0 maxHealth: 10
weight: 0 weight: 10
patrolRange: 0 patrolRange: 3
noticeRange: 0 noticeRange: 2
attackRange: 0 patrolSpeed: 1
patrolSpeed: 0 trackSpeed: 1.5
trackSpeed: 0 knockbackPercentage:
attackDelay: 0 - 0.5
attackDuration: 0 MovementLock: 0
--- !u!212 &212906216626823524 --- !u!212 &212993065858080250
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1346522711063220} m_GameObject: {fileID: 1860030746010208}
m_Enabled: 1 m_Enabled: 1
m_CastShadows: 0 m_CastShadows: 0
m_ReceiveShadows: 0 m_ReceiveShadows: 0
...@@ -228,17 +305,17 @@ SpriteRenderer: ...@@ -228,17 +305,17 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5 m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89 m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: -2078941185
m_SortingLayer: 0 m_SortingLayer: 7
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 9588a72c7c886de4a999bf6cc7948b84, type: 3} m_Sprite: {fileID: 21300000, guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
m_DrawMode: 0 m_DrawMode: 0
m_Size: {x: 6.64, y: 5.48} m_Size: {x: 1.25, y: 1.25}
m_AdaptiveModeThreshold: 0.5 m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0 m_SpriteTileMode: 0
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0 m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 1
...@@ -51,24 +51,9 @@ MonoBehaviour: ...@@ -51,24 +51,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fc7c7899a8a94c24cb9eb34d432133ce, type: 3} m_Script: {fileID: 11500000, guid: fc7c7899a8a94c24cb9eb34d432133ce, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
player: {fileID: 1623439448163086, guid: 3d077a5f727dd1e4780e9265ed26e036, type: 2}
dropTableData: {fileID: 4900000, guid: 6216895c658a2af40890a4446cc10a8c, type: 3} dropTableData: {fileID: 4900000, guid: 6216895c658a2af40890a4446cc10a8c, type: 3}
dropItemList:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
enemyPrefab: enemyPrefab:
- {fileID: 1636491341446076, guid: a164c147037e89448820f7387c724c42, type: 2} - {fileID: 1636491341446076, guid: a164c147037e89448820f7387c724c42, type: 2}
- {fileID: 1346522711063220, guid: e4298313f9e94c44fb057542ec7ad273, type: 2}
EnemySpawnCount: 0
EnemyDeadCount: 0
...@@ -72,7 +72,6 @@ GameObject: ...@@ -72,7 +72,6 @@ GameObject:
- component: {fileID: 224196055372618916} - component: {fileID: 224196055372618916}
- component: {fileID: 222335990524814540} - component: {fileID: 222335990524814540}
- component: {fileID: 114900435719581162} - component: {fileID: 114900435719581162}
- component: {fileID: 114583230027247736}
m_Layer: 5 m_Layer: 5
m_Name: AddonPrefab m_Name: AddonPrefab
m_TagString: Untagged m_TagString: Untagged
...@@ -257,18 +256,6 @@ MonoBehaviour: ...@@ -257,18 +256,6 @@ MonoBehaviour:
m_VerticalOverflow: 0 m_VerticalOverflow: 0
m_LineSpacing: 1 m_LineSpacing: 1
m_Text: m_Text:
--- !u!114 &114583230027247736
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1379401480617648}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a124b15eafc6d1847979588fabbb0756, type: 3}
m_Name:
m_EditorClassIdentifier:
num: 0
--- !u!114 &114896825415534854 --- !u!114 &114896825415534854
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
......
...@@ -3520,7 +3520,7 @@ Canvas: ...@@ -3520,7 +3520,7 @@ Canvas:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1560605499280558} m_GameObject: {fileID: 1560605499280558}
m_Enabled: 1 m_Enabled: 0
serializedVersion: 3 serializedVersion: 3
m_RenderMode: 0 m_RenderMode: 0
m_Camera: {fileID: 0} m_Camera: {fileID: 0}
......
...@@ -51,6 +51,7 @@ MonoBehaviour: ...@@ -51,6 +51,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 674793b622d7c184882dfeb8784bbf92, type: 3} m_Script: {fileID: 11500000, guid: 674793b622d7c184882dfeb8784bbf92, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
ui: {fileID: 0}
droppedPrefab: {fileID: 1610049888013262, guid: ee63f05b79e18ce4bad2c226aa70a28e, droppedPrefab: {fileID: 1610049888013262, guid: ee63f05b79e18ce4bad2c226aa70a28e,
type: 2} type: 2}
popoutStrengthMultiplier: 9 popoutStrengthMultiplier: 9
......
...@@ -270,6 +270,12 @@ Canvas: ...@@ -270,6 +270,12 @@ Canvas:
m_CorrespondingSourceObject: {fileID: 223008133952041092, guid: 7c6db9a9ca4150a438bd5114c58a37cf, m_CorrespondingSourceObject: {fileID: 223008133952041092, guid: 7c6db9a9ca4150a438bd5114c58a37cf,
type: 2} type: 2}
m_PrefabInternal: {fileID: 1337079440} m_PrefabInternal: {fileID: 1337079440}
--- !u!114 &176479829 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 114905380279556738, guid: 7c6db9a9ca4150a438bd5114c58a37cf,
type: 2}
m_PrefabInternal: {fileID: 1337079440}
m_Script: {fileID: 11500000, guid: ed26045beb617f3498e0f3730175181b, type: 3}
--- !u!1001 &179350392 --- !u!1001 &179350392
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -1533,6 +1539,11 @@ Prefab: ...@@ -1533,6 +1539,11 @@ Prefab:
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 10 value: 10
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 114939219159237616, guid: 62a83d11a7addc342ad436145784e698,
type: 2}
propertyPath: ui
value:
objectReference: {fileID: 176479829}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 62a83d11a7addc342ad436145784e698, type: 2} m_SourcePrefab: {fileID: 100100000, guid: 62a83d11a7addc342ad436145784e698, type: 2}
m_IsPrefabAsset: 0 m_IsPrefabAsset: 0
......
This source diff could not be displayed because it is too large. You can view the blob instead.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyAirIdle : StateMachineBehaviour {
float patrolRange;
float patrolSpeed;
float noticeRange;
Vector2 origin;
Transform animatorRoot;
EnemyAir enemy;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
origin = animator.transform.position;
animatorRoot = animator.transform.parent;
enemy = animator.GetComponent<EnemyAir>();
patrolRange = enemy.patrolRange;
noticeRange = enemy.noticeRange;
patrolSpeed = enemy.patrolSpeed;
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
if (enemy.PlayerDistance < noticeRange)
{
animator.ResetTrigger("IdleTrigger");
animator.SetTrigger("TrackTrigger");
return;
}
}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
//override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
//override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateIK is called right after Animator.OnAnimatorIK(). Code that sets up animation IK (inverse kinematics) should be implemented here.
//override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: 026903d6f2ef73c4b8c30d71a7b40081 guid: 11413b136ebb3b54d9ad632cc4ef4d60
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyAirTrack : StateMachineBehaviour {
float trackSpeed;
float trackRange;
float angle;
GameObject player;
Transform animatorRoot;
EnemyAir enemy;
Vector2 direction;
int maxFrame = 10;
int frameCount;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
animatorRoot = animator.transform.parent;
enemy = animator.GetComponent<EnemyAir>();
player = EnemyManager.Instance.Player;
trackSpeed = enemy.trackSpeed;
frameCount = 0;
SetDirection();
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
if (enemy.PlayerDistance > enemy.noticeRange)
{
animator.ResetTrigger("TrackTrigger");
animator.SetTrigger("IdleTrigger");
enemy.ChangeVelocityXY_noOption(Vector2.zero);
return;
}
SetDirection();
Vector2 vel = direction.normalized * trackSpeed;
enemy.ChangeVelocityXY_noOption(vel);
}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
//override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
//override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateIK is called right after Animator.OnAnimatorIK(). Code that sets up animation IK (inverse kinematics) should be implemented here.
//override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
private void SetDirection()
{
direction = player.transform.position - animatorRoot.position;
angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
enemy.ChangeAngleZ_noOption(angle - 90.0f);
}
}
fileFormatVersion: 2
guid: b24234f0901ca8344922d2c140a48dd2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -8,25 +8,25 @@ public class EnemyMeleeIdle : StateMachineBehaviour { ...@@ -8,25 +8,25 @@ public class EnemyMeleeIdle : StateMachineBehaviour {
float noticeRange; float noticeRange;
Vector2 origin; Vector2 origin;
Transform animatorRoot; Transform animatorRoot;
Enemy enemy; EnemyGround enemy;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
origin = animator.transform.position; origin = animator.transform.position;
animatorRoot = animator.transform.parent; animatorRoot = animator.transform.parent;
enemy = animator.GetComponent<Enemy>(); enemy = animator.GetComponent<EnemyGround>();
patrolRange = enemy.patrolRange; patrolRange = enemy.patrolRange;
noticeRange = enemy.noticeRange; noticeRange = enemy.noticeRange;
patrolSpeed = enemy.patrolSpeed; patrolSpeed = enemy.patrolSpeed;
enemy.ChangeDir(NumeratedDir.Left); enemy.ChangeDir_noOption(NumeratedDir.Left);
enemy.ChangeVelocityX(enemy.MoveDir * patrolSpeed); enemy.ChangeVelocityX_noOption(enemy.MoveDir * patrolSpeed);
} }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
if (enemy.PlayerDistance < noticeRange) if (enemy.PlayerDistance < noticeRange)
{ {
animator.SetTrigger("TrackTrigger"); animator.SetTrigger("TrackTrigger");
return; return;
...@@ -40,8 +40,8 @@ public class EnemyMeleeIdle : StateMachineBehaviour { ...@@ -40,8 +40,8 @@ public class EnemyMeleeIdle : StateMachineBehaviour {
enemy.CliffTest[(enemy.MoveDir + 1) / 2] enemy.CliffTest[(enemy.MoveDir + 1) / 2]
) )
{ {
enemy.ChangeDir(enemy.MoveDir * -1); enemy.ChangeDir_noOption(enemy.MoveDir * -1);
enemy.ChangeVelocityX(enemy.MoveDir * patrolSpeed); enemy.ChangeVelocityX_noOption(enemy.MoveDir * patrolSpeed);
} }
} }
} }
......
...@@ -7,7 +7,7 @@ public class EnemyMeleeTrack : StateMachineBehaviour { ...@@ -7,7 +7,7 @@ public class EnemyMeleeTrack : StateMachineBehaviour {
float attackRange; float attackRange;
GameObject player; GameObject player;
Transform animatorRoot; Transform animatorRoot;
Enemy enemy; EnemyGround enemy;
readonly int maxFrame = 10; readonly int maxFrame = 10;
int frameCounter = 0; int frameCounter = 0;
...@@ -15,21 +15,21 @@ public class EnemyMeleeTrack : StateMachineBehaviour { ...@@ -15,21 +15,21 @@ public class EnemyMeleeTrack : StateMachineBehaviour {
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
animatorRoot = animator.transform.parent; animatorRoot = animator.transform.parent;
enemy = animator.GetComponent<Enemy>(); enemy = animator.GetComponent<EnemyGround>();
player = EnemyManager.Instance.Player; player = EnemyManager.Instance.Player;
trackSpeed = enemy.trackSpeed; trackSpeed = enemy.trackSpeed;
attackRange = enemy.attackRange; attackRange = enemy.attackRange;
NumeratedDir trackDir = (animatorRoot.position.x - player.transform.position.x > 0) ? NumeratedDir.Left : NumeratedDir.Right; NumeratedDir trackDir = (animatorRoot.position.x - player.transform.position.x > 0) ? NumeratedDir.Left : NumeratedDir.Right;
enemy.ChangeDir(trackDir); enemy.ChangeDir_noOption(trackDir);
if (enemy.CliffTest[(enemy.MoveDir + 1) / 2] || animator.GetComponent<Enemy>().PlayerDistance < attackRange) if (enemy.CliffTest[(enemy.MoveDir + 1) / 2] || animator.GetComponent<Enemy>().PlayerDistance < attackRange)
{ {
enemy.ChangeVelocityX(0.0f); enemy.ChangeVelocityX_noOption(0.0f);
} }
else else
{ {
enemy.ChangeVelocityX(enemy.MoveDir * trackSpeed); enemy.ChangeVelocityX_noOption(enemy.MoveDir * trackSpeed);
} }
} }
...@@ -43,18 +43,18 @@ public class EnemyMeleeTrack : StateMachineBehaviour { ...@@ -43,18 +43,18 @@ public class EnemyMeleeTrack : StateMachineBehaviour {
int integerDir = enemy.MoveDir; int integerDir = enemy.MoveDir;
if (enemy.WallTest[(integerDir + 1) / 2] || enemy.CliffTest[(integerDir + 1) / 2]) if (enemy.WallTest[(integerDir + 1) / 2] || enemy.CliffTest[(integerDir + 1) / 2])
{ {
enemy.ChangeVelocityX(0.0f); enemy.ChangeVelocityX_noOption(0.0f);
} }
else else
{ {
enemy.ChangeVelocityX(enemy.MoveDir * trackSpeed); enemy.ChangeVelocityX_noOption(enemy.MoveDir * trackSpeed);
} }
frameCounter += 1; frameCounter += 1;
if (frameCounter >= maxFrame) if (frameCounter >= maxFrame)
{ {
NumeratedDir trackDir = (animatorRoot.position.x - player.transform.position.x > 0) ? NumeratedDir.Left : NumeratedDir.Right; NumeratedDir trackDir = (animatorRoot.position.x - player.transform.position.x > 0) ? NumeratedDir.Left : NumeratedDir.Right;
enemy.ChangeDir(trackDir); enemy.ChangeDir_noOption(trackDir);
frameCounter = 0; frameCounter = 0;
} }
} }
......
...@@ -4,13 +4,33 @@ using UnityEngine; ...@@ -4,13 +4,33 @@ using UnityEngine;
public class DamageToPlayer : MonoBehaviour { public class DamageToPlayer : MonoBehaviour {
public int damage; public int damage;
public bool isBumpAttack;
// enum debuff // enum debuff
private void OnTriggerEnter2D(Collider2D collision) private void OnTriggerEnter2D(Collider2D collision)
{ {
if (collision.CompareTag("Player")) if (collision.CompareTag("Player") && !isBumpAttack)
{ {
EnemyAttackInfo attack = new EnemyAttackInfo(damage, 1f, 0, null, null); EnemyAttackInfo attack = new EnemyAttackInfo(damage, 1f, 0, null, null);
collision.gameObject.GetComponent<PlayerAttack>().TakeDamage(attack); collision.gameObject.GetComponent<PlayerAttack>().TakeDamage(attack);
} }
} }
private void OnTriggerStay2D(Collider2D collision)
{
if (collision.CompareTag("Player") && isBumpAttack && transform.parent.gameObject.GetComponent<Enemy>().bumpable)
{
EnemyAttackInfo attack = new EnemyAttackInfo(damage, 1f, 0, null, null);
collision.gameObject.GetComponent<PlayerAttack>().TakeDamage(attack);
transform.parent.gameObject.GetComponent<EnemyAir>().bumped = true;
transform.parent.gameObject.GetComponent<EnemyAir>().bumpable = false;
}
}
private void OnTriggerExit2D(Collider2D collision)
{
if (collision.CompareTag("Player") && isBumpAttack)
{
transform.parent.gameObject.GetComponent<Enemy>().bumped = false;
}
}
} }
This diff is collapsed.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyAir : Enemy {
protected override void Start()
{
base.Start();
StartCoroutine(BumpCheck());
}
protected override void FixedUpdate()
{
base.FixedUpdate();
if (bumpable)
{
MovementLock = false;
}
else
{
ChangeVelocityXY_zero();
MovementLock = true;
}
}
public void ChangeAngleZ_noOption(float val)
{
ChangeAngleZ(val, new bool[] { MovementLock, KnockbackLock });
}
public void ChangeVelocityXY_zero() // 망할 유니티 애니메이션 이벤트 Vec2를 parameter로 받는 함수를 못집어넣음
{
ChangeVelocityXY(Vector2.zero, new bool[] { MovementLock, KnockbackLock });
}
public void ChangeVelocityXY_noOption(Vector2 val)
{
ChangeVelocityXY(val, new bool[] { MovementLock, KnockbackLock });
}
private void ChangeAngleZ(float val, bool[] lockArray)
{
foreach (var Lock in lockArray) { if (Lock) return; }
Vector3 tempAngle = transform.parent.eulerAngles;
tempAngle.z = val;
transform.parent.eulerAngles = tempAngle;
}
private void ChangeVelocityXY(Vector2 val, bool[] lockArray)
{
foreach (var Lock in lockArray) { if (Lock) return; }
Vector3 tempVelocity = transform.parent.gameObject.GetComponent<Rigidbody2D>().velocity;
tempVelocity.x = val.x;
tempVelocity.y = val.y;
transform.parent.gameObject.GetComponent<Rigidbody2D>().velocity = tempVelocity;
}
protected override IEnumerator OnIce(float duration)
{
ChangeVelocityXY(Vector2.zero, new bool[] { });
KnockbackLock = true;
animator.SetTrigger("StunnedTrigger");
animator.speed = stunnedAnimLength / duration;
yield return new WaitForSeconds(duration);
OffDebuff(EnemyDebuffCase.Ice);
}
protected override IEnumerator OnStun(float duration)
{
ChangeVelocityXY(Vector2.zero, new bool[] { });
animator.SetTrigger("StunnedTrigger");
animator.speed = stunnedAnimLength / duration;
yield return new WaitForSeconds(duration);
OffDebuff(EnemyDebuffCase.Stun);
yield return null;
}
// - Knockback coroutine
protected override IEnumerator Knockback(float knockbackDist, float knockbackTime)
{
MovementLock = true;
bool[] lockArray = new bool[] { false, KnockbackLock };
Vector2 knockbackDir = (transform.parent.position - enemyManager.Player.transform.position).normalized;
Vector2 knockbackVelocity = (knockbackDist / knockbackTime) * knockbackDir;
ChangeAngleZ(Mathf.Atan2(knockbackDir.y, knockbackDir.x) * -1, new bool[] { MovementLock, KnockbackLock });
ChangeVelocityXY(knockbackVelocity, lockArray);
yield return new WaitForSeconds(knockbackTime);
MovementLock = false;
ChangeVelocityXY(Vector2.zero, new bool[] { MovementLock, KnockbackLock });
}
IEnumerator BumpCheck()
{
while (true)
{
if (!bumpable) { bumpable = true; }
yield return new WaitForSeconds(1.0f);
}
}
}
fileFormatVersion: 2
guid: 7ce0adb34b612484eb45a52b7a457aba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class EnemyGround : Enemy {
public float attackRange;
public int MoveDir { get; private set; }
public bool[] WallTest { get; private set; }
public bool[] CliffTest { get; private set; }
protected override void Awake()
{
base.Awake();
WallTest = new bool[] { false, false };
CliffTest = new bool[] { false, false };
}
protected override void Start()
{
base.Start();
MoveDir = (int)NumeratedDir.Left;
}
protected override void FixedUpdate()
{
base.FixedUpdate();
CheckCliff(); CheckWall();
}
// Movement & Physics
// - Check whether enemy is near to cliff
private void CheckCliff()
{
Vector2 velocity = transform.parent.GetComponent<Rigidbody2D>().velocity;
Vector2 colliderSize = transform.parent.GetComponent<BoxCollider2D>().size;
foreach (int Dir in Enum.GetValues(typeof(NumeratedDir)))
{
Vector2 origin = (Vector2)transform.parent.position + Dir * new Vector2(colliderSize.x / 2.0f, 0);
Vector2 direction = Vector2.down;
float distance = colliderSize.y / 4.0f;
int layerMask = LayerMask.NameToLayer("platform");
RaycastHit2D hit = Physics2D.Raycast(origin, direction, distance, layerMask);
CliffTest[(Dir + 1) / 2] = (hit.collider == null);
}
}
// - Check whether enemy is touching wall
private void CheckWall()
{
Vector2 colliderSize = transform.parent.GetComponent<BoxCollider2D>().size;
foreach (int Dir in Enum.GetValues(typeof(NumeratedDir)))
{
Vector2 origin = (Vector2)transform.parent.position + new Vector2(Dir * colliderSize.x / 2.0f, colliderSize.y);
Vector2 direction = Vector2.right * Dir;
float distance = 0.5f;
LayerMask layerMask = LayerMask.GetMask("Wall", "OuterWall");
RaycastHit2D hit = Physics2D.Raycast(origin, direction, distance, layerMask);
WallTest[(Dir + 1) / 2] = (hit.collider != null);
}
}
// - Change direction, and speed of rigidbody of enemy
public void ChangeVelocityX_noOption(float val)
{
ChangeVelocityX(val, new bool[] { MovementLock, KnockbackLock });
}
public void ChangeDir_noOption(object dir)
{
ChangeDir(dir, new bool[] { MovementLock, KnockbackLock });
}
private void ChangeVelocityX(float val, bool[] lockArray)
{
foreach (var Lock in lockArray) { if (Lock) return; }
Vector2 tempVelocity = transform.parent.GetComponent<Rigidbody2D>().velocity;
tempVelocity.x = val;
transform.parent.GetComponent<Rigidbody2D>().velocity = tempVelocity;
}
private void ChangeDir(object dir, bool[] lockArray)
{
foreach (var Lock in lockArray) { if (Lock) return; }
MoveDir = (int)dir;
transform.parent.eulerAngles = ((NumeratedDir)dir == NumeratedDir.Left) ? new Vector2(0, 0) : new Vector2(0, 180);
}
// - Knockback coroutine
protected override IEnumerator Knockback(float knockbackDist, float knockbackTime)
{
MovementLock = true;
bool[] lockArray = new bool[] { false, KnockbackLock };
int knockbackDir = (enemyManager.Player.transform.position.x - transform.parent.position.x >= 0) ? -1 : 1;
float knockbackVelocity = knockbackDir * knockbackDist / knockbackTime;
ChangeDir(knockbackDir * -1, new bool[] { MovementLock, KnockbackLock });
ChangeVelocityX(knockbackVelocity, lockArray);
for (float timer = 0; timer <= knockbackTime; timer += Time.deltaTime)
{
if (CliffTest[(knockbackDir + 1) / 2])
{
ChangeVelocityX(0.0f, lockArray);
yield return new WaitForSeconds(knockbackTime - timer);
break;
}
yield return new WaitForFixedUpdate();
}
MovementLock = false;
ChangeVelocityX(0.0f, new bool[] { MovementLock, KnockbackLock });
}
protected override IEnumerator OnIce(float duration)
{
ChangeVelocityX(0.0f, new bool[] { });
KnockbackLock = true;
animator.SetTrigger("StunnedTrigger");
animator.speed = stunnedAnimLength / duration;
yield return new WaitForSeconds(duration);
OffDebuff(EnemyDebuffCase.Ice);
}
protected override IEnumerator OnStun(float duration)
{
ChangeVelocityX(0.0f, new bool[] { });
animator.SetTrigger("StunnedTrigger");
animator.speed = stunnedAnimLength / duration;
yield return new WaitForSeconds(duration);
OffDebuff(EnemyDebuffCase.Stun);
yield return null;
}
}
fileFormatVersion: 2
guid: a11d071a77ab21c48882c6c6e4db8f17
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -63,6 +63,24 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -63,6 +63,24 @@ public class EnemyManager : Singleton<EnemyManager>
} }
} }
// Spawn Enemy to Map
public void SpawnEnemyToMap_forTest()
{
EnemySpawnCount = EnemyDeadCount = 0;
Transform enemySpots = GameObject.Find("Grid").transform.GetChild(0).GetChild(0).Find("enemy spot");
foreach (Transform enemySpot in enemySpots)
{
if (!enemySpot.gameObject.activeSelf) continue;
GameObject enemy = enemySpot.gameObject.GetComponent<enemySpot>().enemyPrefab;
foreach (Transform location in enemySpot)
{
GameObject clone = PickFromPool(enemy);
clone.transform.position = location.position;
clone.transform.SetParent(MapManager.currentRoom.roomInGame.transform);
}
}
}
public bool IsClear() public bool IsClear()
{ {
return (EnemyDeadCount == EnemySpawnCount); return (EnemyDeadCount == EnemySpawnCount);
......
...@@ -90,6 +90,7 @@ public class GameManager : Singleton<GameManager> { ...@@ -90,6 +90,7 @@ public class GameManager : Singleton<GameManager> {
else if(gameState == GameState.Inventory) else if(gameState == GameState.Inventory)
{ {
inventoryCanvas.gameObject.SetActive(false); inventoryCanvas.gameObject.SetActive(false);
InventoryManager.Instance.SetOnPosition();
gameState = GameState.Ingame; gameState = GameState.Ingame;
} }
} }
......
...@@ -70,6 +70,7 @@ public class AddonDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDra ...@@ -70,6 +70,7 @@ public class AddonDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDra
{ {
if (eventData.button == PointerEventData.InputButton.Right) if (eventData.button == PointerEventData.InputButton.Right)
{ {
ui.SetAddonInfo();
if (num < 9) if (num < 9)
{ {
int type = (int)manager.addonList[num].type; int type = (int)manager.addonList[num].type;
...@@ -82,7 +83,6 @@ public class AddonDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDra ...@@ -82,7 +83,6 @@ public class AddonDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDra
} }
else else
manager.DetachAddon(ui.selectedItem, (AddonType)(num - 9)); manager.DetachAddon(ui.selectedItem, (AddonType)(num - 9));
manager.SetOnPosition();
} }
} }
......
...@@ -6,7 +6,7 @@ public class InventoryManager : Singleton<InventoryManager> { ...@@ -6,7 +6,7 @@ public class InventoryManager : Singleton<InventoryManager> {
public List<Item> itemList = new List<Item>(); public List<Item> itemList = new List<Item>();
public List<Addon> addonList = new List<Addon>(); public List<Addon> addonList = new List<Addon>();
InventoryUI ui; public InventoryUI ui;
public List<string>[] itemPool = new List<string>[4]; public List<string>[] itemPool = new List<string>[4];
public List<string>[] addonPool = new List<string>[4]; public List<string>[] addonPool = new List<string>[4];
public GameObject droppedPrefab; public GameObject droppedPrefab;
...@@ -16,8 +16,8 @@ public class InventoryManager : Singleton<InventoryManager> { ...@@ -16,8 +16,8 @@ public class InventoryManager : Singleton<InventoryManager> {
private void Start() private void Start()
{ {
ui = GameObject.Find("InventoryCanvas").GetComponent<InventoryUI>(); ui.gameObject.GetComponent<Canvas>().enabled = true;
GameObject.Find("InventoryCanvas").SetActive(false); ui.gameObject.SetActive(false);
player = GameObject.Find("Player"); player = GameObject.Find("Player");
......
...@@ -111,6 +111,7 @@ public class InventoryUI : MonoBehaviour { ...@@ -111,6 +111,7 @@ public class InventoryUI : MonoBehaviour {
public void SetOnPosition(List<Item> itemList, List<Addon> addonList) public void SetOnPosition(List<Item> itemList, List<Addon> addonList)
{ {
SetAddonInfo();
for(int i=0; i<itemList.Count; i++) for(int i=0; i<itemList.Count; i++)
{ {
items[i].transform.position = itemCell[i].transform.position; items[i].transform.position = itemCell[i].transform.position;
......
...@@ -57,7 +57,7 @@ public class Test : MonoBehaviour { ...@@ -57,7 +57,7 @@ public class Test : MonoBehaviour {
} }
public void SummonEnemy() public void SummonEnemy()
{ {
EnemyManager.Instance.SpawnEnemyToMap(); EnemyManager.Instance.SpawnEnemyToMap_forTest();
} }
......
...@@ -62,6 +62,8 @@ public class LifeStoneManager : Singleton<LifeStoneManager> { ...@@ -62,6 +62,8 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
public float popoutStrengthMultiplier; public float popoutStrengthMultiplier;
public float popoutTime; public float popoutTime;
bool stoneCut;
void Start () { void Start () {
lifeStoneUI.transform.position = new Vector3(lifeStoneLocation.x, lifeStoneLocation.y, 0); lifeStoneUI.transform.position = new Vector3(lifeStoneLocation.x, lifeStoneLocation.y, 0);
frameSuper.GetComponent<LifeStoneFrame>().Init(frameSuper.transform, standardImage, lifeStoneRowNum, lifeStoneSize, sprites, frameBorder); frameSuper.GetComponent<LifeStoneFrame>().Init(frameSuper.transform, standardImage, lifeStoneRowNum, lifeStoneSize, sprites, frameBorder);
...@@ -89,7 +91,8 @@ public class LifeStoneManager : Singleton<LifeStoneManager> { ...@@ -89,7 +91,8 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
public void InstantiatePotion(Vector3 pos, float popoutStrength) public void InstantiatePotion(Vector3 pos, float popoutStrength)
{ {
PopoutGenerator(Instantiate(goldPotionPrefab, pos, Quaternion.identity), popoutStrength); PopoutGenerator(Instantiate(goldPotionPrefab, pos, Quaternion.identity,MapManager.currentRoom.roomInGame.transform), popoutStrength);
} }
IEnumerator PopoutCoroutine(GameObject obj) IEnumerator PopoutCoroutine(GameObject obj)
...@@ -318,20 +321,26 @@ public class LifeStoneManager : Singleton<LifeStoneManager> { ...@@ -318,20 +321,26 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
for (int pj = 0; pj < pSize.y; pj++) for (int pj = 0; pj < pSize.y; pj++)
{ {
if (selectedRow + pj >= lifeStoneRowNum) if (cutRow == pSize.y && selectedRow + pj >= lifeStoneRowNum)
{ {
cutRow = pj; cutRow = pj;
break; //break;
} }
for (int pi = 0; pi < pSize.x; pi++) for (int pi = 0; pi < pSize.x; pi++)
if (pFill[pj * pSize.x + pi] != ' ') if (pFill[pj * pSize.x + pi] != ' ')
{ {
int xtmp = selectedCol + pi, ytmp = selectedRow + pj; int xtmp = selectedCol + pi, ytmp = selectedRow + pj;
lifeStoneArray[ytmp, xtmp] = pFill[pj * pSize.x + pi] - 'A' + 1; GameObject tmpObj;
lifeStoneUnit[ytmp, xtmp] = Instantiate(lifeUnitPrefab, stoneSuper.transform); tmpObj = Instantiate(lifeUnitPrefab, stoneSuper.transform);
lifeStoneUnit[ytmp, xtmp].GetComponent<LifeUnitInFrame>().Init( if (pj < cutRow)
lifeStoneArray[ytmp, xtmp], {
lifeStoneArray[ytmp, xtmp] = pFill[pj * pSize.x + pi] - 'A' + 1;
lifeStoneUnit[ytmp, xtmp] = tmpObj;
}
tmpObj.GetComponent<LifeUnitInFrame>().Init(
pFill[pj * pSize.x + pi] - 'A' + 1,
lifeStoneSize, lifeStoneSize,
new Vector2Int(xtmp, ytmp), new Vector2Int(xtmp, ytmp),
new Vector2Int(xtmp, lifeStoneRowNum + pj), new Vector2Int(xtmp, lifeStoneRowNum + pj),
...@@ -341,37 +350,53 @@ public class LifeStoneManager : Singleton<LifeStoneManager> { ...@@ -341,37 +350,53 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
vibration = 0; vibration = 0;
} }
} }
stoneCut = false;
if (cutRow < pSize.y) if (cutRow < pSize.y)
{ {
char[] chFill = pFill.ToCharArray(); StartCoroutine(CutCoroutine(cutRow, pSize, pFill));
for (int i = 0; i < pSize.x; i++) }
return true;
}
public void StoneCutStart()
{
stoneCut = true;
}
IEnumerator CutCoroutine(int cutRow, Vector2Int pSize, string pFill)
{
while (!stoneCut)
{
yield return null;
}
char[] chFill = pFill.ToCharArray();
for (int i = 0; i < pSize.x; i++)
{
Queue<Vector2Int> queue = new Queue<Vector2Int>();
char[] newFill = new char[pSize.x * (pSize.y - cutRow)];
for (int t = 0; t < pSize.x * (pSize.y - cutRow); t++) newFill[t] = ' ';
if (chFill[cutRow * pSize.x + i] != ' ')
{ {
Queue<Vector2Int> queue = new Queue<Vector2Int>(); queue.Enqueue(new Vector2Int(i, cutRow));
char[] newFill = new char[pSize.x * (pSize.y - cutRow)]; while (queue.Count > 0)
for (int t = 0; t < pSize.x * (pSize.y - cutRow); t++) newFill[t] = ' ';
if (chFill[cutRow * pSize.x + i] != ' ')
{ {
queue.Enqueue(new Vector2Int(i, cutRow)); Vector2Int vtmp = queue.Dequeue();
while (queue.Count > 0) newFill[(vtmp.y - cutRow) * pSize.x + vtmp.x] = chFill[vtmp.y * pSize.x + vtmp.x];
{ chFill[vtmp.y * pSize.x + vtmp.x] = ' ';
Vector2Int vtmp = queue.Dequeue(); if (vtmp.x + 1 < pSize.x && chFill[vtmp.y * pSize.x + (vtmp.x + 1)] != ' ') queue.Enqueue(new Vector2Int(vtmp.x + 1, vtmp.y));
newFill[(vtmp.y - cutRow) * pSize.x + vtmp.x] = chFill[vtmp.y * pSize.x + vtmp.x]; if (vtmp.x - 1 >= 0 && chFill[vtmp.y * pSize.x + (vtmp.x - 1)] != ' ') queue.Enqueue(new Vector2Int(vtmp.x - 1, vtmp.y));
chFill[vtmp.y * pSize.x + vtmp.x] = ' '; if (vtmp.y + 1 < pSize.y && chFill[(vtmp.y + 1) * pSize.x + vtmp.x] != ' ') queue.Enqueue(new Vector2Int(vtmp.x, vtmp.y + 1));
if (vtmp.x + 1 < pSize.x && chFill[ vtmp.y * pSize.x + (vtmp.x + 1)] != ' ') queue.Enqueue(new Vector2Int(vtmp.x + 1, vtmp.y )); if (vtmp.y - 1 >= cutRow && chFill[(vtmp.y - 1) * pSize.x + vtmp.x] != ' ') queue.Enqueue(new Vector2Int(vtmp.x, vtmp.y - 1));
if (vtmp.x - 1 >= 0 && chFill[ vtmp.y * pSize.x + (vtmp.x - 1)] != ' ') queue.Enqueue(new Vector2Int(vtmp.x - 1, vtmp.y ));
if (vtmp.y + 1 < pSize.y && chFill[(vtmp.y + 1) * pSize.x + vtmp.x ] != ' ') queue.Enqueue(new Vector2Int(vtmp.x , vtmp.y + 1));
if (vtmp.y - 1 >= cutRow && chFill[(vtmp.y - 1) * pSize.x + vtmp.x ] != ' ') queue.Enqueue(new Vector2Int(vtmp.x , vtmp.y - 1));
}
InstantiateDroppedLifeStone(CreateLifeStoneInfo(
new LifeStoneInfo(new Vector2Int(pSize.x, pSize.y - cutRow), new string(newFill))),
GameObject.Find("Player").transform.position + new Vector3(droppedLifeStonePrefab.GetComponent<DroppedLifeStone>().unitSprite.GetComponent<SpriteRenderer>().bounds.size.x * i,0,0),
1f);
} }
InstantiateDroppedLifeStone(CreateLifeStoneInfo(
new LifeStoneInfo(new Vector2Int(pSize.x, pSize.y - cutRow), new string(newFill))),
GameObject.Find("Player").transform.position + new Vector3(droppedLifeStonePrefab.GetComponent<DroppedLifeStone>().unitSprite.GetComponent<SpriteRenderer>().bounds.size.x * i, 0, 0),
1f);
} }
} }
return true; }
}
/// <summary> /// <summary>
/// count lifestoneunit in lifestoneframe by type /// count lifestoneunit in lifestoneframe by type
......
...@@ -61,11 +61,11 @@ public class LifeUnitInFrame : MonoBehaviour { ...@@ -61,11 +61,11 @@ public class LifeUnitInFrame : MonoBehaviour {
float fadeTime = 0.3f; float fadeTime = 0.3f;
while (alpha <= 1f) while (alpha <= 1f)
{ {
GetComponent<Image>().color = new Color(255, 255, 255, alpha); GetComponent<Image>().color = new Color(1, 1, 1, alpha);
alpha += 1f / fadeTime * Time.deltaTime; alpha += 1f / fadeTime * Time.deltaTime;
yield return null; yield return null;
} }
GetComponent<Image>().color = new Color(255, 255, 255, 1f); GetComponent<Image>().color = new Color(1, 1, 1, 1f);
} }
IEnumerator FallEnumerator() IEnumerator FallEnumerator()
...@@ -84,6 +84,24 @@ public class LifeUnitInFrame : MonoBehaviour { ...@@ -84,6 +84,24 @@ public class LifeUnitInFrame : MonoBehaviour {
if (vibration != 0) if (vibration != 0)
StartCoroutine(LifeStoneManager.Instance.VibrateEnumerator(vibration)); StartCoroutine(LifeStoneManager.Instance.VibrateEnumerator(vibration));
if (pos.y >= LifeStoneManager.Instance.lifeStoneRowNum)
StartCoroutine(FadeOutEnumerator());
} }
IEnumerator FadeOutEnumerator()
{
float alpha = 1f;
float fadeTime = 0.3f;
while (alpha >= 0f)
{
GetComponent<Image>().color = new Color(1, 1, 1, alpha);
alpha -= 1f / fadeTime * Time.deltaTime;
yield return null;
}
GetComponent<Image>().color = new Color(1, 1, 1, 0f);
LifeStoneManager.Instance.StoneCutStart();
Destroy(gameObject);
}
} }
fileFormatVersion: 2
guid: 5af1a51130e303a48943d280fdd8524b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9588a72c7c886de4a999bf6cc7948b84 guid: 3f4a1ae9be64d9f46b0fd7fbffeb58a4
TextureImporter: TextureImporter:
fileIDToRecycleName: {} fileIDToRecycleName: {}
externalObjects: {} externalObjects: {}
...@@ -31,7 +31,7 @@ TextureImporter: ...@@ -31,7 +31,7 @@ TextureImporter:
maxTextureSize: 2048 maxTextureSize: 2048
textureSettings: textureSettings:
serializedVersion: 2 serializedVersion: 2
filterMode: -1 filterMode: 0
aniso: -1 aniso: -1
mipBias: -100 mipBias: -100
wrapU: 1 wrapU: 1
...@@ -45,7 +45,7 @@ TextureImporter: ...@@ -45,7 +45,7 @@ TextureImporter:
spriteMeshType: 1 spriteMeshType: 1
alignment: 0 alignment: 0
spritePivot: {x: 0.5, y: 0.5} spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100 spritePixelsToUnits: 64
spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1 spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1 alphaUsage: 1
...@@ -63,7 +63,7 @@ TextureImporter: ...@@ -63,7 +63,7 @@ TextureImporter:
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
textureCompression: 1 textureCompression: 0
compressionQuality: 50 compressionQuality: 50
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
...@@ -74,18 +74,7 @@ TextureImporter: ...@@ -74,18 +74,7 @@ TextureImporter:
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
textureCompression: 1 textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50 compressionQuality: 50
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
...@@ -97,7 +86,7 @@ TextureImporter: ...@@ -97,7 +86,7 @@ TextureImporter:
outline: [] outline: []
physicsShape: [] physicsShape: []
bones: [] bones: []
spriteID: a056a27b5da67434cbddf45ee2e1113d spriteID: 255038a448d1a6843905bb243e0d08bf
vertices: [] vertices: []
indices: indices:
edges: [] edges: []
......
fileFormatVersion: 2
guid: a6edaaede1a4aea42a1e9fea0eec397e
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 381f3859d4182af4fa7972b8e6404c51
vertices: []
indices:
edges: []
weights: []
spritePackingTag: 12
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment