Bootcamp Demo fixes in Unity 3.4

Options
Tobias
Tobias admin
edited August 2011 in DotNet
I checked the Photon Bootcamp Demo (from the Asset Store) in Unity 3.4 and you definitely need to fix the demo's code. Giving variable scriptSoldierCamera a type, fixed the scripts.

There are 6 places where scriptSoldierCamera is used, always 2 consecutive lines.
Add this code (bold part is new):

var scriptSoldierCamera : MonoBehaviour = cam.transform.GetComponent("SoldierCamera");
scriptSoldierCamera.enabled = !showMenu;


The cause for this is likely:
"Unity 3.4 ships with an improved javascript compiler that supports better type inference heuristics for commonly used Unity APIs such as GameObject.GetComponent and Object.Instantiate [...]"
http://unity3d.com/unity/whats-new/unity-3.4

Hope this helps.