Added new custom castles and slingshot band

This commit is contained in:
Trianta
2024-02-22 00:29:49 -06:00
parent cb4a89ef00
commit 4839623f79
6 changed files with 1772 additions and 1571 deletions
+4 -4
View File
@@ -69,7 +69,7 @@ public class MissionDemolition: MonoBehaviour {
// Zoom out
SwitchView("Show Both" );
// Start the next level in 2 seconds
Invoke("NextLevel" ,2f );
Invoke("NextLevel", 2f);
}
}
@@ -87,17 +87,17 @@ public class MissionDemolition: MonoBehaviour {
}
showing = eView;
switch (showing) {
case"Show Slingshot" :
case "Show Slingshot":
FollowCam.POI = null;
uitButton.text = "Show Castle";
break;
case"Show Castle":
case "Show Castle":
FollowCam.POI = s.castle;
uitButton.text = "Show Both" ;
break;
case"Show Both" :
case "Show Both":
FollowCam.POI = GameObject.Find("ViewBoth" );
uitButton.text = "Show Slingshot";
break;
+5
View File
@@ -67,6 +67,10 @@ public class Slingshot : MonoBehaviour
// Move the projectile to this new position
Vector3 projPos = launchPos + mouseDelta;
projectile.transform.position = projPos;
// Get SlingshotBand and match point 1 with projectile
LineRenderer slingshotBand = s.GetComponentInChildren<LineRenderer>();
slingshotBand.SetPosition(1, mouseDelta);
if (Input.GetMouseButtonUp(0)) {
// The mouse has been released
aimingMode = false;
@@ -76,6 +80,7 @@ public class Slingshot : MonoBehaviour
projectile = null;
MissionDemolition.ShotFired();
ProjectileLine.s.poi = projectile;
slingshotBand.SetPosition(1, new Vector3(0,0,0));
}
}
}