public static float GetMyPlayerPower() { //var info = GameGOW.Get().MyPlayer.m_pInfo; var info = GameGOW.Get().BattleMgr.m_pCurrentPlayer.m_pInfo; return(info.m_iBombSpeed * 1.0f / info.m_pInstructionData.fire_range); }
public static void InputAngle(int type) { if (GameGOW.Get().BattleMgr.m_bIsInBattle == false) { return; } if (Network.gamemode == BattleType.AI_1v1) { int index = GameGOW.Get().BattleMgr.m_iCurrentRoundPlayerIndex; int id = GameGOW.Get().BattleMgr.m_stBattleInfo.m_listPlayers[index].m_iPlayerUID; if (Network.playerid == id) { var m_pCharacterLogic = GameGOW.Get().BattleMgr.m_pCurrentPlayer; m_pCharacterLogic.OnAttackAngleChange(type); } } else if (Network.NetworkMode == true) { int index = GameGOW.Get().BattleMgr.m_iCurrentRoundPlayerIndex; int id = GameGOW.Get().BattleMgr.m_stBattleInfo.m_listPlayers[index].m_iPlayerUID; if (Network.playerid == id) { var m_pCharacterLogic = GameGOW.Get().BattleMgr.m_pCurrentPlayer; m_pCharacterLogic.OnAttackAngleChange(type); } } else { var m_pCharacterLogic = GameGOW.Get().BattleMgr.m_pCurrentPlayer; m_pCharacterLogic.OnAttackAngleChange(type); } }
public void SetData(MapData pData) { m_pCamera.xMargin = pData.camera_margin_x; m_pCamera.yMargin = pData.camera_margin_y; m_pCamera.xSmooth = pData.camera_smooth_x; m_pCamera.ySmooth = pData.camera_smooth_y; m_pCamera.minXAndY = new Vector2(pData.camera_min_x, pData.camera_min_y); m_pCamera.maxXAndY = new Vector2(pData.camera_max_x, pData.camera_max_y); m_pCamera.BgWidth = pData.m_listBG[0].Width; m_pCamera.TerrainWidth = pData.m_listTerrain[0].Width; ResourceManager mgr = GameGOW.Get().ResourceMgr; for (int i = 0; i < pData.m_listBG.Count; ++i) { MapCellData cellData = pData.m_listBG[i]; GameObject obj = mgr.GetRes("Prefab/MapCell"); SpriteRenderer spr = obj.GetComponent <SpriteRenderer>(); Texture2D texture = mgr.GetRes <Texture2D>(cellData.resource); //因为背景图很大,需要压缩,而压缩后长宽会改变,所以需要Bilinear将长宽设置回原图的值,又因为压缩格式的图片不能重新设置尺寸,所以需要重新创建一张图 //创建一张图片 var newTexture = new Texture2D(texture.width, texture.height); //设置像素 newTexture.SetPixels(texture.GetPixels()); //应用更改 newTexture.Apply(); //设置图片尺寸 TextureScale.Bilinear(newTexture, cellData.Width, cellData.Height); //创建Sprite Rect rect = new Rect(0, 0, newTexture.width, newTexture.height); Sprite sp = Sprite.Create(newTexture, rect, new Vector2(0, 0)); spr.sprite = sp; obj.transform.parent = m_pBackGroundLayer; obj.transform.localPosition = new Vector3(cellData.pos_x, cellData.pos_y, m_pBackGroundLayer.position.z - i * 0.01f); } }
public static void Send_Skip() { if (Network.gamemode == BattleType.AI_1v1) { if (Network.Attacking == 0) { if (GameGOW.Get().BattleMgr.m_pCurrentPlayer.ID == Network.playerid) { EventDispatcher.DispatchEvent("EventHideBattleJoyStickUI", null, null); } else { EventDispatcher.DispatchEvent("EventShowBattleJoyStickUI", null, null); } GameGOW.Get().BattleMgr.ChangeController_Quick(); if (GameGOW.Get().BattleMgr.Get_InBattle() == true && GameGOW.Get().BattleMgr.m_iCurrentRoundPlayerIndex % 2 == 1) { GameGOW.Get().AIMgr.Act_AI_1v1(); } } } else if (Network.NetworkMode == true) { Network.Send_SKIP(); } else { GameGOW.Get().BattleMgr.ChangeController(); } }
public void PlaySound(int temp, string name) { if (temp == 1) { EfxSource.clip = GameGOW.Get().ResourceMgr.GetRes <AudioClip>(name); EfxSource.Play(); } else if (temp == 0) { if (name == "music") { MusicSource.Stop(); } else { EfxSource.Stop(); } } else if (temp == -1) { MusicSource.Stop(); MusicSource.clip = GameGOW.Get().ResourceMgr.GetRes <AudioClip>(name); MusicSource.Play(); } else if (temp == 2) { SpeakSource.clip = GameGOW.Get().ResourceMgr.GetRes <AudioClip>(name); SpeakSource.Play(); } else if (temp == 3) { ElseSource.clip = GameGOW.Get().ResourceMgr.GetRes <AudioClip>(name); ElseSource.Play(); } }
public static void InputFunctionUp(int type) { if (GameGOW.Get().BattleMgr.m_bIsInBattle == false) { return; } if (Network.gamemode == BattleType.AI_1v1) { int index = GameGOW.Get().BattleMgr.m_iCurrentRoundPlayerIndex; int id = GameGOW.Get().BattleMgr.m_stBattleInfo.m_listPlayers[index].m_iPlayerUID; if (Network.playerid == id && Network.Attacking == 1) { Network.Attacking = 2; var m_pCharacterLogic = GameGOW.Get().BattleMgr.m_pCurrentPlayer; m_pCharacterLogic.OnFunctionKeyUp(type); } } else if (Network.NetworkMode == true) { int index = GameGOW.Get().BattleMgr.m_iCurrentRoundPlayerIndex; int id = GameGOW.Get().BattleMgr.m_stBattleInfo.m_listPlayers[index].m_iPlayerUID; if (Network.playerid == id && Network.Attacking == 1) { Network.Attacking = 2; var m_pCharacterLogic = GameGOW.Get().BattleMgr.m_pCurrentPlayer; m_pCharacterLogic.OnFunctionKeyUp(type); Network.Send_Attach(false); } } else { var m_pCharacterLogic = GameGOW.Get().BattleMgr.m_pCurrentPlayer; m_pCharacterLogic.OnFunctionKeyUp(type); } }
public static float GetMyPlayerEnergy() { //var info = GameGOW.Get().MyPlayer.m_pInfo; var info = GameGOW.Get().BattleMgr.m_pCurrentPlayer.m_pInfo; return(info.m_iMoveEnergy * 1.0f / info.m_iMaxMoveEnergy); }
public static void SetAni(int id, GameObject anitest) { anitest.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f); anitest = GameGOW.Get().ResourceMgr.GetRes("Spine/TK100001"); test = anitest.GetComponent <SkeletonAnimation>(); test.loop = true; test.AnimationName = "IDLE1"; }
void Start() { // Debug.Log("AAAAAAAAAAAAA "); prevScale = particleScale; GameGOW.Get().OnWindPlay += Control_Wind; gameObject.SetActive(false); }
private void ShowMessage(int id) { string path = GameGOW.Get().DataMgr.GetChatByID(id).chat_text; Message.GetComponent <TextMesh>().text = path; MessageBg.gameObject.SetActive(true); _messageCd = 2f; }
public static int SetMatchTime(int time) { if (time >= 0) { GameGOW.Get().match_time = time; } return(GameGOW.Get().match_time); }
// Use this for initialization void Start() { GameGOW.Get().CharacterMgr.OnCharacterNew += AddCharacter; GameGOW.Get().CharacterMgr.OnCharacterDelete += DeleteCharacter; GameGOW.Get().BombMgr.OnBombNew += AddBomb; GameGOW.Get().BombMgr.OnBombDelete += DeleteBomb; GameGOW.Get().MapMgr.OnTerrainCellNew += AddTerrainCell; AddEvents(); }
public void AddCharacter(CharacterLogic logic) { GameObject obj = GameGOW.Get().ResourceMgr.GetRes("Prefab/CharacterLogic"); CharacterLogicView view = obj.GetComponent <CharacterLogicView>(); view.SetCharacterLogic(logic); obj.transform.parent = m_pZSort; m_dicCharacterView[logic.ID] = view; }
public static float GetMyPlayerWait() { var info = GameGOW.Get().BattleMgr.m_pCurrentPlayer.m_pInfo; return(info.m_iHP * 1.0f / info.m_iMaxHP); //return info.MoveEnergy * 100.0f / info.m_iMaxMoveEnergy; //var time = GameGOW.Get().BattleMgr.m_iCurrentRoundTime; //return time * 1.0f / BattleManager.ROUND_TIME; }
public void Init() { SpeakSource.volume = 0.65f; MusicSource.volume = 0.5f; //背景音乐音量 EfxSource.volume = 0.55f; //音效音量 ElseSource.volume = 0.55f; MusicSource.clip = GameGOW.Get().ResourceMgr.GetRes <AudioClip>("sound/Music/battlebg_4"); MusicSource.Play(); }
public static int GetSetEnergy(int energy) { var info = GameGOW.Get().BattleMgr.m_pCurrentPlayer.m_pInfo; if (energy > 0) { info.m_iMoveEnergy = energy; } return(info.m_iMoveEnergy); }
public static void Show_Message(int id) { var info = GameGOW.Get().BattleMgr.m_pCurrentPlayer.m_pInfo; if (Network.NetworkMode == true) { info = GameGOW.Get().CharacterMgr.GetCharacterByUid(Network.playerid).m_pInfo; } info.MessageID = id + 2000; }
public static float GetAngle() { var m_pCharacterLogic = GameGOW.Get().BattleMgr.m_pCurrentPlayer; float angle = m_pCharacterLogic.GetFireAngle() + m_pCharacterLogic.CalcObjectAngle(); if (m_pCharacterLogic.m_pInfo.m_iFacing == GameDefine.FACING_LEFT) { angle *= -1; } return(angle); // Math.Abs(angle); }
public void AddTerrainCell(Texture2D texture, MapCellData pData) { GameObject obj = GameGOW.Get().ResourceMgr.GetRes("Prefab/MapCell"); SpriteRenderer spr = obj.GetComponent <SpriteRenderer>(); Rect rect = new Rect(0, 0, texture.width, texture.height); Sprite sp = Sprite.Create(texture, rect, new Vector2(0, 0)); spr.sprite = sp; obj.transform.parent = m_pTerrainLayer; obj.transform.localPosition = new Vector3(pData.pos_x, pData.pos_y, m_pBackGroundLayer.position.z - m_pTerrainLayer.childCount * 0.01f); }
private void ShowEmoji(int id) { string path = GameGOW.Get().DataMgr.GetImageByID(id).image_source; Emoji.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>(path); Emoji.gameObject.SetActive(true); if (_emojiScaleTweener != null) { _emojiScaleTweener.Restart(false); } _emojiCd = 2f; }
public static void Send_Quit_Button() { //GameGOW.Get().BattleMgr.StopBattle(); GameGOW.Get().BattleMgr.m_bIsInBattle = false; if (Network.gamemode == BattleType.AI_1v1) { } else if (Network.NetworkMode == true) { Network.Send_Quit(); } }
protected virtual void gui() { GameGOW compoment = (GameGOW)target; EditorGUI.BeginChangeCheck(); EditorGUILayout.Space(); if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); } }
public static string GetSkillInfo(string type, int id) { if (type == "NAME") { return(GameGOW.Get().DataMgr.GetSkillINstructionDataByID(id).default_name); } if (type == "DESCRIPTION") { return(GameGOW.Get().DataMgr.GetSkillINstructionDataByID(id).description); } return("???"); }
public static float GetSkillInfo2(string type, int id) { if (id == 100) { id = 0; } if (type == "ENERGY") { return(GameGOW.Get().DataMgr.GetSkillINstructionDataByID(id).energy); } return(0.0f); }
private void OnBattleStart(object sender, EventArgs e) { LuaFramework.Util.SendMessageToLua("EventBattleStart"); ChangeControllerEvent chgEvent = e as ChangeControllerEvent; if (chgEvent != null && m_dicCharacterView.ContainsKey(chgEvent.m_iUniqueID)) { CharacterLogicView view = m_dicCharacterView[chgEvent.m_iUniqueID]; m_pCamera.SetFocus(view.transform); } GameGOW.Get().PlayWind(1, 0.0f, true); GameGOW.Get().MapMgr.Wind = 0; //BackgroundParallax.Get().SetCamera(); }
public static string GetCharacterName(string ans) { if (ans == "wechat") { if (SdkManager.wxLogin == true) { return(SdkManager.wxName); } else { return(null); } } return(GameGOW.Get().DataMgr.GetCharaterName(ans)); }
public void Update() { ScanMSGs(); if (state == NetworkState.Disconnected) { //MessageBox.Instance.Show("已经断开连接,请刷新页面重新链接!", OnDisconnect); #if xue if (NetworkConfig.Click_Exit_Button == true) { NetworkConfig.Click_Exit_Button = false; } else { GameGOW.Get().BattleMgr.m_bIsInBattle = false; EventDispatcher.DispatchEvent("EventShowMessageUI", null, null); } #endif state = NetworkState.None; } if (client != null && client.Connected) { if (Time.realtimeSinceStartup - lastBeatSendTime >= heartBeatInterval) { //Network.Send_Heart(); //发送心跳包 } if (lastBeatRecvTimeOut != 0 && Time.realtimeSinceStartup >= lastBeatRecvTimeOut) { PromptDisconnect(); return; } } fCheckTimer += Time.deltaTime; if (fCheckTimer > 3f) { fCheckTimer = 0f; //Debug.LogError("Check one time"); if (client == null || !client.Connected) { PromptDisconnect(); return; } } }
public void AddBomb(BaseBomb logic, bool is_foucs) { GameObject bombView = GameGOW.Get().ResourceMgr.GetRes("Prefab/BaseBomb"); bombView.transform.position = new Vector3(logic.Position.x, logic.Position.y, 5); BombView view = bombView.GetComponent <BombView>(); view.SetBombLogic(logic); view.transform.parent = m_pZSort; m_dicBombView[logic.ID] = view; if (is_foucs) { m_pCamera.SetFocus(bombView.transform); } }
public static string GetTankInfo(string type, int id) { if (type == "NAME") { return(GameGOW.Get().DataMgr.GetCharacterInstructionByID(id).default_name); } if (type == "SKILL") { return(GameGOW.Get().DataMgr.GetCharacterInstructionByID(id).self_skill.ToString()); } if (type == "DECRIP") { return(GameGOW.Get().DataMgr.GetCharacterInstructionByID(id).description); } return("????"); }
IEnumerator DelayNet(int Bombid, bool kind, float x, float y) //延迟发炮,delay_time 为延迟时间 { while (GameGOW.Get().BombMgr.GetBombByUID(Bombid) == null) { yield return(null); } GameGOW.Get().BombMgr.GetBombByUID(Bombid).Boom_pos = new Vector2(x, y); if (kind == false) { GameGOW.Get().BombMgr.GetBombByUID(Bombid).Net_Boom_Status = 1; //BaseBomb.Net_Boom_Status = 1; } else { GameGOW.Get().BombMgr.GetBombByUID(Bombid).Net_Boom_Status = 2; //BaseBomb.Net_Boom_Status = 2; } }