void check_my_lane() { spwanner[] all_spawnners = FindObjectsOfType <spwanner>(); foreach (spwanner spawnner in all_spawnners) { if (Mathf.Abs(spawnner.transform.position.y - transform.position.y) <= Mathf.Epsilon) { myspawnner = spawnner; } } }
// Use this for initialization void Start() { GameManager = GameObject.Find("GameManager"); spwanner spwan = GameManager.GetComponent <spwanner>(); if (spwan == null) { Debug.Log("Spawn Class not found"); } if (!isServer) { Debug.Log("This machine is Client"); spwan.AssignMyTeam("client"); } else { Debug.Log("This machine is a server"); spwan.AssignMyTeam("server"); } }