本文整理汇总了C#中KBEngine.isPlayer方法的典型用法代码示例。如果您正苦于以下问题:C# KBEngine.isPlayer方法的具体用法?C# KBEngine.isPlayer怎么用?C# KBEngine.isPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KBEngine
的用法示例。
在下文中一共展示了KBEngine.isPlayer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onAvatarEnterWorld
public void onAvatarEnterWorld(UInt64 rndUUID, Int32 eid, KBEngine.Avatar avatar)
{
if(!avatar.isPlayer())
return;
if (player != null)
return;
Dbg.DEBUG_MSG("[World createPlayer] create palyer success...");
if (avatar.isOnGround)
avatar.position.y = 1.3f;
if (!AttachEntityGameObject(avatar, true))
{
Dbg.ERROR_MSG(String.Format("[World onAvatarEnterWorld] AttachEntityGameObject failed, entity id: {0}, entity type: {1}", avatar.id, avatar.className));
return;
}
player = (UnityEngine.GameObject)avatar.renderObj;
player.GetComponent<GameEntity>().entityEnabled = false;
UI.inst.info("loading scene...(加载场景中...)");
Dbg.DEBUG_MSG("[World onAvatarEnterWorld] loading scene...");
SyncEntityPropertity(avatar);
//((UnityEngine.GameObject)avatar.renderObj).GetComponent<GameEntity>().OnEnterWorld();
}
示例2: onAvatarEnterWorld
public void onAvatarEnterWorld(UInt64 rndUUID, Int32 eid, KBEngine.Avatar avatar)
{
if(!avatar.isPlayer())
{
return;
}
UI.inst.info("loading scene...(加载场景中...)");
Debug.Log("loading scene...");
object speed = avatar.getDefinedPropterty("moveSpeed");
if(speed != null)
set_moveSpeed(avatar, speed);
object state = avatar.getDefinedPropterty("state");
if(state != null)
set_state(avatar, state);
object modelScale = avatar.getDefinedPropterty("modelScale");
if(modelScale != null)
set_modelScale(avatar, modelScale);
object name = avatar.getDefinedPropterty("name");
if(name != null)
set_entityName(avatar, (string)name);
object hp = avatar.getDefinedPropterty("HP");
if(hp != null)
set_HP(avatar, hp);
}
示例3: onAvatarEnterWorld
public void onAvatarEnterWorld(UInt64 rndUUID, Int32 eid, KBEngine.Avatar avatar)
{
if(!avatar.isPlayer())
{
return;
}
UI.inst.info("loading scene...(加载场景中...)");
Debug.Log("loading scene...");
}
示例4: set_MP_Max
public void set_MP_Max(KBEngine.Entity entity, object v)
{
object vv = entity.getDefinedPropterty("MP");
if(entity.isPlayer())
{
game_ui_autopos.updatePlayerBar_MP(vv, v);
}
else
{
game_ui_autopos.updateTargetBar_MP(vv, v);
}
}
示例5: set_moveSpeed
public void set_moveSpeed(KBEngine.Entity entity, object v)
{
if(enterSpace == false)
return;
float fspeed = ((float)(Byte)v) / 10f;
if(entity.isPlayer())
{
if(RPG_Controller.instance != null)
RPG_Controller.instance.walkSpeed = fspeed;
}
if(entity.renderObj != null)
{
((SceneEntityObject)entity.renderObj).set_moveSpeed(fspeed);
}
}
示例6: set_MP
public void set_MP(KBEngine.Entity entity, object v)
{
object vv = entity.getDefinedPropterty("MP_Max");
if(entity.renderObj != null)
{
object oldvv = entity.getDefinedPropterty("old_MP");
if(oldvv != null)
{
Int32 diff = (Int32)vv - (Int32)oldvv;
if(diff > 0)
{
((SceneEntityObject)entity.renderObj).addMP(diff);
}
entity.setDefinedPropterty("old_MP", vv);
}
else
entity.addDefinedPropterty("old_MP", vv);
}
if(entity.isPlayer())
{
game_ui_autopos.updatePlayerBar_MP(v, vv);
}
else
{
game_ui_autopos.updateTargetBar_MP(v, vv);
}
}
示例7: set_direction
public void set_direction(KBEngine.Entity entity)
{
if(enterSpace == false)
return;
if(entity.isPlayer() == false)
{
if(entity.renderObj != null)
{
((SceneEntityObject)entity.renderObj).destDirection = new Vector3(entity.direction.y, entity.direction.z, entity.direction.x);
//((SceneObject)entity.renderObj).rotation = new Vector3(entity.direction.y, entity.direction.z, entity.direction.x);
}
return;
}
RPG_Controller.initRot = new Vector3(entity.direction.y, entity.direction.z, entity.direction.x);
if(RPG_Controller.instance != null)
{
RPG_Controller.instance.transform.Rotate(RPG_Controller.rotation);
Common.DEBUG_MSG("KBEEventProc::set_direction: RPG_Controller.rotation=" + RPG_Controller.instance.transform.rotation);
}
}
示例8: set_level
public void set_level(KBEngine.Entity entity, object v)
{
if(game_ui_autopos.level_label == null)
return;
if(entity.isPlayer())
{
game_ui_autopos.level_label.text = "lv: " + v;
}
else
{
game_ui_autopos.target_level_label.text = "lv:" + v;
}
}
示例9: onEnterWorld
public void onEnterWorld(KBEngine.Entity entity)
{
Dbg.DEBUG_MSG(String.Format("[World onEnterWorld] entity id: {0}, entity type: {1}", entity.id, entity.className));
if(entity.isPlayer())
return;
if(entity.isOnGround)
entity.position.y = 1.3f;
if(!AttachEntityGameObject(entity, false))
{
Dbg.ERROR_MSG(String.Format("[World onEnterWorld] AttachEntityGameObject failed, entity id: {0}, entity type: {1}", entity.id, entity.className));
return;
}
PlayerController playerController = ((UnityEngine.GameObject)entity.renderObj).GetComponent<PlayerController>();
if (playerController)
playerController.enabled = false;
GameObjectMoveState moveState = ((UnityEngine.GameObject)entity.renderObj).GetComponent<GameObjectMoveState>();
if (moveState)
moveState.enabled = false;
onSetPosition(entity);
onSetDirection(entity);
SyncEntityPropertity(entity);
((UnityEngine.GameObject)entity.renderObj).GetComponent<GameEntity>().OnEnterWorld();
}
示例10: recvDamage
public void recvDamage(KBEngine.Entity entity, KBEngine.Entity attacker, Int32 skillID, Int32 damageType, Int32 damage)
{
if(enterSpace == false)
return;
if(attacker != null)
{
if(attacker.renderObj != null)
{
((SceneEntityObject)attacker.renderObj).attack(skillID, damageType, ((SceneEntityObject)entity.renderObj));
}
}
if(entity.renderObj != null)
{
if(CameraTargeting.inst != null && CameraTargeting.inst.lasttargetTransform == null && entity.isPlayer())
{
CameraTargeting.inst.setTarget(((SceneEntityObject)attacker.renderObj).gameEntity.transform);
TargetManger.setTarget((SceneEntityObject)attacker.renderObj);
}
((SceneEntityObject)entity.renderObj).recvDamage(skillID, damageType, damage);
}
}
示例11: set_state
public void set_state(KBEngine.Entity entity, object v)
{
if(enterSpace == false)
return;
if(entity.renderObj != null)
{
((SceneEntityObject)entity.renderObj).set_state((SByte)v);
}
if(entity.isPlayer())
{
RPG_Controller.enabled = ((SByte)v) != 1;
if(RPG_Controller.enabled == false)
game_ui_autopos.showRelivePanel();
else
game_ui_autopos.hideRelivePanel();
}
}
示例12: onEnterWorld
public void onEnterWorld(KBEngine.Entity entity)
{
if(entity.isPlayer())
return;
float y = entity.position.y;
if(entity.isOnGround)
y = 1.3f;
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;
((UnityEngine.GameObject)entity.renderObj).name = entity.className + "_" + entity.id;
}
示例13: set_position
public void set_position(KBEngine.Entity entity)
{
if (entity.renderObj == null)
return;
Vector3 v = (Vector3)entity.getDefinedProperty("position");
((UnityEngine.GameObject)entity.renderObj).GetComponent<GameEntity>().destPosition = v;
((UnityEngine.GameObject)entity.renderObj).GetComponent<GameEntity>().position = v;
if (entity.isPlayer())//第一次主角获取位置时,调整摄像头
{
Camera.main.GetComponent<SmoothFollow>().FollowUpdate();
if (isFirstPos)
{
Camera.main.GetComponent<SmoothFollow>().ResetView();
isFirstPos = false;
}
}
}
示例14: set_state
public void set_state(KBEngine.Entity entity, object v)
{
if (entity.renderObj != null)
{
if (((SByte)v) == 1)//死亡
{
((UnityEngine.GameObject)(entity.renderObj)).GetComponent<Animator>().Play("Dead");
}
else
{
((UnityEngine.GameObject)(entity.renderObj)).GetComponent<Animator>().Play("Idle");
}
}
if (entity.isPlayer())
{
Debug.Log("player->set_state: " + v);
UnityEngine.GameObject UIGame = UnityEngine.GameObject.FindGameObjectWithTag("UIGame");
if (((SByte)v) == 1)
{
UIGame.GetComponent<UI_Game>().tran_relive.gameObject.SetActive(true);
}
else
UIGame.GetComponent<UI_Game>().tran_relive.gameObject.SetActive(false);
return;
}
}
示例15: recvDamage
public void recvDamage(KBEngine.Entity entity, KBEngine.Entity attacker, Int32 skillID, Int32 damageType, Int32 damage)
{
Skill sk = SkillBox.inst.get(skillID);
if (sk != null)
{
Vector3 dir = entity.position - attacker.position;
UnityEngine.GameObject renderEntity = (UnityEngine.GameObject)attacker.renderObj;
renderEntity.GetComponent<Animator>().Play("Punch");
//显示技能效果
sk.displaySkill(attacker, entity);
if (attacker.isPlayer())
{
renderEntity.transform.LookAt(new Vector3(renderEntity.transform.position.x + dir.x, renderEntity.transform.position.y, renderEntity.transform.position.z + dir.z));
}
}
}