Ejemplo n.º 1
0
    private void SpawnInPlane(GameObject obj, int row, int col, GameObject[,] plane)
    {
        // TODO: this is silly but I don't want to think about it right now
        PlanePosition.PlaneType t = PlanePosition.PlaneType.Ground;
        float yOffset             = 0.0f;

        if (plane == actionPlane)
        {
            t       = PlanePosition.PlaneType.Action;
            yOffset = 0.5f;
        }

        obj.transform.position = new Vector3(col, -row + yOffset, 0);
        plane[col, row]        = obj;
        PlanePosition pos = obj.GetComponent <PlanePosition>();

        if (pos)
        {
            pos.Set(row, col, t);
        }
        NetworkServer.Spawn(obj);
    }