Commit 8574ee86 authored by abpo11's avatar abpo11

콤보 표시됨. 애니메이션 받아서 실행함. 키 zxc 취소v

parent 1569e03d
...@@ -257,6 +257,31 @@ AnimatorState: ...@@ -257,6 +257,31 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &1102225149719626110
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: PlayerAttackAnim
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 9e6ebf939e606a340a0df3ac416b0cb8, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &1102466624416092410 --- !u!1102 &1102466624416092410
AnimatorState: AnimatorState:
serializedVersion: 5 serializedVersion: 5
...@@ -411,6 +436,9 @@ AnimatorStateMachine: ...@@ -411,6 +436,9 @@ AnimatorStateMachine:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 1102466624416092410} m_State: {fileID: 1102466624416092410}
m_Position: {x: 203, y: 185, z: 0} m_Position: {x: 203, y: 185, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102225149719626110}
m_Position: {x: 238, y: 250, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: m_AnyStateTransitions:
- {fileID: 1101150420884930214} - {fileID: 1101150420884930214}
......
%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: PlayerAttackAnim
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: []
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: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
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: []
fileFormatVersion: 2
guid: 9e6ebf939e606a340a0df3ac416b0cb8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
...@@ -280,8 +280,11 @@ MonoBehaviour: ...@@ -280,8 +280,11 @@ MonoBehaviour:
attackA: 0 attackA: 0
attackB: 0 attackB: 0
attackC: 0 attackC: 0
comboArray: cancel: 0
StartTime: 0 time: {fileID: 1333585343}
combo: {fileID: 1159748691}
keyCoolDown: 1
anim: {fileID: 0}
--- !u!1001 &677608594 --- !u!1001 &677608594
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -516,6 +519,95 @@ Transform: ...@@ -516,6 +519,95 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1159748689
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1159748690}
- component: {fileID: 1159748692}
- component: {fileID: 1159748691}
- component: {fileID: 1159748693}
m_Layer: 5
m_Name: comboString
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1159748690
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1159748689}
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: []
m_Father: {fileID: 1708140759}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 100, y: 100}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1159748691
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1159748689}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'test
'
--- !u!222 &1159748692
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1159748689}
m_CullTransparentMesh: 0
--- !u!114 &1159748693
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1159748689}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67f69504559e3ec4fbecc50b8f44c44a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1184292066 --- !u!1001 &1184292066
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -650,6 +742,93 @@ Prefab: ...@@ -650,6 +742,93 @@ Prefab:
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 668207ef06c134e40b24375977c2c930, type: 2} m_SourcePrefab: {fileID: 100100000, guid: 668207ef06c134e40b24375977c2c930, type: 2}
m_IsPrefabAsset: 0 m_IsPrefabAsset: 0
--- !u!1 &1333585340
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1333585341}
- component: {fileID: 1333585344}
- component: {fileID: 1333585343}
- component: {fileID: 1333585342}
m_Layer: 5
m_Name: comboTime
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1333585341
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1333585340}
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: []
m_Father: {fileID: 1708140759}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 100, y: 120}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1333585342
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1333585340}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cff5b06354e433c449df95b85dcc3fe9, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1333585343
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1333585340}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: New Text
--- !u!222 &1333585344
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1333585340}
m_CullTransparentMesh: 0
--- !u!4 &1604462410 stripped --- !u!4 &1604462410 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 4884929250924374, guid: e6794ab8e2e4c6340a23b382e9497cbb, m_CorrespondingSourceObject: {fileID: 4884929250924374, guid: e6794ab8e2e4c6340a23b382e9497cbb,
...@@ -744,6 +923,11 @@ Prefab: ...@@ -744,6 +923,11 @@ Prefab:
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e6794ab8e2e4c6340a23b382e9497cbb, type: 2} m_SourcePrefab: {fileID: 100100000, guid: e6794ab8e2e4c6340a23b382e9497cbb, type: 2}
m_IsPrefabAsset: 0 m_IsPrefabAsset: 0
--- !u!224 &1708140759 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 224395958577644168, guid: e6794ab8e2e4c6340a23b382e9497cbb,
type: 2}
m_PrefabInternal: {fileID: 1708140758}
--- !u!1001 &1711972807 --- !u!1001 &1711972807
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -6,12 +6,14 @@ public class AttackCombo ...@@ -6,12 +6,14 @@ public class AttackCombo
string name; string name;
//화염발사! //화염발사!
string combo; string combo;
string comboAnim;
//"ABCACBAC" //"ABCACBAC"
public AttackCombo(string name, string combo, float time) public AttackCombo(string name, string combo, float time , string comboAnim)
{ {
this.time = time; this.time = time;
this.name = name; this.name = name;
this.combo = combo; this.combo = combo;
this.comboAnim = comboAnim;
} }
public override string ToString() public override string ToString()
{ {
...@@ -29,4 +31,8 @@ public class AttackCombo ...@@ -29,4 +31,8 @@ public class AttackCombo
{ {
return time; return time;
} }
public string getComboAnim()
{
return comboAnim;
}
} }
\ No newline at end of file
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
public class PlayerAttack : MonoBehaviour { public class PlayerAttack : MonoBehaviour {
public ComboState state; public ComboState state;
public float attackA,attackB,attackC; public float attackA,attackB,attackC;
public float cancel; public float cancel;
public string comboArray; public Text time, combo;
public float StartTime; public static string comboArray;
public static float StartTime;
public bool keyCoolDown=true; public bool keyCoolDown=true;
public AttackCombo[] AttackArr= { new AttackCombo("화염발사", "ABC", 1.5f), public Animator anim;
new AttackCombo("공격A", "A", 0.5f), public AttackCombo[] AttackArr= { new AttackCombo("화염발사", "ABC", 1.5f,"PlayerRunAnim"),
new AttackCombo("공격B", "B", 0.5f), new AttackCombo("공격A", "A", 0.5f,"PlayerGoingDownAnim"),
new AttackCombo("공격C", "C", 0.5f), new AttackCombo("공격B", "B", 0.5f,"PlayerWalkAnim"),
new AttackCombo("콩", "AC", 1f), new AttackCombo("공격C", "C", 0.5f,"PlayerGoingUpAnim"),
new AttackCombo("콩콩콩", "ACB", 2f), new AttackCombo("콩", "AC", 1f,"PlayerIdleAnim"),
new AttackCombo("콩콩콩", "ACB", 2f,"PlayerIdleAnim"),
}; };
public Queue comboQueue = new Queue(); public Queue comboQueue = new Queue();
...@@ -22,6 +24,7 @@ public class PlayerAttack : MonoBehaviour { ...@@ -22,6 +24,7 @@ public class PlayerAttack : MonoBehaviour {
void Start () { void Start () {
StartTime = Time.time; StartTime = Time.time;
state = ComboState.Idle; state = ComboState.Idle;
anim = GetComponent<Animator>();
} }
// Update is called once per frame // Update is called once per frame
...@@ -33,6 +36,16 @@ public class PlayerAttack : MonoBehaviour { ...@@ -33,6 +36,16 @@ public class PlayerAttack : MonoBehaviour {
attackB = Input.GetAxisRaw("Fire2"); attackB = Input.GetAxisRaw("Fire2");
attackC = Input.GetAxisRaw("Fire3"); attackC = Input.GetAxisRaw("Fire3");
cancel = Input.GetAxisRaw("stop"); cancel = Input.GetAxisRaw("stop");
combo.text = comboArray;
float tempTime = Mathf.Clamp(StartTime - Time.time+1f , 0f, 9999f) ;
foreach (AttackCombo c in comboQueue)
{
tempTime += c.getTime();
}
time.text=Mathf.Round(tempTime*10f)/10f+"";
if (attackA + attackB + attackC == 0) if (attackA + attackB + attackC == 0)
{ {
keyCoolDown = true; keyCoolDown = true;
...@@ -73,6 +86,8 @@ public class PlayerAttack : MonoBehaviour { ...@@ -73,6 +86,8 @@ public class PlayerAttack : MonoBehaviour {
AttackCombo cur = (AttackCombo)comboQueue.Dequeue(); AttackCombo cur = (AttackCombo)comboQueue.Dequeue();
print(cur); print(cur);
anim.Play(cur.getComboAnim());
//실제로는 애니메이션 가져옴
state = ComboState.Attack; state = ComboState.Attack;
StartTime = Time.time + cur.getTime(); StartTime = Time.time + cur.getTime();
} }
......
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