原文地址:https://support.unity3d.com/hc/en-us/articles/206455506-What-is-CS0131-
症狀
當嘗試進入Play模式時,我得到如下的錯誤:
error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
原因
引起CS0131號錯誤的原因是,“=”賦值運算符的左側不是一個變量、不是一個屬性、不是一個索引器。
本例的錯誤信息如下:
error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
解決方案
在“=”賦值運算符左側添加變量、屬性或者索引器就可以解決CS0131號錯誤。
更多信息
https://msdn.microsoft.com/en-us/library/x5s08de8(v=vs.90).aspx