KBEngine.Entity.isPlayer C# (CSharp) Méthode

isPlayer() public méthode

public isPlayer ( ) : bool
Résultat bool
        public bool isPlayer()
        {
            return id == KBEngineApp.app.entity_id;
        }

Usage Example

Exemple #1
0
    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;
    }
All Usage Examples Of KBEngine.Entity::isPlayer