Commit cf901956 authored by 15김민규's avatar 15김민규

스태츄 코드 작성. 근데 animator state 어디갔냐

parent 2984e326
...@@ -22,6 +22,7 @@ GameObject: ...@@ -22,6 +22,7 @@ GameObject:
- component: {fileID: 212540714587432698} - component: {fileID: 212540714587432698}
- component: {fileID: 95413729269184064} - component: {fileID: 95413729269184064}
- component: {fileID: 114118738857420128} - component: {fileID: 114118738857420128}
- component: {fileID: 114537163463468708}
m_Layer: 0 m_Layer: 0
m_Name: Body m_Name: Body
m_TagString: Untagged m_TagString: Untagged
...@@ -61,7 +62,7 @@ GameObject: ...@@ -61,7 +62,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
...@@ -284,7 +285,7 @@ MonoBehaviour: ...@@ -284,7 +285,7 @@ MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1225288737757304} m_GameObject: {fileID: 1225288737757304}
m_Enabled: 1 m_Enabled: 0
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a11d071a77ab21c48882c6c6e4db8f17, type: 3} m_Script: {fileID: 11500000, guid: a11d071a77ab21c48882c6c6e4db8f17, type: 3}
m_Name: m_Name:
...@@ -301,7 +302,6 @@ MonoBehaviour: ...@@ -301,7 +302,6 @@ MonoBehaviour:
- 0.5 - 0.5
movementLock: 0 movementLock: 0
attackRange: 1.2 attackRange: 1.2
rotatable: 1
WallTest: WallTest:
CliffTest: CliffTest:
--- !u!114 &114173716467154830 --- !u!114 &114173716467154830
...@@ -329,6 +329,28 @@ MonoBehaviour: ...@@ -329,6 +329,28 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
damage: 4 damage: 4
isBumpAttack: 0 isBumpAttack: 0
--- !u!114 &114537163463468708
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1225288737757304}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bf69b9b0b3af3664e89e16eab14c1b0c, type: 3}
m_Name:
m_EditorClassIdentifier:
debuffState:
monsterID: 251
maxHealth: 3
weight: 1
patrolRange: 0
noticeRange: 0
patrolSpeed: 0
trackSpeed: 0
knockbackPercentage: []
movementLock: 0
scarecrow_or_statue: 0
--- !u!114 &114851997656688694 --- !u!114 &114851997656688694
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
......
...@@ -213,12 +213,12 @@ Prefab: ...@@ -213,12 +213,12 @@ Prefab:
- target: {fileID: 114513527214926720, guid: 408297f86a787fb499fef71b2a40e626, - target: {fileID: 114513527214926720, guid: 408297f86a787fb499fef71b2a40e626,
type: 2} type: 2}
propertyPath: cam propertyPath: cam
value: value:
objectReference: {fileID: 743604584} objectReference: {fileID: 743604584}
- target: {fileID: 114513527214926720, guid: 408297f86a787fb499fef71b2a40e626, - target: {fileID: 114513527214926720, guid: 408297f86a787fb499fef71b2a40e626,
type: 2} type: 2}
propertyPath: can propertyPath: can
value: value:
objectReference: {fileID: 2088383384} objectReference: {fileID: 2088383384}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 408297f86a787fb499fef71b2a40e626, type: 2} m_SourcePrefab: {fileID: 100100000, guid: 408297f86a787fb499fef71b2a40e626, type: 2}
...@@ -580,6 +580,80 @@ GameObject: ...@@ -580,6 +580,80 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 1623439448163086, guid: 3d077a5f727dd1e4780e9265ed26e036, m_CorrespondingSourceObject: {fileID: 1623439448163086, guid: 3d077a5f727dd1e4780e9265ed26e036,
type: 2} type: 2}
m_PrefabInternal: {fileID: 650104063} m_PrefabInternal: {fileID: 650104063}
--- !u!1001 &549384201
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalPosition.x
value: 11.29
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalPosition.y
value: -17.94
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_RootOrder
value: 14
objectReference: {fileID: 0}
- target: {fileID: 114118738857420128, guid: a164c147037e89448820f7387c724c42,
type: 2}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a164c147037e89448820f7387c724c42, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &549384202 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1225288737757304, guid: a164c147037e89448820f7387c724c42,
type: 2}
m_PrefabInternal: {fileID: 549384201}
--- !u!114 &549384203
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 549384202}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bf69b9b0b3af3664e89e16eab14c1b0c, type: 3}
m_Name:
m_EditorClassIdentifier:
debuffState:
monsterID: 251
maxHealth: 3
weight: 1
patrolRange: 0
noticeRange: 0
patrolSpeed: 0
trackSpeed: 0
knockbackPercentage: []
movementLock: 0
scarecrow_or_statue: 0
--- !u!1001 &579652633 --- !u!1001 &579652633
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -622,63 +696,21 @@ Prefab: ...@@ -622,63 +696,21 @@ Prefab:
- target: {fileID: 114772635349595938, guid: 7fec52078de87f74abe791494596a804, - target: {fileID: 114772635349595938, guid: 7fec52078de87f74abe791494596a804,
type: 2} type: 2}
propertyPath: frameSuper propertyPath: frameSuper
value: value:
objectReference: {fileID: 705690561} objectReference: {fileID: 705690561}
- target: {fileID: 114772635349595938, guid: 7fec52078de87f74abe791494596a804, - target: {fileID: 114772635349595938, guid: 7fec52078de87f74abe791494596a804,
type: 2} type: 2}
propertyPath: stoneSuper propertyPath: stoneSuper
value: value:
objectReference: {fileID: 871841152} objectReference: {fileID: 871841152}
- target: {fileID: 114772635349595938, guid: 7fec52078de87f74abe791494596a804, - target: {fileID: 114772635349595938, guid: 7fec52078de87f74abe791494596a804,
type: 2} type: 2}
propertyPath: lifeStoneUI propertyPath: lifeStoneUI
value: value:
objectReference: {fileID: 1206751492} objectReference: {fileID: 1206751492}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7fec52078de87f74abe791494596a804, type: 2} m_SourcePrefab: {fileID: 100100000, guid: 7fec52078de87f74abe791494596a804, type: 2}
m_IsPrefabAsset: 0 m_IsPrefabAsset: 0
--- !u!1001 &604778652
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalPosition.x
value: 11.29
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalPosition.y
value: -17.94
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4639192263818050, guid: a164c147037e89448820f7387c724c42, type: 2}
propertyPath: m_RootOrder
value: 15
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a164c147037e89448820f7387c724c42, type: 2}
m_IsPrefabAsset: 0
--- !u!1001 &650104063 --- !u!1001 &650104063
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -721,7 +753,7 @@ Prefab: ...@@ -721,7 +753,7 @@ Prefab:
- target: {fileID: 114880704145925944, guid: 3d077a5f727dd1e4780e9265ed26e036, - target: {fileID: 114880704145925944, guid: 3d077a5f727dd1e4780e9265ed26e036,
type: 2} type: 2}
propertyPath: comboUI propertyPath: comboUI
value: value:
objectReference: {fileID: 1504194384} objectReference: {fileID: 1504194384}
- target: {fileID: 114402380471012178, guid: 3d077a5f727dd1e4780e9265ed26e036, - target: {fileID: 114402380471012178, guid: 3d077a5f727dd1e4780e9265ed26e036,
type: 2} type: 2}
...@@ -824,8 +856,8 @@ MonoBehaviour: ...@@ -824,8 +856,8 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical m_VerticalAxis: Vertical
m_SubmitButton: Submit m_SubmitButton: Submit
...@@ -842,8 +874,8 @@ MonoBehaviour: ...@@ -842,8 +874,8 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0} m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1 m_sendNavigationEvents: 1
m_DragThreshold: 10 m_DragThreshold: 10
...@@ -907,7 +939,7 @@ Prefab: ...@@ -907,7 +939,7 @@ Prefab:
- target: {fileID: 114287389059791124, guid: e6794ab8e2e4c6340a23b382e9497cbb, - target: {fileID: 114287389059791124, guid: e6794ab8e2e4c6340a23b382e9497cbb,
type: 2} type: 2}
propertyPath: ui propertyPath: ui
value: value:
objectReference: {fileID: 1206751492} objectReference: {fileID: 1206751492}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e6794ab8e2e4c6340a23b382e9497cbb, type: 2} m_SourcePrefab: {fileID: 100100000, guid: e6794ab8e2e4c6340a23b382e9497cbb, type: 2}
...@@ -1302,7 +1334,7 @@ Prefab: ...@@ -1302,7 +1334,7 @@ Prefab:
- target: {fileID: 114939219159237616, guid: 62a83d11a7addc342ad436145784e698, - target: {fileID: 114939219159237616, guid: 62a83d11a7addc342ad436145784e698,
type: 2} type: 2}
propertyPath: coolUI propertyPath: coolUI
value: value:
objectReference: {fileID: 1864071040} objectReference: {fileID: 1864071040}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 62a83d11a7addc342ad436145784e698, type: 2} m_SourcePrefab: {fileID: 100100000, guid: 62a83d11a7addc342ad436145784e698, type: 2}
...@@ -1606,7 +1638,7 @@ Prefab: ...@@ -1606,7 +1638,7 @@ Prefab:
- target: {fileID: 114102296575005222, guid: b67c2e6425443f14c85899a92710bf3f, - target: {fileID: 114102296575005222, guid: b67c2e6425443f14c85899a92710bf3f,
type: 2} type: 2}
propertyPath: player propertyPath: player
value: value:
objectReference: {fileID: 489222433} objectReference: {fileID: 489222433}
- target: {fileID: 4354682656029732, guid: b67c2e6425443f14c85899a92710bf3f, type: 2} - target: {fileID: 4354682656029732, guid: b67c2e6425443f14c85899a92710bf3f, type: 2}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
...@@ -1667,8 +1699,8 @@ MonoBehaviour: ...@@ -1667,8 +1699,8 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1 m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0 m_BlockingObjects: 0
m_BlockingMask: m_BlockingMask:
...@@ -1683,8 +1715,8 @@ MonoBehaviour: ...@@ -1683,8 +1715,8 @@ MonoBehaviour:
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_UiScaleMode: 0 m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100 m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1 m_ScaleFactor: 1
......
...@@ -6,7 +6,6 @@ using Random = UnityEngine.Random; ...@@ -6,7 +6,6 @@ using Random = UnityEngine.Random;
public class Enemy : MonoBehaviour { public class Enemy : MonoBehaviour {
// data // data
// debuff // debuff
readonly float[] immunity_time = new float[(int)EnemyDebuffCase.END_POINTER] { 0.0f, 3.0f, 6.0f, 6.0f, 6.0f }; readonly float[] immunity_time = new float[(int)EnemyDebuffCase.END_POINTER] { 0.0f, 3.0f, 6.0f, 6.0f, 6.0f };
[SerializeField] [SerializeField]
...@@ -252,7 +251,13 @@ public class Enemy : MonoBehaviour { ...@@ -252,7 +251,13 @@ public class Enemy : MonoBehaviour {
// Animation Event // Animation Event
// - When dead // - When dead
public void DeadEvent() public virtual void DeadEvent()
{
ResetForPool();
DropItem();
}
public void ResetForPool()
{ {
if (transform.parent.GetComponentInChildren<HPBar>()) if (transform.parent.GetComponentInChildren<HPBar>())
transform.parent.GetComponentInChildren<HPBar>().Inactivate(); transform.parent.GetComponentInChildren<HPBar>().Inactivate();
...@@ -260,10 +265,12 @@ public class Enemy : MonoBehaviour { ...@@ -260,10 +265,12 @@ public class Enemy : MonoBehaviour {
transform.parent.SetParent(null); transform.parent.SetParent(null);
StopAllCoroutines(); StopAllCoroutines();
enemyManager.EnemyDeadCount++; enemyManager.EnemyDeadCount++;
CurrHealth = maxHealth; CurrHealth = maxHealth;
Invisible = false; Invisible = false;
// Drop 아이템 결정. 인덱스 별 아이템은 맨 밑에 서술 }
private void DropItem()
{
if (dropTable == null) { return; } if (dropTable == null) { return; }
float denominator = dropTable[dropTable.Length - 1]; float denominator = dropTable[dropTable.Length - 1];
...@@ -302,11 +309,6 @@ public class Enemy : MonoBehaviour { ...@@ -302,11 +309,6 @@ public class Enemy : MonoBehaviour {
inventoryManager.AddonInstantiate((ItemQuality)(indexOfItem - 12), transform.parent.position, EnemyManager.dropObjStrength); inventoryManager.AddonInstantiate((ItemQuality)(indexOfItem - 12), transform.parent.position, EnemyManager.dropObjStrength);
} }
} }
public void aaa()
{
Debug.Log("aaa");
}
} }
/* Item Drop Index /* Item Drop Index
......
...@@ -3,17 +3,16 @@ using System.Collections.Generic; ...@@ -3,17 +3,16 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class Scarecrow : Enemy { public class Scarecrow : Enemy {
public bool neverDie; public bool scarecrow_or_statue; // true: scarecrow
public override void GetHit(PlayerAttackInfo attack) public override void GetHit(PlayerAttackInfo attack)
{ {
if (Invisible) { return; } if (Invisible) { return; }
float prevHealth = CurrHealth;
CurrHealth -= attack.damage; CurrHealth -= attack.damage;
if (CurrHealth <= 0) if (CurrHealth <= 0)
{ {
if (neverDie) if (scarecrow_or_statue)
{ {
CurrHealth = maxHealth; CurrHealth = maxHealth;
} }
...@@ -27,4 +26,17 @@ public class Scarecrow : Enemy { ...@@ -27,4 +26,17 @@ public class Scarecrow : Enemy {
animator.SetTrigger("DamagedTrigger"); animator.SetTrigger("DamagedTrigger");
} }
public override void DeadEvent()
{
if (scarecrow_or_statue)
{
base.DeadEvent();
}
else
{
MapManager.Instance.UpgradeRoom(RoomType.Gold);
Destroy(transform.parent.gameObject);
}
}
} }
...@@ -12,7 +12,6 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -12,7 +12,6 @@ public class EnemyManager : Singleton<EnemyManager>
public static readonly float goldPer = 0.5f; public static readonly float goldPer = 0.5f;
public static readonly int ameNum = 0; public static readonly int ameNum = 0;
public static readonly float dropObjStrength = 1f; public static readonly float dropObjStrength = 1f;
// hold player for animation // hold player for animation
//public GameObject Player { get; private set; } // Use GameManager.Instance.player instead //public GameObject Player { get; private set; } // Use GameManager.Instance.player instead
......
...@@ -12,7 +12,7 @@ public class GameManager : Singleton<GameManager> { ...@@ -12,7 +12,7 @@ public class GameManager : Singleton<GameManager> {
public static GameState gameState; public static GameState gameState;
public bool isTutorial = false; public bool isTutorial = false;
private bool statueEvent = false;
/// <summary> /// <summary>
/// Position where portal would spawn player. /// Position where portal would spawn player.
/// </summary> /// </summary>
...@@ -151,5 +151,19 @@ public class GameManager : Singleton<GameManager> { ...@@ -151,5 +151,19 @@ public class GameManager : Singleton<GameManager> {
} }
} }
CountLeftRoom(); CountLeftRoom();
if(!statueEvent && MapManager.Instance.clearedRoomCount == 9)
{
foreach(Transform obj in MapManager.currentRoom.transform)
{
if (obj.gameObject.GetComponent<EnemyGround>() != null && obj.gameObject.GetComponent<SpriteRenderer>().isVisible)
{
Vector3 pos = obj.position;
obj.gameObject.GetComponent<Enemy>().ResetForPool();
// Instantiate;
statueEvent = true;
}
}
}
} }
} }
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