Elin Decompiled Documentation
EA 23.102 Nightly
Loading...
Searching...
No Matches
RigidLeaf.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
3
public
class
RigidLeaf
:
RigidUpdate
4
{
5
public
float
floatPower
= 0.6f;
6
7
public
float
slidePower
= 15
f
;
8
9
private
Vector2
v
;
10
11
private
float
flip
= 1
f
;
12
13
private
float
time
;
14
15
private
float
maxTime
;
16
17
private
float
f
;
18
19
private
float
power
= 1
f
;
20
21
private
void
Awake
()
22
{
23
maxTime
=
Random
.Range(0.5
f
, 1.5
f
);
24
}
25
26
public
override
void
OnFixedUpdate
()
27
{
28
_ = base.transform.position;
29
if
(base.transform.position.y < 3
f
)
30
{
31
power
-= Time.fixedDeltaTime * 0.03f;
32
}
33
else
34
{
35
power
= 1
f
;
36
}
37
if
(!(
power
< 0
f
))
38
{
39
time
+=
flip
* 0.01f;
40
if
(
time
>
maxTime
)
41
{
42
maxTime
=
Random
.Range(0.5
f
, 1.5
f
);
43
time
=
maxTime
;
44
flip
= -1
f
;
45
}
46
else
if
(
time
< 0
f
)
47
{
48
maxTime
=
Random
.Range(0.5
f
, 1.5
f
);
49
time
= 0
f
;
50
flip
= 1
f
;
51
}
52
f
=
time
-
maxTime
* 0.5f;
53
v.x =
f
*
slidePower
*
power
;
54
v.y = (10
f
- Mathf.Clamp(((
f
> 0
f
) ?
f
: (0
f
-
f
)) * 10
f
, 0
f
, 10
f
)) *
floatPower
*
power
;
55
rb
.AddForce(
v
);
56
}
57
}
58
}
Rarity.Random
@ Random
RigidLeaf
Definition:
RigidLeaf.cs:4
RigidLeaf.power
float power
Definition:
RigidLeaf.cs:19
RigidLeaf.floatPower
float floatPower
Definition:
RigidLeaf.cs:5
RigidLeaf.v
Vector2 v
Definition:
RigidLeaf.cs:9
RigidLeaf.Awake
void Awake()
Definition:
RigidLeaf.cs:21
RigidLeaf.slidePower
float slidePower
Definition:
RigidLeaf.cs:7
RigidLeaf.flip
float flip
Definition:
RigidLeaf.cs:11
RigidLeaf.f
float f
Definition:
RigidLeaf.cs:17
RigidLeaf.time
float time
Definition:
RigidLeaf.cs:13
RigidLeaf.OnFixedUpdate
override void OnFixedUpdate()
Definition:
RigidLeaf.cs:26
RigidLeaf.maxTime
float maxTime
Definition:
RigidLeaf.cs:15
RigidUpdate
Definition:
RigidUpdate.cs:5
RigidUpdate.rb
Rigidbody2D rb
Definition:
RigidUpdate.cs:13
Elin
RigidLeaf.cs
Generated by
1.9.6