本文整理汇总了C#中KBEngine类的典型用法代码示例。如果您正苦于以下问题:C# KBEngine类的具体用法?C# KBEngine怎么用?C# KBEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KBEngine类属于命名空间,在下文中一共展示了KBEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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();
}
示例3: AttachEntityGameObject
public bool AttachEntityGameObject(KBEngine.Entity entity, bool isPlayer)
{
UnityEngine.GameObject obj = null;
Vector3 position = new Vector3(entity.position.x, entity.position.y, entity.position.z);
Quaternion rotation = Quaternion.Euler(new Vector3(0, 0, 0));
obj = GameObjectManager.GetInstance().CreateGameObject(entity.className, position, rotation);
if (!obj)
return false;
GameEntity gameEntity = obj.GetComponent<GameEntity>();
if (gameEntity)
{
gameEntity.entityEnabled = true;
gameEntity.isSync = false;
gameEntity.isPlayer = isPlayer;
gameEntity.entity = entity;
}
entity.renderObj = obj;
obj.name = entity.className + "_" + entity.id;
return true;
}
示例4: validCast
public bool validCast(KBEngine.Entity caster, SCObject target)
{
float dist = Vector3.Distance(target.getPosition(), caster.position);
if(dist > canUseDistMax)
return false;
return true;
}
示例5: onAvatarEnterWorld
public void onAvatarEnterWorld(UInt64 rndUUID, Int32 eid, KBEngine.Avatar avatar)
{
if(!avatar.isPlayer())
{
return;
}
UI.inst.info("loading scene...(加载场景中...)");
Debug.Log("loading scene...");
}
示例6: displaySkill
public void displaySkill(KBEngine.Entity caster, KBEngine.Entity target)
{
if (displayType == Skill_DisplayType.SkillDisplay_Event_Bullet)
{
UnityEngine.GameObject renderObj = UnityEngine.Object.Instantiate(SkillBox.inst.dictSkillDisplay[skillEffect]) as UnityEngine.GameObject;
NcEffectFlying fly = renderObj.AddComponent<NcEffectFlying>();
fly.FromPos = caster.position;
fly.FromPos.y = 1f;
fly.ToPos = target.position;
fly.ToPos.y = 1f;
//fly.Speed = 5.0f;
//fly.HWRate = 0;
}
else if (displayType == Skill_DisplayType.SkillDisplay_Event_Effect)
{
Vector3 pos = target.position;
pos.y = 1f;
UnityEngine.Object.Instantiate(SkillBox.inst.dictSkillDisplay[skillEffect], pos, Quaternion.identity);
}
}
示例7: valid
public override bool valid(KBEngine.Entity caster)
{
return true;
}
示例8: onEnterWorld
public void onEnterWorld(KBEngine.Entity entity)
{
if(enterSpace == false)
{
pendingEnterEntityIDs.Add(entity.id);
return;
}
Asset newasset = Scene.findAsset(entity.getDefinedPropterty("modelID") + ".unity3d", true, "");
newasset.createAtScene = loader.inst.currentSceneName;
SceneEntityObject obj = new SceneEntityObject();
obj.kbentity = entity;
if(entity.isPlayer())
obj.createPlayer();
else
obj.create();
entity.renderObj = obj;
Scene scene = null;
if(!loader.inst.scenes.TryGetValue(loader.inst.currentSceneName, out scene))
{
Common.ERROR_MSG("KBEEventProc::onEnterWorld: not found scene(" + loader.inst.currentSceneName + ")!");
return;
}
newasset.loadLevel = Asset.LOAD_LEVEL.LEVEL_IDLE;
obj.asset = newasset;
obj.idkey = "_entity_" + entity.id;
Vector3 pos = obj.position;
Common.calcPositionY(pos, out pos.y, false);
if(entity.getDefinedPropterty("modelID") == "20002001")
pos.y += 15.0f;
obj.position = pos;
obj.position = entity.position;
obj.eulerAngles = new Vector3(entity.direction.y, entity.direction.z, entity.direction.x);
obj.destDirection = obj.eulerAngles;
object name = entity.getDefinedPropterty("name");
if(name != null)
obj.setName((string)name);
object hp = entity.getDefinedPropterty("HP");
if(hp != null)
obj.updateHPBar((Int32)hp, (Int32)entity.getDefinedPropterty("HP_Max"));
object state = entity.getDefinedPropterty("state");
if(state != null)
set_state(entity, state);
object modelScale = entity.getDefinedPropterty("modelScale");
if(modelScale != null)
set_modelScale(entity, modelScale);
object speed = entity.getDefinedPropterty("moveSpeed");
if(speed != null)
{
set_moveSpeed(entity, speed);
}
if(entity.className == "Avatar")
newasset.unloadLevel = Asset.UNLOAD_LEVEL.LEVEL_FORBID;
newasset.refs.Add(obj.idkey);
scene.addSceneObject(obj.idkey, obj);
if(newasset.isLoaded || newasset.bundle != null)
{
obj.Instantiate();
newasset.refs.Remove(obj.idkey);
}
else
{
loader.inst.loadPool.addLoad(newasset);
loader.inst.loadPool.start();
}
}
示例9: update_position
public void update_position(KBEngine.Entity entity)
{
if(enterSpace == false)
return;
if(entity.renderObj != null)
{
((SceneEntityObject)entity.renderObj).update_position(entity.position);
}
}
示例10: set_position
public void set_position(KBEngine.Entity entity)
{
if(entity.renderObj != null)
{
Common.calcPositionY(entity.position, out entity.position.y, false);
((SceneObject)entity.renderObj).position = entity.position;
((SceneEntityObject)entity.renderObj).destPosition = entity.position;
}
if(entity.isPlayer() == false)
return;
entity.position = (Vector3)entity.getDefinedPropterty("position");
RPG_Controller.initPos.x = entity.position.x;
RPG_Controller.initPos.y = entity.position.y;
RPG_Controller.initPos.z = entity.position.z;
if(RPG_Controller.instance != null)
{
RPG_Controller.instance.transform.position = RPG_Controller.initPos;
Common.DEBUG_MSG("KBEEventProc::set_position: entity.position=" + entity.position + " " + entity.getDefinedPropterty("position") + ", RPG_Controller.position=" + RPG_Controller.instance.transform.position);
}
}
示例11: 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);
}
}
示例12: 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);
}
}
示例13: set_state
public void set_state(KBEngine.Entity entity, object v)
{
if(entity.renderObj != null)
{
((UnityEngine.GameObject)entity.renderObj).GetComponent<GameEntity>().set_state((SByte)v);
}
if(entity.isPlayer())
{
Debug.Log("player->set_state: " + v);
if(((SByte)v) == 1)
showReliveGUI = true;
else
showReliveGUI = false;
return;
}
}
示例14: set_position
public void set_position(KBEngine.Entity entity)
{
if(entity.renderObj == null)
return;
((UnityEngine.GameObject)entity.renderObj).GetComponent<GameEntity>().destPosition = entity.position;
((UnityEngine.GameObject)entity.renderObj).GetComponent<GameEntity>().position = entity.position;
}
示例15: set_MP_Max
public void set_MP_Max(KBEngine.Entity entity, object v)
{
}