Debuggins
This commit is contained in:
parent
3e0ddca9a4
commit
3ce5219946
@ -49,12 +49,12 @@ public class AllyUpgrade : MonoBehaviour, IPointerClickHandler
|
||||
|
||||
private void AssignUpgrades(Canvas canvas)
|
||||
{
|
||||
Debug.Log("Upgrade count: " + _instance.transform.childCount);
|
||||
// Assign upgrade Prefabs
|
||||
for (int i = 0; i < _instance.transform.childCount; i++)
|
||||
{
|
||||
GameObject upgradeEnfant = _instance.transform.GetChild(i).gameObject;
|
||||
UpgradePlacementButton button = upgradeEnfant.GetComponent<UpgradePlacementButton>();
|
||||
button.Initialize(_upgradeUnitCardList[i], _upgradePrefabList[i], gameObject, canvas);
|
||||
Debug.Log("Button " + _upgradePrefabList[i].name);
|
||||
}
|
||||
}}
|
||||
|
||||
@ -7,7 +7,6 @@ public class UnitTreeDisplay : MonoBehaviour, IPointerEnterHandler, IPointerExit
|
||||
{
|
||||
//private Vector3 _originPosition;
|
||||
private Vector2 _size;
|
||||
GameObject _gameObject;
|
||||
private RectTransform _rectTransform;
|
||||
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler
|
||||
private GameObject _prefab;
|
||||
[SerializeField]
|
||||
private GameObject _buttonContainer;
|
||||
private GameObject _parentGameObject;
|
||||
private GameObject _unitGameObject;
|
||||
private Canvas _canvas;
|
||||
|
||||
|
||||
@ -59,11 +59,10 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
//Change parent GameObject
|
||||
Vector3 instantiatePosition = _parentGameObject.transform.position;
|
||||
Vector3 instantiatePosition = _unitGameObject.transform.position;
|
||||
Debug.Log("Upgrade clicked...");
|
||||
Debug.Log("Position: " + instantiatePosition);
|
||||
Instantiate(_prefab, instantiatePosition, Quaternion.identity, _canvas.transform);
|
||||
Destroy(_parentGameObject);
|
||||
Destroy(_unitGameObject);
|
||||
Destroy(_buttonContainer);
|
||||
|
||||
}
|
||||
@ -76,7 +75,7 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler
|
||||
SetTextFor(_rockLabel, card.Rock);
|
||||
_unitCardInformation = card;
|
||||
_prefab = prefabGameObject;
|
||||
_parentGameObject = parentGameObject;
|
||||
_unitGameObject = parentGameObject;
|
||||
_canvas = canvas;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user