
遇到很多错误,汇总一下。完美运行,就是地面的不同材质没有了,要重新刷一下。
unit5.6最近在mac升级后无法运行了。升级到unity2020,开始做移动端,手游。
error CS0619: ‘GUITexture’ is obsolete: ‘GUITexture has been removed. Use UI.Image instead.’
增加 using UnityEngine.UI;
修改 [RequireComponent(typeof (GUITexture))]为[RequireComponent(typeof(Image))]
error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
打开SimpleActivatorMenu脚本。
增加
修改 public GUIText camSwitchButton; 为 public Text camSwitchButton;
error CS0246: The type or namespace name 'NetworkManager' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'NetworkManager' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'NetworkLobbyManager' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'NetworkConnection' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'NetworkMessage' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'NetworkBehaviour' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'NetworkTransform' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'CommandAttribute' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'Command' could not be found (are you missing a using directive or an assembly reference?)
error CS0115: 'LobbyManager.OnStartHost()': no suitable method found to override
error CS0115: 'LobbyManager.OnMatchCreate(bool, string, MatchInfo)': no suitable method found to override
error CS0115: 'LobbyManager.OnDestroyMatch(bool, string)': no suitable method found to override
error CS0115: 'LobbyManager.OnLobbyServerSceneLoadedForPlayer(GameObject, GameObject)': no suitable method found to override
error CS0115: 'LobbyManager.OnLobbyServerPlayersReady()': no suitable method found to override
error CS0246: The type or namespace name 'MessageBase' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'MessageBase' could not be found (are you missing a using directive or an assembly reference?)
error CS0115: 'LobbyPlayer.OnClientEnterLobby()': no suitable method found to override
error CS0115: 'LobbyPlayer.OnStartAuthority()': no suitable method found to override
error CS0115: 'LobbyPlayer.OnClientReady(bool)': no suitable method found to override
error CS0246: The type or namespace name 'SyncVarAttribute' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'SyncVar' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'hook' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'SyncVarAttribute' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'ClientRpcAttribute' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'ClientRpc' could not be found (are you missing a using directive or an assembly reference?)
因为unity已经弃用了自带的Network,所以会报错,建议直接删除原来相关脚本。
如果有不想删除的话。
打开“Window”>“package Manager”,然后在弹出的窗口左上角按+(加号):Add Package from git URL
在加号下面显示的文本框里输入com.unity.multiplayer-hlapi。文本框右侧的add按钮会亮起,点击安装。package Manager界面右侧会显示安装状态,安装完毕上述全部关于Network的错误都消失了。

package Manager
error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
打开 DemoBoxesGui脚本
增加 using UnityEngine.UI;
将public GUIText GuiTextForTips修改为public Text GuiTextForTips。
error CS0619: 'EventType.keyDown' is obsolete: 'Use KeyDown instead (UnityUpgradable) -> KeyDown'
把小写EventType.keyDown改成大写EventType.KeyDown。首字母大写。
error CS0165: Use of unassigned local variable 'pixel'
打开TextureCanvas脚本
修改
Color32 pixel;
pixel.r = (byte)(m_color.r*m_srcAlpha + dst.r*m_dstAlpha);
pixel.g = (byte)(m_color.g*m_srcAlpha + dst.g*m_dstAlpha);
pixel.b = (byte)(m_color.b*m_srcAlpha + dst.b*m_dstAlpha);
pixel.a = (byte)(m_color.a*m_srcAlpha + dst.a*m_dstAlpha);
为
Color32 pixel = new Color32((byte)(m_color.r * m_srcAlpha + dst.r * m_dstAlpha), (byte)(m_color.g * m_srcAlpha + dst.g * m_dstAlpha), (byte)(m_color.b * m_srcAlpha + dst.b * m_dstAlpha), (byte)(m_color.a * m_srcAlpha + dst.a * m_dstAlpha));
error CS0619: 'QualitySettings.blendWeights' is obsolete: 'blendWeights is obsolete. Use skinWeights instead (UnityUpgradable) -> skinWeights'
将QualitySettings.blendWeights修改为QualitySettings.skinWeights
error CS0619: 'BlendWeights' is obsolete: 'BlendWeights is obsolete. Use SkinWeights instead (UnityUpgradable) -> SkinWeights'
将BlendWeights.TwoBones修改为:SkinWeights.TwoBones;
error CS0117: 'Handles' does not contain a definition for 'DotCap'
将Handles.DotCap修改为Handles.DotHandleCap,记得补充最后一个参数EventType.Repaint。
