public getDefinedProperty ( string name ) : object | ||
name | string | |
Результат | object |
public void set_fightValue(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("fightValue"); PlayerMediator.playerInfo.fightValue = int.Parse(v.ToString()); if (MainMediator.mainMediator == null) { return; } Facade.SendNotification(NotificationID.Fight_Change); }
public void set_bagSize(KBEngine.Entity entity, object obj) { obj = entity.getDefinedProperty("bagSize"); if (BagMediator.bagMediator != null) { BagMediator.bagMediator.AddBagSizeSucess(int.Parse(obj.ToString())); } else { BagMediator.bagSize = int.Parse(obj.ToString()); } }
public void set_diamond(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("diamond"); PlayerMediator.playerInfo.diamond = int.Parse(v.ToString()); if (GoldMediator.goldMediator != null) { GoldMediator.goldMediator.GoldChangeCall("diamond"); } if (GameShopMediator.gameShopMediator != null) { GameShopMediator.gameShopMediator.panel.moneyLabel.text = PlayerMediator.playerInfo.diamond.ToString(); } }
public void set_euro(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("euro"); PlayerMediator.playerInfo.euro = int.Parse(v.ToString()); if (GoldMediator.goldMediator != null) { GoldMediator.goldMediator.GoldChangeCall("euro"); } if (GameShopMediator.gameShopMediator != null) { GameShopMediator.gameShopMediator.panel.moneyLabel.text = PlayerMediator.playerInfo.euro.ToString(); } if (GuildDonationMediator.guilddonationMediator != null) { GuildDonationMediator.guilddonationMediator.panel.myEuro_label.text = PlayerMediator.playerInfo.euro.ToString(); } }
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; } } }
public void set_guildDonate(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("guildDonate"); int hasDonate = GameConvert.IntConvert(v) - PlayerMediator.playerInfo.guildDonate; PlayerMediator.playerInfo.guildDonate = int.Parse(v.ToString()); if (GameShopMediator.gameShopMediator != null) { GameShopMediator.gameShopMediator.panel.moneyLabel.text = PlayerMediator.playerInfo.guildDonate.ToString(); } if (GuildDonationMediator.guilddonationMediator != null) { string content = string.Format(TextManager.GetSystemString("ui_system_guild21"), hasDonate); GUIManager.SetJumpText(content); GuildDonationMediator.guilddonationMediator.panel.gongxian_label.text = PlayerMediator.playerInfo.guildDonate.ToString(); } if (GuildMainMediator.guildmainMediator != null) { GuildMainMediator.guildmainMediator.panel.gongxian_label.text = PlayerMediator.playerInfo.guildDonate.ToString(); } }
public void onEnterWorld(KBEngine.Entity entity) { Debug.Log("onEnterWorld"); if (entity.isPlayer()) { return; } Debug.Log("entity id:" + entity.className + " - " + entity.id); //Debug.Log (); //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; switch (entity.className) { case "Avatar": sEntityManager.GetInstance().pushEntity(entity.id, entity.position, entity.className); break; case "Monster": case "NPC": { int tid = int.Parse(entity.getDefinedProperty("uid").ToString()); data_entity tmp = null; if (sLoadBin_entity.instance.data.TryGetValue(tid, out tmp)) { sEntityManager.GetInstance().pushEntity(entity.id, entity.position, tmp.ModelName, entity.className); } } break; } }
public void set_benchSize(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("benchSize"); PlayerMediator.playerInfo.benchSize = int.Parse(v.ToString()); }
public void onEnterWorld(KBEngine.Entity entity) { if (entity.isPlayer()) { return; } float y = entity.position.y; if (entity.isOnGround) { y = 0.0f; } if (entity.className == "Gate") { entity.renderObj = Instantiate(gatePerfab, 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)).GetComponent <GameEntity>().entityDisable(); } else if (entity.className == "Monster") { entity.renderObj = Instantiate(otherPlayerPerfab, 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; } else if (entity.className == "DroppedItem") { entity.renderObj = Instantiate(droppedItemPerfab, 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; } else if (entity.className == "Avatar") { entity.renderObj = Instantiate(otherPlayerPerfab, 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; } else if (entity.className == "NPC") { entity.renderObj = Instantiate(otherPlayerPerfab, 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; set_position(entity); set_direction(entity); //object speed = entity.getDefinedProperty("moveSpeed"); //if (speed != null) // set_moveSpeed(entity, speed); object state = entity.getDefinedProperty("state"); if (state != null) { set_state(entity, state); } //object modelScale = entity.getDefinedProperty("modelScale"); //if (modelScale != null) // set_modelScale(entity, modelScale); object name = entity.getDefinedProperty("name"); if (name != null) { set_entityName(entity, (string)name); } object hp = entity.getDefinedProperty("HP"); if (hp != null) { set_HP(entity, hp); } object hpMax = entity.getDefinedProperty("HP_Max"); if (hpMax != null) { set_HP_Max(entity, hpMax); } object equipWeapon = entity.getDefinedProperty("equipWeapon"); if (equipWeapon != null) { set_equipWeapon(entity, (Int32)equipWeapon); } }
public void set_photoIndex(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("photoIndex"); PlayerMediator.playerInfo.photoIndex = v.ToString(); }
public void set_roleId(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("roleId"); PlayerMediator.playerInfo.roleId = int.Parse(v.ToString()); }
public void set_name(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("name"); PlayerMediator.playerInfo.name = v.ToString(); }
public void set_myRank(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("myRank"); PlayerMediator.playerInfo.myRank = int.Parse(v.ToString()); }
public void set_arenaTimes(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("arenaTimes"); PlayerMediator.playerInfo.arenaTimes = int.Parse(v.ToString()); }
public void set_guildPower(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("guildPower"); PlayerMediator.playerInfo.guildPower = int.Parse(v.ToString()); }
public void set_diamondLastTime(KBEngine.Entity entity, object old) { old = entity.getDefinedProperty("diamondLastTime"); CardMediator.cardInfo.diamondLastTime = int.Parse(old.ToString()); CardPanelCall(CardType.Diamond); }
public void set_job(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("job"); PlayerMediator.playerInfo.job = int.Parse(v.ToString()); }
public void set_tenFirstCall(KBEngine.Entity entity, object old) { old = entity.getDefinedProperty("tenFirstCall"); CardMediator.cardInfo.tenFirstCall = int.Parse(old.ToString()); }
public void set_club(KBEngine.Entity entity, object v) { v = entity.getDefinedProperty("club"); PlayerMediator.playerInfo.club = v.ToString(); }
public void onEnterWorld(KBEngine.Entity entity) { if (enterSpace == false) { pendingEnterEntityIDs.Add(entity.id); return; } Asset newasset = Scene.findAsset(entity.getDefinedProperty("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; obj.position = entity.position; obj.eulerAngles = new Vector3(entity.direction.y, entity.direction.z, entity.direction.x); obj.destDirection = obj.eulerAngles; object name = entity.getDefinedProperty("name"); if (name != null) { obj.setName((string)name); } object hp = entity.getDefinedProperty("HP"); if (hp != null) { obj.updateHPBar((Int32)hp, (Int32)entity.getDefinedProperty("HP_Max")); } object state = entity.getDefinedProperty("state"); if (state != null) { set_state(entity, state); } object modelScale = entity.getDefinedProperty("modelScale"); if (modelScale != null) { set_modelScale(entity, modelScale); } object speed = entity.getDefinedProperty("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(); } }
void Update() { if (Camera.main == null) { Common.DEBUG_MSG("RPG_Controller::Update: not ready!"); return; } if (characterController == null) { Common.DEBUG_MSG("Error: No Character Controller component found! Please add one to the GameObject which has this script attached."); return; } if (WorldManager.currinst != null) { WorldManager.ChunkPos currChunk = WorldManager.currinst.atChunk(); if (currChunk.x >= 0 && currChunk.y >= 0) { if (WorldManager.currinst.loadedChunk(currChunk) == false) { canControl = 0; showAlert(true); Common.DEBUG_MSG("RPG_Controller::Update: wait for load(" + (currChunk.x + 1) + "," + (currChunk.y + 1) + "), currpos=" + transform.position); return; } if (WorldManager.currinst.loadedWorldObjsCamera() == false) { canControl = 0; showAlert(true); Common.DEBUG_MSG("RPG_Controller::Update: wait for load(worldObject)!"); return; } if (canControl < 5) { canControl += 1; return; } if (enabled == false) { // Common.DEBUG_MSG("RPG_Controller::Update: enabled = false!"); if (isShowAlert == true) { showAlert(false); } return; } KBEngine.Entity player = KBEngineApp.app.player(); if (player == null) { return; } walkSpeed = ((float)(Byte)player.getDefinedProperty("moveSpeed")) / 10f; // 每秒速度 } } GetInput(); StartMotor(); if (isShowAlert == true) { showAlert(false); } }
public void set_HP_Max(KBEngine.Entity entity, object v) { if (entity.renderObj != null) { ((UnityEngine.GameObject)entity.renderObj).GetComponent <GameEntity>().hp = (Int32)entity.getDefinedProperty("HP") + "/" + (Int32)v; } }
public void set_euroFreeTimes(KBEngine.Entity entity, object old) { old = entity.getDefinedProperty("euroFreeTimes"); CardMediator.cardInfo.euroFreeTimes = int.Parse(old.ToString()); CardPanelCall(CardType.Free); }