Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gstuitje
RingMaster
Commits
5a89134c
Commit
5a89134c
authored
Feb 13, 2019
by
mmaluschnig
Browse files
power chooses correct fill now
parent
6a2e46ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
RingMaster/RingMaster/Assets/Scripts/PieScripts/throwManager.cs
View file @
5a89134c
...
...
@@ -24,6 +24,7 @@ public class throwManager : MonoBehaviour {
private
bool
shotPie
;
private
float
angle
;
private
float
power
;
// Use this for initialization
void
Start
()
{
...
...
@@ -44,6 +45,7 @@ public class throwManager : MonoBehaviour {
}
if
(
Input
.
GetKeyUp
(
KeyCode
.
Space
))
{
PowerIncreasing
=
AngleState
;
power
=
powerBar
.
fillAmount
;
}
if
(
Input
.
GetKey
(
KeyCode
.
Space
))
{
fillSomething
(
powerBar
);
...
...
@@ -78,6 +80,7 @@ public class throwManager : MonoBehaviour {
}
if
(
Input
.
GetKeyUp
(
KeyCode
.
Space
))
{
PowerIncreasing
=
AngleState
;
power
=
powerBar
.
fillAmount
;
}
if
(
Input
.
GetKey
(
KeyCode
.
Space
))
{
fillSomething
(
powerBar
);
...
...
@@ -100,7 +103,7 @@ public class throwManager : MonoBehaviour {
//create pie object and set its power to the powerBars fill
//GameObject pie = Instantiate(piePrefab, pieSpawn.position, Quaternion.Euler(new Vector3(0, 0, (1 - angleMeter.fillAmount) * -90)));
currentPie
.
GetComponent
<
Rigidbody2D
>().
bodyType
=
RigidbodyType2D
.
Dynamic
;
currentPie
.
GetComponent
<
Pie
>().
force
=
power
Bar
.
fillAmount
;
currentPie
.
GetComponent
<
Pie
>().
force
=
power
;
currentPie
.
transform
.
parent
.
DetachChildren
();
currentPie
.
transform
.
rotation
=
Quaternion
.
Euler
(
new
Vector3
(
0
,
0
,
(
1
-
angle
)
*
-
90
));
currentPie
.
GetComponent
<
Pie
>().
Launch
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment