37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class UnitTreeManager : MonoBehaviour
|
|
{
|
|
private List<UnitTreeDisplay> oogaDisplay = new List<UnitTreeDisplay>();
|
|
|
|
private void Start()
|
|
{
|
|
|
|
}
|
|
//Shows the unit's upgrades around its position
|
|
public void ShowUpgrades(Vector3 position)
|
|
{
|
|
Vector3 m_Position = position;
|
|
|
|
//Instantiate UnitTreeDisplay rect 3 times
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
//oogaDisplay.Add(GetComponent<UnitTreeDisplay>());
|
|
GameObject rect = new GameObject();
|
|
Vector3 rectPosition = m_Position;
|
|
rectPosition.x += 10.0f * i;
|
|
GameObject instance = Instantiate(rect, rectPosition, transform.rotation);
|
|
instance.AddComponent<RectTransform>();
|
|
UnitTreeDisplay ooga = instance.AddComponent<UnitTreeDisplay>();
|
|
ooga.SetPosition(rectPosition);
|
|
//oogaDisplay[i].SetPosition(rectPosition);
|
|
}
|
|
|
|
//Instantiate line (later curved line? https://forum.unity.com/threads/easy-curved-line-renderer-free-utility.391219/)
|
|
|
|
//TODO later... Get unit's next upgrades
|
|
}
|
|
}
|