Inheritance: UnityEngine.MonoBehaviour
Ejemplo n.º 1
0
        public void moveToColumn(Column target, bool animate)
        {
            //todo
            //draggingEnabled = false;

            waitingForTarget = false;
            gameController.setWaitingForTarget(null);

            if (actualColumn != null)
            {
                if (actualColumn != target)
                {
                    //Debug.Log("Moving from column: " + actualColumn);
                    //Debug.Log("Moving to column: " + target);
                    MGC.Instance.logger.addEntry("akce - přesun | disk: " + this.size + " | ze sloupce: " + actualColumn + " | na sloupec: " + target);
                }
                else
                {
                    MGC.Instance.logger.addEntry("Disk položen na stejný sloupec, ze kterého byl zvednut");
                }

                gameController.increaseNumberofMoves();
                actualColumn.removeTopDisk();
            }

            actualColumn = target;
            actualColumn.addDisk(this);

            if (animate)
            {
                updatePosition(4.8f);
            }
            else
            {
                updatePosition(0.0f);
            }

            GetComponent<Renderer>().material.color = startcolor;
            GetComponent<Rigidbody>().isKinematic = false;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// game starts...  
        /// </summary>
        void Start()
        {
            //set up columns
            //print("Columns count: " + columns.GetLength(0));
            //print("Starting column index = " + (int)startingColumnName);
            //print("Ending column index = " + (int)endingColumnName);

            startingColumn = columns[(int)startingColumnName].GetComponent<Column>();
            endingColumn = columns[(int)endingColumnName].GetComponent<Column>();

            if (startingColumn == null || endingColumn == null)
            {
                Debug.LogError("Wrong pointers to columns...");
            }

            MGC.Instance.minigamesProperties.SetPlayed(MGC.Instance.selectedMiniGameName, MGC.Instance.selectedMiniGameDiff);

            ResetGame();
        }
Ejemplo n.º 3
0
 public void setColumn(Column newColumn)
 {
     actualColumn = newColumn;
 }