Skip to content

Commit 12bccab

Browse files
committed
修正可能掉入地下的bug。
1 parent 61e815e commit 12bccab

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Assets/Scripts/GameEntity.cs

436 Bytes
Binary file not shown.

Assets/Scripts/UI.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
using System.Collections.Generic;
77
using System.Linq;
88

9-
public class UI : MonoBehaviour {
10-
9+
public class UI : MonoBehaviour
10+
{
1111
public int ui_state = 0;
1212
private string stringAccount = "";
1313
private string stringPasswd = "";
@@ -450,6 +450,8 @@ public void addSpaceGeometryMapping(string respath)
450450
info("scene(" + respath + "), spaceID=" + KBEngineApp.app.spaceID);
451451
if(terrain == null)
452452
terrain = Instantiate(terrainPerfab) as UnityEngine.GameObject;
453+
454+
player.GetComponent<GameEntity>().enable();
453455
}
454456

455457
public void onAvatarEnterWorld(UInt64 rndUUID, Int32 eid, KBEngine.Avatar avatar)
@@ -505,7 +507,8 @@ public void createPlayer()
505507

506508
player = Instantiate(avatarPerfab, new Vector3(avatar.position.x, y, avatar.position.z),
507509
Quaternion.Euler(new Vector3(avatar.direction.y, avatar.direction.z, avatar.direction.x))) as UnityEngine.GameObject;
508-
510+
511+
player.GetComponent<GameEntity>().disable();
509512
avatar.renderObj = player;
510513
((UnityEngine.GameObject)avatar.renderObj).GetComponent<GameEntity>().isPlayer = true;
511514
}
@@ -526,7 +529,7 @@ public void onEnterWorld(KBEngine.Entity entity)
526529

527530
entity.renderObj = Instantiate(entityPerfab, new Vector3(entity.position.x, y, entity.position.z),
528531
Quaternion.Euler(new Vector3(entity.direction.y, entity.direction.z, entity.direction.x))) as UnityEngine.GameObject;
529-
532+
530533
((UnityEngine.GameObject)entity.renderObj).name = entity.classtype + entity.id;
531534

532535
object speed = entity.getDefinedPropterty("moveSpeed");

0 commit comments

Comments
 (0)