-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnemyCache.cs
43 lines (37 loc) · 1.1 KB
/
EnemyCache.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using UnityEngine;
using System.Collections;
using System;
public class EnemyCache : CacheController<GameObject, GameObject>
{
public EnemyCache(GameObject _t, GameObject _temp) : base(_t, _temp)
{
}
public override GameObject createItem(GameObject _temp)
{
return _temp;
}
public override void discardItem(GameObject _t)
{
GameObject.DestroyImmediate(_t);
}
public override void resetItem(GameObject _t)
{
if (_t == null)
{
Debug.LogError("reset Item is null");
return;
}
_t.gameObject.GetComponent<ATKandDamage>().hp = 100;
_t.gameObject.GetComponent<ATKandDamage>().HpSlider.value = 1;
_t.gameObject.GetComponent<EnemyIcon>().setUnActive();
_t.SetActive(false);
//StartCoroutine(reset(_t));
}
//IEnumerator reset(GameObject _t)
//{
// yield return new WaitForSeconds(1f);
// _t.SetActive(false);
// _t.gameObject.GetComponent<ATKandDamage>().hp = 100;
// _t.gameObject.GetComponent<ATKandDamage>().HpSlider.value = 1;
//}
}