Exemple #1
0
        public void CmdCreateNewLine(GameObject firstCoord, GameObject sndCoord)
        {
            if (!gridManager.currentGrid)
            {
                return;
            }

            if (firstCoord != sndCoord)
            {
                GameObject  newLine        = Instantiate(LinePrefab, gridManager.currentGrid.transform);
                LineHandler newLineHandler = newLine.GetComponent <LineHandler>();
                gridManager.currentGrid.AddLine(newLineHandler);
                NetworkServer.Spawn(newLine);

                objNetId = newLine.GetComponent <NetworkIdentity>();
                objNetId.AssignClientAuthority(connectionToClient);
                newLineHandler.RpcSetPositions(firstCoord, sndCoord);
                //newLineHandler.SetPositions(firstCoord.GetComponent<GridCoord>(), sndCoord.GetComponent<GridCoord>());
                objNetId.RemoveClientAuthority(connectionToClient);
            }
        }
Exemple #2
0
 public void AddLine(LineHandler handler)
 {
     _lines.Add(handler);
 }