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
......
...@@ -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
...@@ -637,48 +711,6 @@ Prefab: ...@@ -637,48 +711,6 @@ Prefab:
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
......
...@@ -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