Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Commit

Permalink
Something e
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyHallo committed Aug 8, 2022
1 parent b1f0bd6 commit 2be3ffc
Show file tree
Hide file tree
Showing 3 changed files with 334 additions and 62 deletions.
338 changes: 295 additions & 43 deletions Assets/Fonts/Montserrat/Montserrat-VariableFont_wght SDF.asset

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Assets/Scripts/Pickups/Pickable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void OnTriggerStay(Collider other)
player.GetComponent<PlayerController>().TryUseInstrument(instrumentType);

Destroy(this.gameObject);
UIManager.hintText.text = "";
// UIManager.hintText.text = "";
}

}
Expand Down
56 changes: 38 additions & 18 deletions Assets/Scripts/Player/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ public void TryUseInstrument(InstrumentTypes instrument)
{
for (int i = 0; i < instruments.Count; i++)
{
uiManager.hintText.text = "Remove dirt (RMB)";

if (instruments[i].e == mainSocketCurrentStoringInstrument)
{
Expand All @@ -231,6 +230,7 @@ public void TryUseInstrument(InstrumentTypes instrument)
}
}
}
uiManager.hintText.text = "";

// clear sockets
mainSocketCurrentStoringInstrument = InstrumentTypes.None;
Expand All @@ -251,6 +251,32 @@ public void TryUseInstrument(InstrumentTypes instrument)
return;
}

print(instru);

switch (instru)
{
case 0:
uiManager.hintText.text = "1 - Remove dirt (RMB)";
break;

case 1:
uiManager.hintText.text = "2 - Add dirt (LMB)";
break;

case 2:
uiManager.hintText.text = "3 - Add butterfly (LMB), Add metal spirit (RMB)";
break;

case 3:
uiManager.hintText.text = "4 - Not implemented...";
break;

case 4:
uiManager.hintText.text = "5 - Not implemented...";
break;
}


// Place the former instrument back
if (mainSocketCurrentStoringInstrument != InstrumentTypes.None)
{
Expand Down Expand Up @@ -366,32 +392,21 @@ private void CheckRay()

if (Input.GetMouseButton(0) && ableToDig)
{
// colourGenerator2D.DrawTextureOnWorldPos(colourGenerator2D.userTex, hit.point, drawRange, true);
terrainMesh.DrawOnChunk(hit.point, drawRange, digStrength, 0);
}
else if (Input.GetMouseButton(1) && ableToDig)
{
// colourGenerator2D.DrawTextureOnWorldPos(colourGenerator2D.userTex, hit.point, drawRange, false);
NotifyTerrainChanged(hit.point, drawRange);
terrainMesh.DrawOnChunk(hit.point, drawRange, digStrength, 1);
}

}
}
else if (mainSocketCurrentStoringInstrument == InstrumentTypes.Dudelsa)
{
uiManager.hintText.text = "Add dirt (LMB)";
// TODO: change sky color
if (Input.GetMouseButton(0) && ableToDig)
{
NotifyTerrainChanged(hit.point, drawRange);
terrainMesh.DrawOnChunk(hit.point, drawRange, digStrength, 1);
}
}
else if (mainSocketCurrentStoringInstrument == InstrumentTypes.Guitar)
{
uiManager.hintText.text = "Add or remove trees";
// TODO: tree control

}
// Creaste / Destroy Creature
else if (mainSocketCurrentStoringInstrument == InstrumentTypes.Mic)
{
uiManager.hintText.text = "Add butterfly (LMB), Add metal spirit (RMB)";
// Create
if (hit.collider.tag == "Chunk")
{
Expand Down Expand Up @@ -420,6 +435,11 @@ private void CheckRay()
Destroy(hit.collider.gameObject);
}
}
// Creaste / Destroy Creature
else if (mainSocketCurrentStoringInstrument == InstrumentTypes.Mic)
{

}
}
}

Expand Down

0 comments on commit 2be3ffc

Please sign in to comment.