public void PrepareUpgreade(BaseTower pickTower) { buildTower = pickTower; if (buildTower.NextTower == null) { state = TowerState.UpgradComplete; return; } UiManager.Instance.ShowUpgradeUi(this, transform.position); }
public override GameObject PickUp(Transform controllPoint) { state = TowerState.NoUpgrade; buildTower.transform.SetParent(controllPoint); buildTower.transform.localPosition = Vector3.zero; GameManager.ChangeGameState(GameState.PickThing); BaseTower renturnTower = buildTower; buildTower = default; return(renturnTower.gameObject); }
public override GameObject PutDown(Vector3 putPos) { Debug.Log(name + " " + CurTower.curLevel); GameObject towerObj = PlayerInput.Pickable.PutDown(putPos); BaseTower tower = towerObj.GetComponent <BaseTower>(); // sp.sortingOrder = CurPoint.Y; PrepareUpgreade(tower); transform.SetParent(transform); transform.localPosition = Vector3.zero; return(towerObj); }