private void Start()
    {
        gameStatus   = FindObjectOfType <GameStatus>();
        ballBehavior = FindObjectOfType <BallBehavior>();

        if ((gameStatus != null) & (ballBehavior != null) & gameStatus.IsAutoplayEnabled())
        {
            ballBehavior.LaunchBall();
        }
    }
Exemplo n.º 2
0
    private void StartGame()
    {
        GameObject gameObject = GameObject.FindGameObjectWithTag("Ball");

        if (gameObject != null)
        {
            ball = gameObject.GetComponent <BallBehavior>();

            ball.LaunchBall(arrow.GetComponent <ArrowBehavior>().differenceX, arrow.GetComponent <ArrowBehavior>().differenceY, arrow.GetComponent <RectTransform>().localRotation.eulerAngles.z);
            game.onGoing = true;
            arrow.GetComponentInChildren <Image>().enabled = false;
        }
    }