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
169cc128
Commit
169cc128
authored
Feb 15, 2019
by
Mitchie Maluschnig
Browse files
fixed pie throwing 'tap' spacebar bug
parent
63883711
Changes
1
Hide whitespace changes
Inline
Side-by-side
RingMaster/RingMaster/Assets/Scripts/PieScripts/throwManager.cs
View file @
169cc128
...
@@ -22,6 +22,7 @@ public class throwManager : MonoBehaviour {
...
@@ -22,6 +22,7 @@ public class throwManager : MonoBehaviour {
public
GameObject
hand
;
public
GameObject
hand
;
private
GameObject
currentPie
;
private
GameObject
currentPie
;
private
bool
shotPie
;
private
bool
shotPie
;
private
bool
loadingPie
;
private
float
angle
;
private
float
angle
;
private
float
power
;
private
float
power
;
...
@@ -62,13 +63,20 @@ public class throwManager : MonoBehaviour {
...
@@ -62,13 +63,20 @@ public class throwManager : MonoBehaviour {
}
}
void
manageThrow
(
bool
canThrow
)
{
void
manageThrow
(
bool
canThrow
)
{
if
(
Input
.
GetKeyUp
(
"s
pace
"
)
&&
PieManager
.
pieCount
>
0
&&
canThrow
)
{
if
(
Input
.
GetKeyUp
(
KeyCode
.
S
pace
)
&&
PieManager
.
pieCount
>
0
&&
canThrow
)
{
//unpause animation
//unpause animation
anim
.
speed
=
2
;
if
(
loadingPie
)
{
anim
.
SetBool
(
"ResetThrow"
,
true
);
Destroy
(
currentPie
);
anim
.
speed
=
1
;
}
else
{
anim
.
speed
=
2
;
}
}
}
if
(
PieManager
.
pieCount
>
0
)
{
if
(
PieManager
.
pieCount
>
0
)
{
if
(
Input
.
GetKeyDown
(
KeyCode
.
Space
))
{
if
(
Input
.
GetKeyDown
(
KeyCode
.
Space
))
{
//load pie into players hand
//load pie into players hand
anim
.
SetBool
(
"ResetThrow"
,
false
);
anim
.
SetBool
(
"BeginThrow"
,
true
);
anim
.
SetBool
(
"BeginThrow"
,
true
);
anim
.
speed
=
1
;
anim
.
speed
=
1
;
angle
=
angleMeter
.
fillAmount
;
angle
=
angleMeter
.
fillAmount
;
...
@@ -77,6 +85,7 @@ public class throwManager : MonoBehaviour {
...
@@ -77,6 +85,7 @@ public class throwManager : MonoBehaviour {
AngleState
=
PowerIncreasing
;
AngleState
=
PowerIncreasing
;
PowerIncreasing
=
true
;
PowerIncreasing
=
true
;
loadingPie
=
true
;
}
}
if
(
Input
.
GetKeyUp
(
KeyCode
.
Space
))
{
if
(
Input
.
GetKeyUp
(
KeyCode
.
Space
))
{
PowerIncreasing
=
AngleState
;
PowerIncreasing
=
AngleState
;
...
@@ -120,6 +129,7 @@ public class throwManager : MonoBehaviour {
...
@@ -120,6 +129,7 @@ public class throwManager : MonoBehaviour {
public
void
pauseAnimation
()
{
public
void
pauseAnimation
()
{
anim
.
speed
=
0
;
anim
.
speed
=
0
;
anim
.
SetBool
(
"BeginThrow"
,
false
);
anim
.
SetBool
(
"BeginThrow"
,
false
);
loadingPie
=
false
;
}
}
void
fillSomething
(
Image
thing
)
{
void
fillSomething
(
Image
thing
)
{
...
...
Write
Preview
Markdown
is supported
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