Assets
Contact
About
Forums
Login
Reply To: A 1.6 bug
Forums
›
💬 NodeCanvas
›
⚙️ Support
›
A 1.6 bug
›
Reply To: A 1.6 bug
December 23, 2014 at 1:42 pm
#19392
lijingsama
Participant
I fixed it now.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using
UnityEngine
;
using
NodeCanvas
.
Variables
;
namespace
NodeCanvas
.
Actions
{
[
Category
(
"NCAction"
)
]
[
AgentType
(
typeof
(
Transform
)
)
]
public
class
PlayCameraPathAnimation
:
ActionTask
{
public
bool
reverse
;
public
bool
waitForFinish
=
true
;
public
bool
alwaysBeginAtStart
;
private
bool
isCameraAnimationFinished
=
false
;
protected
override
string
info
{
get
{
return
"Play '"
+
(
agent
?
agent
.
name
:
"NULL"
)
+
"'"
;
}
}
protected
override
void
OnExecute
(
)
{
CameraPathAnimator
cpa
=
agent
.
GetComponent
<
CameraPathAnimator
>
(
)
;
isCameraAnimationFinished
=
false
;
cpa
.
animationMode
=
reverse
?
CameraPathAnimator
.
animationModes
.
reverse
:
CameraPathAnimator
.
animationModes
.
once
;
if
(
alwaysBeginAtStart
)
{
cpa
.
Seek
(
0
)
;
}
cpa
.
AnimationFinishedEvent
+=
OnAnimationFinished
;
if
(
cpa
==
null
)
{
EndAction
(
false
)
;
}
cpa
.
Play
(
)
;
}
protected
override
void
OnUpdate
(
)
{
if
(
!
waitForFinish
)
{
EndAction
(
)
;
}
else
if
(
isCameraAnimationFinished
)
{
EndAction
(
)
;
}
}
private
void
OnAnimationFinished
(
)
{
CameraPathAnimator
cpa
=
agent
.
GetComponent
<
CameraPathAnimator
>
(
)
;
cpa
.
AnimationFinishedEvent
-=
OnAnimationFinished
;
isCameraAnimationFinished
=
true
;
}
}
}
Login
Register
Remember me
Forgot Password?
Sign in
I accept the
Privacy Policy
Sign Up
Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.
Email Reset Link
body::-webkit-scrollbar { width: 7px; } body::-webkit-scrollbar-track { border-radius: 10px; background: #f0f0f0; } body::-webkit-scrollbar-thumb { border-radius: 50px; background: #dfdbdb }