Пример #1
0
 private void OnBallLaunched(BowlingBall ball)
 {
     if (this._ballSlider)
     {
         this._ballSlider.gameObject.SetActive(false);
     }
 }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        _ball = gameObject.GetComponent <BowlingBall>();

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

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

        SpawnPins();
        LowerPins();
    }
Пример #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);
    }
Пример #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;
    }
Пример #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);
            }
        }
Пример #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();
            }
        }
    }
Пример #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;
        }
    }
Пример #11
0
 // Use this for initialization
 void Start()
 {
     _ball = gameObject.GetComponent <BowlingBall>();
 }
Пример #12
0
    // Use this for initialization
    void Start()
    {
        bowlingball = GameObject.FindObjectOfType <BowlingBall>();

        offset = gameObject.transform.position - bowlingball.transform.position;
    }
Пример #13
0
 private void Start()
 {
     gameManager      = FindObjectOfType <GameManager>();
     ball             = FindObjectOfType <BowlingBall>();
     lastSettledCount = 10;
 }
Пример #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();
    }
Пример #15
0
    //here

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