コード例 #1
0
    public void CreateObstacle()
    {
        GridCell   deployCell = Grid.Instance.GetCell(cellIdToPosition);
        Transform  tr         = PhotonNetwork.Instantiate(ObstacleCodeCall, deployCell.transform.position, Quaternion.identity, 0).transform;
        Deployable towerComp  = tr.GetComponent <Deployable>();

        towerComp.InitialDeploy(deployCell.CellId);
    }
コード例 #2
0
    public void Deploy(GridCell deployCell)
    {
        GameObject Unit = PhotonNetwork.Instantiate(objectSpawnCodeCall, deployCell.transform.position, Quaternion.identity, 0);

        if (Unit == null)
        {
            return;
        }
        if (deployCell.HasObstacle())
        {
            PhotonNetwork.Destroy(Unit); return;
        }

        Deployable d = Unit.GetComponent <Deployable>();

        if (d == null)
        {
            Unit = null; return;
        }

        d.InitialDeploy(deployCell.CellId);
        d    = null;
        Unit = null;
    }