Skip to content

Commit

Permalink
切换到unity 2020,退出关卡卡顿黑屏,OverlapBox崩溃都没了
Browse files Browse the repository at this point in the history
  • Loading branch information
365082218 committed Oct 19, 2020
1 parent 4c85841 commit b56a62e
Show file tree
Hide file tree
Showing 779 changed files with 88,637 additions and 36,482 deletions.
Binary file modified .vs/meteor_original_android/v14/.suo
Binary file not shown.
Binary file added .vs/meteor_original_android/v15/.suo
Binary file not shown.
737 changes: 737 additions & 0 deletions Assembly-CSharp-Editor-firstpass.csproj

Large diffs are not rendered by default.

849 changes: 849 additions & 0 deletions Assembly-CSharp-Editor.csproj

Large diffs are not rendered by default.

855 changes: 855 additions & 0 deletions Assembly-CSharp-firstpass.csproj

Large diffs are not rendered by default.

1,476 changes: 1,476 additions & 0 deletions Assembly-CSharp.csproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Assets/AppInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class AppInfo:Singleton<AppInfo>
{
public const string versionKey = "APPVERSION";
public string localVer = "0.3.1.0";
public string localVer = "0.3.2.0";
//返回本地版本号是否大于指定版本号,本地版本号即localVer;
public bool VersionIsEqual(string s)
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/Code/Idevgame/GUI/Dialog/BattleResultDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void SetResult(int result)

} else {
FrameReplay.Ins.OnDisconnected();
Main.Ins.PlayEndMovie(result == 1);
Main.Ins.GotoMenu();
}
});
//Control("SaveRecord").SetActive(false);
Expand Down
250 changes: 137 additions & 113 deletions Assets/Code/Idevgame/GUI/Dialog/ChatDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState

public override void OnClose()
{
if (checkSound != null) {
checkSound.Stop();
checkSound = null;
}
if (Microphone.IsRecording(null))
{
Record();
}
//if (checkSound != null) {
// checkSound.Stop();
// checkSound = null;
//}
//if (Microphone.IsRecording(null))
//{
// Record();
//}
}


Expand Down Expand Up @@ -59,6 +59,9 @@ void Init()
{
OnBackPress();
});
Control("CloseHistoryMsg", WndObject).GetComponent<Button>().onClick.AddListener(() => {
OnBackPress();
});
Control("CloseAudioMsg", WndObject).GetComponent<Button>().onClick.AddListener(() =>
{
OnBackPress();
Expand All @@ -75,122 +78,143 @@ void Init()
int j = i;
Control(i.ToString(), WndObject).GetComponent<Button>().onClick.AddListener(() => { SendQuickMsg(j); });
}
Control("Record", WndObject).GetComponent<Button>().onClick.AddListener(() => { Record(); });
Control("SendAudio", WndObject).GetComponent<Button>().onClick.AddListener(() => { SendAudioMsg(); });
GameObject objListen = Control("Listen", WndObject);
source = objListen.GetComponent<AudioSource>();
Listen = objListen.GetComponent<Button>();
Listen.onClick.AddListener(() =>
{
if (MicChat.clip != null) {
SoundManager.Ins.Mute(true);
source.PlayOneShot(MicChat.clip);
Debug.Log("play clip");
if (checkSound != null) {
checkSound.Stop();
}
checkSound = Timer.loop(0.5f, CheckSound);
}
});
CountDown = Control("CountDown", WndObject);
//Control("Record", WndObject).GetComponent<Button>().onClick.AddListener(() => { Record(); });
//Control("SendAudio", WndObject).GetComponent<Button>().onClick.AddListener(() => { SendAudioMsg(); });
//GameObject objListen = Control("Listen", WndObject);
//source = objListen.GetComponent<AudioSource>();
//Listen = objListen.GetComponent<Button>();
//Listen.onClick.AddListener(() =>
//{
// if (MicChat.clip != null) {
// SoundManager.Ins.Mute(true);
// source.PlayOneShot(MicChat.clip);
// Debug.Log("play clip");
// if (checkSound != null) {
// checkSound.Stop();
// }
// checkSound = Timer.loop(0.5f, CheckSound);
// }
//});
if (RoomChatDialogState.Exist()) {
string msg = RoomChatDialogState.Instance.GetHistoryMsg();
Add(msg);
}
//CountDown = Control("CountDown", WndObject);
}

void CheckSound() {
if (!source.isPlaying) {
checkSound.Stop();
checkSound = null;
SoundManager.Ins.Mute(false);
}
public void Add(string message) {
GameObject Root = Control("MsgHistory");
GameObject obj = new GameObject();
obj.name = (Root.transform.childCount + 1).ToString();
Text txt = obj.AddComponent<Text>();
txt.text = message;
//00AAFFFF
txt.font = Main.Ins.TextFont;
txt.fontSize = 32;
txt.alignment = TextAnchor.MiddleLeft;
txt.raycastTarget = false;
txt.color = new Color(1.0f, 1.0f, 1.0f, 1f);
obj.transform.SetParent(Root.transform);
obj.transform.localScale = Vector3.one;
obj.transform.localPosition = Vector3.zero;
obj.transform.localRotation = Quaternion.identity;
}
//void CheckSound() {
// if (!source.isPlaying) {
// checkSound.Stop();
// checkSound = null;
// SoundManager.Ins.Mute(false);
// }
//}

Timer checkSound;
//Timer checkSound;
void SendQuickMsg(int i)
{
TcpClientProxy.Ins.SendChatMessage(jsData["Msg"][i].ToString());
OnBackPress();
}

void SendAudioMsg()
{
if (!recording && audioData != null && audioData.Length != 0 && Listen != null && Listen.IsActive())
{
Debug.LogWarning("audio data length:" + audioData.Length);
if (audioData.Length > PacketProxy.MaxSize) {
U3D.PopupTip("语音包太大,无法发送");
return;
}
TcpClientProxy.Ins.SendAudioMessage(audioData);
}
OnBackPress();
}
//void SendAudioMsg()
//{
// if (!recording && audioData != null && audioData.Length != 0 && Listen != null && Listen.IsActive())
// {
// Debug.LogWarning("audio data length:" + audioData.Length);
// if (audioData.Length > PacketProxy.MaxSize) {
// U3D.PopupTip("语音包太大,无法发送");
// return;
// }
// TcpClientProxy.Ins.SendAudioMessage(audioData);
// }
// OnBackPress();
//}

bool recording = false;
byte[] audioData;
AudioSource source;
AudioClip clip;
Button Listen;
GameObject CountDown;
float RecordTick = 0;
void Record()
{
if (recording)
{
Stop();
return;
}
else
{
//把音效和音乐全部静止
SoundManager.Ins.Mute(true);
recording = MicChat.TryStartRecording();
if (recording)
{
Control("Record", WndObject).GetComponentInChildren<Text>().text = "停止";
if (Listen == null)
{
GameObject objListen = Control("Listen", WndObject);
Listen = objListen.GetComponent<Button>();
objListen.SetActive(false);
}
else
{
Listen.gameObject.SetActive(false);
}
CountDown.SetActive(true);
RecordTick = 0;
nSeconds = MicChat.maxRecordTime - (int)RecordTick;
CountDown.GetComponentInChildren<Text>().text = string.Format("录制中{0}", nSeconds);
}
}
}
//bool recording = false;
//byte[] audioData;
//AudioSource source;
//AudioClip clip;
//Button Listen;
//GameObject CountDown;
//float RecordTick = 0;
//void Record()
//{
// if (recording)
// {
// Stop();
// return;
// }
// else
// {
// //把音效和音乐全部静止
// SoundManager.Ins.Mute(true);
// recording = MicChat.TryStartRecording();
// if (recording)
// {
// Control("Record", WndObject).GetComponentInChildren<Text>().text = "停止";
// if (Listen == null)
// {
// GameObject objListen = Control("Listen", WndObject);
// Listen = objListen.GetComponent<Button>();
// objListen.SetActive(false);
// }
// else
// {
// Listen.gameObject.SetActive(false);
// }
// CountDown.SetActive(true);
// RecordTick = 0;
// nSeconds = MicChat.maxRecordTime - (int)RecordTick;
// CountDown.GetComponentInChildren<Text>().text = string.Format("录制中{0}", nSeconds);
// }
// }
//}

void Stop() {
SoundManager.Ins.Mute(false);
int length = 0;
clip = null;
MicChat.EndRecording(out length, out clip);
recording = false;
CountDown.SetActive(false);
audioData = clip.GetData();
if (audioData != null && audioData.Length != 0)
Listen.gameObject.SetActive(true);
Control("Record", WndObject).GetComponentInChildren<Text>().text = "录音";
}
//void Stop() {
// SoundManager.Ins.Mute(false);
// int length = 0;
// clip = null;
// MicChat.EndRecording(out length, out clip);
// recording = false;
// CountDown.SetActive(false);
// audioData = clip.GetData();
// if (audioData != null && audioData.Length != 0)
// Listen.gameObject.SetActive(true);
// Control("Record", WndObject).GetComponentInChildren<Text>().text = "录音";
//}

int nSeconds = 0;
void Update()
{
if (recording) {
RecordTick += FrameReplay.deltaTime;
if (RecordTick >= 8) {
Stop();
} else {
int i = MicChat.maxRecordTime - (int)RecordTick;
if (nSeconds != i) {
nSeconds = i;
CountDown.GetComponentInChildren<Text>().text = string.Format("录制中{0}", nSeconds);
}
}
}
}
//int nSeconds = 0;
//void Update()
//{
// if (recording) {
// RecordTick += FrameReplay.deltaTime;
// if (RecordTick >= 8) {
// Stop();
// } else {
// int i = MicChat.maxRecordTime - (int)RecordTick;
// if (nSeconds != i) {
// nSeconds = i;
// CountDown.GetComponentInChildren<Text>().text = string.Format("录制中{0}", nSeconds);
// }
// }
// }
//}
}
7 changes: 3 additions & 4 deletions Assets/Code/Idevgame/GUI/Dialog/EscConfirmWnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,17 @@ void OnLeave()
{
GameStateMgr.Ins.SaveState();
Main.Ins.GameBattleEx.Pause();
Main.Ins.StopAllCoroutines();
SoundManager.Ins.StopAll();
Main.Ins.StopAllCoroutines();
PathHelper.Ins.StopCalc();
OnBackPress();
FightState.State.Close();
MeteorManager.Ins.Reset();
if (GameOverlayDialogState.Exist())
GameOverlayDialogState.Instance.ClearSystemMsg();
//离开副本
if (U3D.IsMultiplyPlayer())
TcpClientProxy.Ins.LeaveLevel();
else
{
else {
FrameReplay.Ins.OnDisconnected();
U3D.GoBack();
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Code/Idevgame/GUI/Dialog/FightWnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState

public override void OnDialogStateExit() {
base.OnDialogStateExit();
BaseDialogState.UICamera.clearFlags = CameraClearFlags.Color;
BaseDialogState.UICamera.backgroundColor = Color.black;
//BaseDialogState.UICamera.clearFlags = CameraClearFlags.Color;
//BaseDialogState.UICamera.backgroundColor = Color.black;
}


Expand Down
2 changes: 1 addition & 1 deletion Assets/Code/Idevgame/GUI/Dialog/MainLobbyDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ IEnumerator UpdateServiceList()
DownloadHandlerBuffer dH = new DownloadHandlerBuffer();
vFile.downloadHandler = dH;
yield return vFile.Send();
if (vFile.isError || vFile.responseCode != 200 || string.IsNullOrEmpty(dH.text))
if (vFile.isNetworkError || vFile.responseCode != 200 || string.IsNullOrEmpty(dH.text))
{
Debug.LogError(string.Format("update version file error:{0} or responseCode:{1}", vFile.error, vFile.responseCode));
vFile.Dispose();
Expand Down
2 changes: 1 addition & 1 deletion Assets/Code/Idevgame/GUI/Dialog/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public override void OnDialogStateEnter(BaseDialogState ownerState, BaseDialogSt
Main.Ins.listener.enabled = true;
menu.volume = GameStateMgr.Ins.gameStatus.MusicVolume;
//每次进入主界面,触发一次更新APP信息的操作,如果
Main.Ins.UpdateAppInfo();
//Main.Ins.UpdateAppInfo();
}

void Init()
Expand Down
2 changes: 1 addition & 1 deletion Assets/Code/Idevgame/GUI/Dialog/RecordDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override void OnClose()
string recDir;
protected virtual void Init()
{
recDir = Main.Ins.replayPath;
//recDir = Main.Ins.replayPath;
if (Prefab == null)
Prefab = Resources.Load("UI/Dialogs/RecordItem") as GameObject;

Expand Down
Loading

0 comments on commit b56a62e

Please sign in to comment.