Question by
Rahuluplus · Jun 13, 2018 at 01:35 AM ·
c#erroreditoraugmented-realitycs0246
Help getting Unite 2017 demo code to run, need to fix errors
So I need a working copy of the AR Tanks Demo that was used at Unite 2017, and downloaded the source code to see if it would run. Unfortunately, probably because Unity has been updated since then, some of the code isn't working properly. I fixed most of the issues, but I can't figure out this error:
Assets/TanksNetworkingAR/Scripts/Managers/GameManager.cs(168,3): error CS0246: The type or namespace name `SyncPointsHolder' could not be found. Are you missing an assembly reference?
Here is the block of code with the error(s):
private void StoreServerTransform()
{
Transform t = Camera.main.transform.parent;
SyncPointsHolder sph = t.gameObject.GetComponent<SyncPointsHolder> ();
if (sph != null) {
Vector3[] syncPoints = sph.syncPoints;
RpcSendCameraTransform (t.position, t.rotation, syncPoints [0], syncPoints [1]);
}
}
[ClientRpc]
void RpcSendCameraTransform(Vector3 pos, Quaternion rot, Vector3 syncPoint0, Vector3 syncPoint1)
{
Transform t = Camera.main.transform.parent;
//t.position = pos;
//t.rotation = rot;
SyncPointsHolder sph = t.gameObject.GetComponent<SyncPointsHolder> ();
if (sph != null) {
Vector3[] clientsyncPoints = sph.syncPoints;
Transform coordChangeTransform = t.parent;
coordChangeTransform.position = clientsyncPoints [0] - syncPoint0;
Vector3 serverSyncVector = syncPoint1 - syncPoint0;
Vector3 clientSyncVector = clientsyncPoints [1] - clientsyncPoints [0];
coordChangeTransform.rotation = Quaternion.FromToRotation (serverSyncVector, clientSyncVector);
}
}
Here is a link to the gamemanager on github.
Thanks for your help!
Comment