Пример #1
0
 void Place()
 {
     //If current cell is available
     if (currentCell.currentWall == null && currentCell.currentCoin == null)
     {
         currentPhase = WallPhase.ghostPlaced;
         GameManager.Instance.EndBuildPhase();
     }
     else
     {
         Debug.Log("Wall onspot");
     }
 }
Пример #2
0
    public IEnumerator PlaceWall()
    {
        Debug.Log("placing wall");
        myRenderer.enabled        = true;
        myRenderer.material.color = standardColor;
        currentPhase = Wall.WallPhase.build;
        if (GridManager.Instance.CellAtGrid(currentCell).currentWall == null)
        {
            yield return(StartCoroutine(StartBuildAnimation()));

            AddToCell();
        }
        else
        {
            //Wall on grid, this cant be placed
            Debug.Log("Destroying wall");
            Destroy(this.gameObject);
        }
        yield return(null);
    }
Пример #3
0
 public void StartSetPosition()
 {
     currentPhase = WallPhase.selectPosition;
 }
Пример #4
0
    // Use this for initialization

    private void Awake()
    {
        myRenderer    = GetComponent <Renderer>();
        currentPhase  = WallPhase.build;
        standardColor = myRenderer.material.color;
    }