/* * Command functions can only be called through the local player * and the local player is the player that is spawned by the network manager * * So find the object with network player and call function */ public void Position1Clicked() { //MenuManager.singleton.PlayerSelectedPosition(Common._PlayerName, 0); GameObject[] objArr = GameObject.FindGameObjectsWithTag("NetworkPlayer"); for (int i = 0; i < objArr.Length; i++) { NetworkPlayerController controller = objArr[i].GetComponent <NetworkPlayerController>(); if (controller) { controller.Position1Clicked(); } } }