-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ramp and fixed issue with spawn
- Loading branch information
1 parent
f54ef31
commit eb29dee
Showing
46 changed files
with
1,302 additions
and
200 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace SlateShipyard.ShipSpawner.RampUI | ||
{ | ||
public class RampAngleUI : MonoBehaviour | ||
{ | ||
float maxAngle = 90f; | ||
float minAngle = 0f; | ||
|
||
float targetAngle = 0f; | ||
float angleStep = 5f; | ||
float angleChangeSpeed = 180f; | ||
|
||
public Text angleDisplayText; | ||
public InteractReceiver increaseAngle; | ||
public InteractReceiver decreaseAngle; | ||
|
||
public void Start() | ||
{ | ||
increaseAngle.OnReleaseInteract += OnAngleIncrease; | ||
decreaseAngle.OnReleaseInteract += OnAngleDecrease; | ||
} | ||
public void OnDestroy() | ||
{ | ||
increaseAngle.OnReleaseInteract -= OnAngleIncrease; | ||
decreaseAngle.OnReleaseInteract -= OnAngleDecrease; | ||
} | ||
|
||
public void OnAngleIncrease() | ||
{ | ||
targetAngle += angleStep; | ||
targetAngle = Mathf.Clamp(targetAngle, minAngle, maxAngle); | ||
angleDisplayText.text = $" {(int)(targetAngle)}°"; | ||
increaseAngle.ResetInteraction(); | ||
} | ||
public void OnAngleDecrease() | ||
{ | ||
targetAngle -= angleStep; | ||
targetAngle = Mathf.Clamp(targetAngle, minAngle, maxAngle); | ||
angleDisplayText.text = $" {(int)(targetAngle)}°"; | ||
decreaseAngle.ResetInteraction(); | ||
} | ||
public void Update() | ||
{ | ||
Vector3 currentAngle = transform.localEulerAngles; | ||
float difference = targetAngle - transform.localEulerAngles.z; | ||
float step = Mathf.Clamp(Mathf.Abs(difference), 0f, angleChangeSpeed) * Time.deltaTime * Mathf.Sign(difference); | ||
currentAngle.z += step; | ||
transform.localEulerAngles = currentAngle; | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Blender MTL File: '3dModels.blend' | ||
# Material Count: 1 | ||
|
||
newmtl None | ||
Ns 500 | ||
Ka 0.8 0.8 0.8 | ||
Kd 0.8 0.8 0.8 | ||
Ks 0.8 0.8 0.8 | ||
d 1 | ||
illum 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Blender v3.0.0 OBJ File: '3dModels.blend' | ||
# www.blender.org | ||
mtllib baserRamp.mtl | ||
v 15.356176 1.561771 -21.135963 | ||
v 15.356176 2.869070 -21.135963 | ||
v 24.846817 1.561771 -8.073218 | ||
v 24.846817 2.869070 -8.073218 | ||
v 24.846815 1.561771 8.073220 | ||
v 24.846815 2.869070 8.073220 | ||
v 15.356174 1.561771 21.135963 | ||
v 15.356174 2.869070 21.135963 | ||
vt 0.077614 0.105721 | ||
vt 0.085659 0.099444 | ||
vt 0.163186 0.198800 | ||
vt 0.155141 0.205077 | ||
vt 0.240713 0.298156 | ||
vt 0.232669 0.304433 | ||
vt 0.318240 0.397512 | ||
vt 0.310196 0.403789 | ||
vn 0.8090 0.0000 -0.5878 | ||
vn 1.0000 0.0000 0.0000 | ||
vn 0.8090 0.0000 0.5878 | ||
vn -1.0000 0.0000 -0.0000 | ||
vn 0.0000 1.0000 0.0000 | ||
vn 0.0000 -1.0000 0.0000 | ||
usemtl None | ||
s off | ||
f 1/1/1 2/2/1 4/3/1 3/4/1 | ||
f 3/4/2 4/3/2 6/5/2 5/6/2 | ||
f 5/6/3 6/5/3 8/7/3 7/8/3 | ||
f 1/1/4 7/8/4 8/7/4 2/2/4 | ||
f 4/3/5 2/2/5 8/7/5 6/5/5 | ||
f 1/1/6 3/4/6 5/6/6 7/8/6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.