Exemplo n.º 1
0
 private void OnBallLaunched(BowlingBall ball)
 {
     if (this._ballSlider)
     {
         this._ballSlider.gameObject.SetActive(false);
     }
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        _ball = gameObject.GetComponent <BowlingBall>();

        var rigidBody = gameObject.GetComponent <Rigidbody>();

        _initialBallX = rigidBody.position.x;
    }
Exemplo n.º 3
0
 public void OnBallGuttered(BowlingBall ball)
 {
     if (this._ballEntered)
     {
         return;
     }
     this.NewFrame();
 }
Exemplo n.º 4
0
 void Start()
 {
     pinsController = FindObjectOfType <PinsController>();
     ball           = FindObjectOfType <BowlingBall>();
     mCameraControl = FindObjectOfType <CameraControl>();
     scoreManager   = FindObjectOfType <ScoreManager>();
     Frame.ResetFrames();
 }
Exemplo n.º 5
0
    private void Start()
    {
        ball         = FindObjectOfType <BowlingBall>();
        pinPositions = GetComponentsInChildren <PinPosition>();
        pins         = new List <Pin>();
        anim         = GetComponent <Animator>();

        SpawnPins();
        LowerPins();
    }
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        pinSetter    = GameObject.FindObjectOfType <PinSetter>();
        actionMaster = GameObject.FindObjectOfType <ActionMasterOld>();
        ball         = GameObject.FindObjectOfType <BowlingBall>();
        pinManager   = GameObject.FindObjectOfType <PinManager>();
        scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>();
        pinList      = new List <int>();

        scoreDisplay.UpdateCumulativeScoreTexts(pinList);
        scoreDisplay.UpdateRollsTexts(pinList);
    }
Exemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        if (GameObject.FindObjectOfType <BowlingBall> ())
        {
            ball = GameObject.FindObjectOfType <BowlingBall> ();
        }
        else
        {
            Debug.LogWarning("BowlingBall missing.");
        }
        //if (GameObject.FindObjectOfType<PinSetter> ()) {
        //	pinSetter = GameObject.FindObjectOfType<PinSetter> ();
        //} else {Debug.LogWarning ("PinSetter missing.");}

        distanceToCamera = (transform.position.z - Camera.main.transform.position.z);
        startTime        = -1;
    }
Exemplo n.º 8
0
        private void OnTriggerEnter(Collider collider)
        {
            var pin = collider.gameObject.GetComponent <BowlingPin>();

            if (pin)
            {
                this._pins.Add(pin);
                return;
            }
            var ball = collider.gameObject.GetComponent <BowlingBall>();

            if (ball)
            {
                this._ballEntered = ball;
                this.InvokeRepeating(nameof(this.FrameSettling), 5, 1);
            }
        }
Exemplo n.º 9
0
    void OnTriggerExit(Collider coll)
    {
        GameObject other = coll.gameObject;

        Pin pin = other.GetComponentInParent <Pin>();

        if (pin) //lazy
        {
            Destroy(pin.gameObject, 0.1f);
        }
        else
        {
            BowlingBall ball = other.GetComponent <BowlingBall>();
            if (ball)
            {
                ball.StartRecovery();
            }
        }
    }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        bowlingBall = GameObject.FindObjectOfType <BowlingBall>();
        animator    = GameObject.FindObjectOfType <PinMaster2000>().GetComponent <Animator>();

        //foreach (Pin pin in GameObject.FindObjectsOfType<Pin>())
        //{
        //    pinSpawnLocation = transform.position;
        //    pinSpawnRotation = transform.eulerAngles;
        //}

        Pin[] pinsStart = FindObjectsOfType <Pin>();

        foreach (Pin pinAtStart in pinsStart)
        {
            pinSpawnLocation = pinAtStart.transform.position;
            pinSpawnRotation = pinAtStart.transform.eulerAngles;
        }
    }
Exemplo n.º 11
0
 // Use this for initialization
 void Start()
 {
     _ball = gameObject.GetComponent <BowlingBall>();
 }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        bowlingball = GameObject.FindObjectOfType <BowlingBall>();

        offset = gameObject.transform.position - bowlingball.transform.position;
    }
Exemplo n.º 13
0
 private void Start()
 {
     gameManager      = FindObjectOfType <GameManager>();
     ball             = FindObjectOfType <BowlingBall>();
     lastSettledCount = 10;
 }
Exemplo n.º 14
0
    // Use this for initialization
    void Start()
    {
        if (GameObject.Find("PinCount"))
        {
            pinCount = GameObject.Find("PinCount").GetComponent <Text> ();
        }
        else
        {
            Debug.LogWarning("Missing PinCount text object.");
        }

        if (GameObject.FindObjectOfType <BowlingBall> ())
        {
            ball = GameObject.FindObjectOfType <BowlingBall> ();
        }
        else
        {
            Debug.LogWarning("Missing BowlingBall.");
        }

        if (GameObject.FindObjectOfType <PinSetter> ())
        {
            pinSetter = GameObject.FindObjectOfType <PinSetter> ();
        }
        else
        {
            Debug.LogWarning("Missing PinSetter.");
        }
        if (GameObject.FindObjectOfType <PinCounter> ())
        {
            pinCounter = GameObject.FindObjectOfType <PinCounter> ();
        }
        else
        {
            Debug.LogWarning("Missing pinCounter.");
        }
        if (GameObject.FindObjectOfType <ScoreDisplay> ())
        {
            scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay> ();
        }
        else
        {
            Debug.LogWarning("Missing ScoreDisplay.");
        }
        if (GameObject.Find("HowToPlay"))
        {
            howToPlay = GameObject.Find("HowToPlay");
        }
        else
        {
            Debug.LogWarning("Missing HowToPlay.");
        }
        if (GameObject.Find("GameOver"))
        {
            gameOver = GameObject.Find("GameOver");
            gameOver.SetActive(false);
        }
        else
        {
            Debug.LogWarning("Missing GameOver.");
        }
//		if (GameObject.Find("CheatButton")) {
//			cheatButton = GameObject.Find ("CheatButton");
//		}else {Debug.LogWarning ("Missing CheatButton.");}

        PinCountUpdate(Color.black, -1);

        //pinCount.text = pinCounter.CountStanding ().ToString();
    }
Exemplo n.º 15
0
    //here

    // Use this for initialization
    void Start()
    {
        pinSetter    = GameObject.FindObjectOfType <PinSetter>();
        ball         = GameObject.FindObjectOfType <BowlingBall>();
        scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>();
    }
Exemplo n.º 16
0
 // Use this for initialization
 void Start()
 {
     pinSetter   = GameObject.FindObjectOfType <PinSetter>();
     bowlingBall = GameObject.FindObjectOfType <BowlingBall>();
 }
Exemplo n.º 17
0
 private void Start()
 {
     ball      = FindObjectOfType <BowlingBall>();
     pinSetter = FindObjectOfType <PinSetter>();
     scores    = FindObjectOfType <ScoreDisplay>();
 }
Exemplo n.º 18
0
 private void Start()
 {
     ball = FindObjectOfType <BowlingBall>();
 }
Exemplo n.º 19
0
 void Start()
 {
     ball       = GetComponent <BowlingBall>();
     leftArrow  = GameObject.Find("Left Arrow");
     rightArrow = GameObject.Find("Right Arrow");
 }
Exemplo n.º 20
0
 private void Start()
 {
     bowlingBall = GetComponent <BowlingBall>();
 }
Exemplo n.º 21
0
 private void NewFrame()
 {
     this._ballEntered = null;
     Instantiate(this.BowlingBall);
     OnNewFrame.Invoke();
 }
Exemplo n.º 22
0
 void Start()
 {
     ball = GetComponent <BowlingBall>();
 }
Exemplo n.º 23
0
 // Use this for initialization
 void Start()
 {
     ball        = GameObject.FindObjectOfType <BowlingBall>();
     gameManager = GameObject.FindObjectOfType <GameManager>();
 }