public void onEnterWorld(KBEngine.Entity entity)
{
if (entity.isPlayer())
{
return;
}
float y = entity.position.y;
if (entity.isOnGround)
{
y = 1.3f;
}
switch (entity.className)
{
case "Avatar":
entity.renderObj = Instantiate(proxyPrefab, new Vector3(entity.position.x, y, entity.position.z),
Quaternion.Euler(new Vector3(entity.direction.y, entity.direction.z, entity.direction.x))) as UnityEngine.GameObject;
break;
case "Npc":
case "Monster":
case "Gate":
default:
entity.renderObj = Instantiate(entityPerfab, new Vector3(entity.position.x, y, entity.position.z),
Quaternion.Euler(new Vector3(entity.direction.y, entity.direction.z, entity.direction.x))) as UnityEngine.GameObject;
break;
}
((UnityEngine.GameObject)entity.renderObj).name = entity.className + "_" + entity.id;
}