Ejemplo n.º 1
0
 void AcceptInput()
 {
     if (!animationManager.CheckAnimationsPlaying())
     {
         boardSquare square = inputManager.GetSquareOnClick();
         if (square != null)
         {
             square.GemScript.DestroyGem();
         }
     }
 }
Ejemplo n.º 2
0
 bool AcceptInput()
 {
     if (!animationManager.CheckAnimationsPlaying())
     {
         boardSquare square = inputManager.GetInput();
         if (square != null)
         {
             //Debug.Log("Trying to boom");
             square.DestroyGem(false);
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
    //Methods
    public boardSquare GetSquareOnClick()
    {
        if (Input.GetMouseButtonDown(0) && !animationManager.CheckAnimationsPlaying())
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 100))
            {
                if (hit.transform.gameObject != null)
                {
                    return(hit.transform.gameObject.GetComponent <boardSquare>());
                }
            }
        }
        return(null);
    }
Ejemplo n.º 4
0
    boardSquare GetSquareOnClick()  //Windows & Editor
    {
        if (Input.GetMouseButtonUp(0) && !animationManager.CheckAnimationsPlaying())
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 100))
            {
                if (hit.transform.gameObject != null)
                {
                    boardSquare square = hit.transform.gameObject.GetComponent <boardSquare>();
                    if (square != null && !square.isStaticSquare && square.Gem.activeSelf)
                    {
                        return(square);
                    }
                }
            }
        }
        return(null);
    }