Пример #1
0
 void Start()
 {
     // Debug.Log("***************************** CargoPuzzle.Start()");
     // Init all the block data
     if (FindObjectOfType <CargoMCP>() == null)
     {
         PuzzleState = ePuzzleState.PLAYING;
     }
     else
     {
         PuzzleState = ePuzzleState.OFF;
     }
     IgnoreBlockInput = false;
     CurBlock         = null;
     Blocks           = this.GetComponentsInChildren <Block>();
     //Debug.Log("num blocks: " + Blocks.Length);
     for (int i = 0; i < Blocks.Length; i++)
     {
         //Debug.Log("initting block: " + this.name);
         Blocks[i].Init(this);
         if (Blocks[i].tag.Equals("Player"))
         {
             Player = Blocks[i].GetComponent <Block>();
         }
         if (Blocks[i].tag.Equals("Exit"))
         {
             Exit = Blocks[i].GetComponent <Block>();
         }
     }
     SetInputState(eTouchState.NONE, InputTimer, TapCount);
 }
Пример #2
0
    /// <summary>
    /// Temp function for going back to the Hub
    /// </summary>
    /// <returns></returns>
    IEnumerator ExitPuzzle()
    {
        PuzzleState = ePuzzleState.OFF;
        if (CargoMCP != null)
        {
            yield return(new WaitForSeconds(1f));

            CargoMCP.PuzzleFinished();
        }
        else
        {
            float time = 0f;
            while (time < 1.5f)
            {
                time += Time.deltaTime;
                yield return(new WaitForEndOfFrame());
            }
            SceneManager.LoadScene(0);
        }
    }
Пример #3
0
 public void BeginPlaying()
 {
     PuzzleState = ePuzzleState.PLAYING;
 }