Пример #1
0
    public static GameObject PlaceTowerInSlotGO(TowerItemLegacy tower, GameObject towerSlotParent)
    {
        GameObject newGO = GameObject.Instantiate(tower.TowerPrefab, towerSlotParent.transform.position, Quaternion.identity, towerSlotParent.transform);

        newGO.name = (tower.TowerPrefab.name + UnityEngine.Random.Range(10000, 99999).ToString());
        return(newGO);
    }
Пример #2
0
 public static void PlaceTowerInSlot(TowerItemLegacy tower, GameObject TargetSlotObject, GameObject towerSlotParent)
 {
     TargetSlotObject      = Instantiate(tower.TowerPrefab, towerSlotParent.transform.position, Quaternion.identity, towerSlotParent.transform);
     TargetSlotObject.name = (tower.TowerPrefab.name + UnityEngine.Random.Range(10000, 99999).ToString());
 }