private void NavigationPoint(CellConnection connection)
    {
        var butt = Instantiate(navigationButtonPrefab, this.transform);

        butt.onClick.AddListener(() => { MoveToPoint(connection.connectedTo); });
        MoveToWorldPoint(connection.heightOffset.transform.position, butt.GetComponent <RectTransform>());
        navigationButtons.Add(butt);
    }
Exemple #2
0
    public void MoveToPoint(CellConnection point)
    {
        Debug.Log("Move to cell: " + point.owner.name);
        cam.MoveToPoint(point.cameraPosition.transform, currentPoint.owner.transform);
        currentPoint           = point;
        currentPoint.isCurrent = true;

        dungeonCanvas.ClearCellNavigation();
        point.owner.SpawnMonsters(cam);
    }
            public ConnectClass Close()
            {
                if (!IsOpen)
                {
                    throw new InvalidOperationException("All Connection is already closed.");
                }

                CellConnection.Close();
                RowConnection.Close();
                SheetConnection.Close();
                Connection.Close();

                return(this);
            }
            public ConnectClass Open()
            {
                if (IsOpen)
                {
                    throw new InvalidOperationException("All Connection is already opened.");
                }

                Connection.Open();
                SheetConnection.Open();
                RowConnection.Open();
                CellConnection.Open();

                return(this);
            }
Exemple #5
0
    public void InitPlayer(DungeonPath path)
    {
        Debug.Log("init player");
        this.path = path;

        transform.position     = path.startPoint.cameraPosition.position;
        transform.rotation     = path.startPoint.cameraPosition.rotation;
        currentPoint           = path.startPoint;
        currentPoint.isCurrent = true;

        dungeonCanvas.SetupCellNavigation(currentPoint.owner);

        // MoveToPoint(path.startPoint);
    }
 public void Dispose()
 {
     if (CellConnection != null && CellConnection.State.HasFlag(ConnectionState.Open))
     {
         CellConnection.Close();
     }
     if (RowConnection != null && RowConnection.State.HasFlag(ConnectionState.Open))
     {
         RowConnection.Close();
     }
     if (SheetConnection != null && SheetConnection.State.HasFlag(ConnectionState.Open))
     {
         SheetConnection.Close();
     }
     if (Connection != null && Connection.State.HasFlag(ConnectionState.Open))
     {
         Connection.Close();
     }
 }
 public void MoveToPoint(CellConnection connection)
 {
     player.MoveToPoint(connection);
 }