Skip to content

Commit 45f72dc

Browse files
author
kbengine
committed
up
1 parent 1136f00 commit 45f72dc

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed
498 Bytes
Binary file not shown.

Assets/Scripts/u3d_scripts/GameEntity.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,12 @@ void FixedUpdate ()
183183
{
184184
if (!entityEnabled)
185185
return;
186-
186+
187187
if(isPlayer == false && KBEngineApp.app != null)
188188
return;
189189

190-
KBEngine.Entity player = KBEngineApp.app.player();
191-
192-
if(player != null)
193-
{
194-
player.position.x = gameObject.transform.position.x;
195-
player.position.y = gameObject.transform.position.y;
196-
player.position.z = gameObject.transform.position.z;
197-
198-
player.direction.z = gameObject.transform.rotation.eulerAngles.y;
199-
}
190+
KBEngine.Event.fireIn("updatePlayer", gameObject.transform.position.x,
191+
gameObject.transform.position.y, gameObject.transform.position.z, gameObject.transform.rotation.eulerAngles.y);
200192
}
201193

202194
void Update ()

Assets/Scripts/u3d_scripts/UI.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,12 @@ void OnDestroy()
6868
}
6969

7070
// Update is called once per frame
71-
void Update ()
71+
void Update ()
7272
{
7373
if (Input.GetKeyUp(KeyCode.Space))
7474
{
7575
Debug.Log("KeyCode.Space");
76-
77-
if(KBEngineApp.app.entity_type == "Avatar")
78-
{
79-
KBEngine.Avatar avatar = (KBEngine.Avatar)KBEngineApp.app.player();
80-
if(avatar != null)
81-
avatar.jump();
82-
}
76+
KBEngine.Event.fireIn("jump");
8377
}
8478
}
8579

0 commit comments

Comments
 (0)