Skip to content

Commit

Permalink
Renamed TowerScript -> TowerScriptableObject
Browse files Browse the repository at this point in the history
  • Loading branch information
ddabble committed Nov 24, 2021
1 parent 2f1115a commit 3edb005
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Assets/Prefabs/Towers/AxeTurret/AxeTurret.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
canInteract: 1
towerScript: {fileID: 11400000, guid: a59d08db63548fb4b851e0848fc561ec, type: 2}
_towerScriptableObject: {fileID: 11400000, guid: a59d08db63548fb4b851e0848fc561ec, type: 2}
turretInput: {fileID: 0}
rotAxis: {fileID: 929849385462332844}
arrowPointer: {fileID: 8198781589771022394}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
canInteract: 1
towerScript: {fileID: 11400000, guid: 2ec78001a1c2b2d4bbf643cf65b22984, type: 2}
_towerScriptableObject: {fileID: 11400000, guid: 2ec78001a1c2b2d4bbf643cf65b22984, type: 2}
turretInput: {fileID: 0}
--- !u!208 &-9140866788019457868
NavMeshObstacle:
Expand Down
2 changes: 1 addition & 1 deletion Assets/Prefabs/Towers/WheelTurret/WheelTurret.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
canInteract: 1
towerScript: {fileID: 11400000, guid: 2c0affb1e8eaf774a9e76ec9e5098216, type: 2}
_towerScriptableObject: {fileID: 11400000, guid: 2c0affb1e8eaf774a9e76ec9e5098216, type: 2}
turretInput: {fileID: 0}
rotAxis: {fileID: 769070955576516685}
arrowPointer: {fileID: 8246341762033966926}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Prefabs/Towers/tower_pendulum.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
canInteract: 1
towerScript: {fileID: 0}
_towerScriptableObject: {fileID: 0}
turretInput: {fileID: 0}
rotAxis: {fileID: 5529524980676544149}
arrowPointer: {fileID: 4654737029441173943}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Player/PlayerStateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private void OnMoveTower()
if (!(focusedInteractable is TowerLogic tower))
return;

tower.TowerScript.InstantiateConstructionTower(this);
tower.TowerScriptableObject.InstantiateConstructionTower(this);
SetState(PlayerStates.BUILDING);

RemoveInteractable(tower);
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Player/PlayerUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void LateUpdate()
ui.transform.LookAt(lookAtPos, mainCameraTransform.rotation * Vector3.up);
}

public TowerScript GetSelectedSegment()
public TowerScriptableObject GetSelectedSegment()
{
return controllerWheel.GetSelectedTower();
}
Expand All @@ -49,7 +49,7 @@ public void Select()
//Turns off the UI if button no longer held
if (!state.Select)
{
TowerScript selectedSegment = GetSelectedSegment();
TowerScriptableObject selectedSegment = GetSelectedSegment();
if (selectedSegment
&& inventory.ResourceAmount - selectedSegment.cost >= 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEngine.UI;

[CreateAssetMenu(menuName = "TowerScriptableObject")]
public class TowerScript : ScriptableObject
public class TowerScriptableObject : ScriptableObject
{
public string towerName;
public int cost;
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Towers/TowerLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
public class TowerLogic : Interactable
{
[SerializeField]
private TowerScript towerScript;
private TowerScriptableObject _towerScriptableObject;

[ReadOnly, SerializeField]
protected TurretInput turretInput;

public TowerScript TowerScript => towerScript;
public TowerScriptableObject TowerScriptableObject => _towerScriptableObject;

protected void Start()
{
Expand Down
8 changes: 4 additions & 4 deletions Assets/Scripts/UI/UIControllerWheel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class UIControllerWheel : MonoBehaviour
{
[SerializeField]
private TowerScript[] towers;
private TowerScriptableObject[] towers;

[SerializeField]
private GameObject[] menuSegments;
Expand Down Expand Up @@ -76,14 +76,14 @@ public int GetNumSegments()
}

/// <summary>
/// Returns the `TowerScript` (`ScriptableObject`) at the provided index of the wheel segments.
/// Returns the `TowerScriptableObject` at the provided index of the wheel segments.
/// </summary>
public TowerScript GetTower(int index)
public TowerScriptableObject GetTower(int index)
{
return towers[index];
}

public TowerScript GetSelectedTower()
public TowerScriptableObject GetSelectedTower()
{
if (SelectedSegmentIndex == null)
return null;
Expand Down

0 comments on commit 3edb005

Please sign in to comment.