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