// Use this for initialization void Start() { ball = GameObject.FindObjectOfType <Ball>(); pinSetter = GameObject.FindObjectOfType <PinSetter>(); pinCounter = GameObject.FindObjectOfType <PinCounter>(); scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>(); }
// Use this for initialization void Start() { pinSetParent = GameObject.Find("Pins"); pinCounter = GameObject.FindObjectOfType <PinCounter>(); anim = gameObject.GetComponent <Animator>(); actionMaster = new ActionMaster(); }
// Use this for initialization void Start() { //1ball = FindObjectOfType<Ball>(); animator = GetComponent <Animator>(); pinCounter = FindObjectOfType <PinCounter>(); }
void Start() { animator = GetComponent <Animator>(); pinCounter = GameObject.FindObjectOfType <PinCounter>(); gameManager = GameObject.FindObjectOfType <GameManager>(); }
void Start() { pinSetterController = GameObject.FindObjectOfType <PinSetterController>(); ballController = GameObject.FindObjectOfType <BallController>(); pinCounter = GameObject.FindObjectOfType <PinCounter>(); scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>(); levelManager = GameManager.FindObjectOfType <LevelManager>(); }
void Start() { m_ballBody = GetComponent <Rigidbody>(); m_ballBody.useGravity = false; m_pinCounter = FindObjectOfType <PinCounter>(); m_startPosition = transform.position; m_startRotation = transform.rotation; }
private void Start() { animator = GetComponent <Animator>(); waitAnimate = waitIndicator.GetComponent <Animator>(); pinCounter = GameObject.FindObjectOfType <PinCounter>(); gameManager = GameObject.FindObjectOfType <GameManager>(); waitAnimate.enabled = false; }
// Use this for initialization void Start() { rigidBody = GetComponent <Rigidbody>(); audioSource = GetComponent <AudioSource>(); rigidBody.useGravity = false; ballStartPos = transform.position; gameManager = GameObject.FindObjectOfType <GameManager>(); pinCounter = GameObject.FindObjectOfType <PinCounter>(); }
void Start() { animator = GetComponent<Animator>(); pinCounter = FindObjectOfType<PinCounter>(); foreach (Pin pin in FindObjectsOfType<Pin>()) { pin.GetComponent<Rigidbody>().useGravity = true; } }
// Use this for initialization void Start() { ball = GameObject.FindObjectOfType <BallControl>(); cam = GameObject.FindObjectOfType <CameraFollow>(); ballsound = GameObject.FindObjectOfType <BallSound>(); pinsetter = GameObject.FindObjectOfType <PinSetter> (); pincounter = GameObject.FindObjectOfType <PinCounter> (); swip = GameObject.FindObjectOfType <Swiper> (); scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay> (); }
// Use this for initialization void Start() { audioSource = GetComponent <AudioSource>(); pinCounter = GameObject.FindObjectOfType <PinCounter>(); rigidBody = GetComponent <Rigidbody>(); rigidBody.useGravity = false; // Capture starting position startPos = transform.position; startRot = transform.rotation; }
private void Start() { pinSetter = GameObject.FindObjectOfType <PinSetter>(); pinCounter = GameObject.FindObjectOfType <PinCounter>(); ball = GameObject.FindObjectOfType <Ball>(); dragLaunch = GameObject.FindObjectOfType <DragLaunch>(); scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>(); gameOverPanel = GameObject.Find("GameOverPanel"); gameOverPanel.SetActive(false); playerName = PlayerNameController.playerName; playerText.text = playerName; }
void CheckForUprightPins() { int currentlyStanding = PinCounter.amountPinsStanding(); // Gets how much pins are standing upright as of now if (currentlyStanding != lastUprightCount) // if there's a new amount of upright pins { lastUprightCount = currentlyStanding; // update the last upright count to be the current standing count lastChangeTime = Time.time; // also update the time return; } float settleTime = 3f; // length of time it takes to wait for the game to consider whether the pins are settled or not if ((Time.time - lastChangeTime) > settleTime) // if the time since the last change is longer than how long it takes to settle { PinsHaveSettled(); } thaScore.text = PinCounter.amountPinsStanding().ToString(); //start updating score, as we want the program to start updating score once the ball actually enters the pin area }
// Use this for initialization void Start() { if (GetComponent <Animator> ()) { animator = GetComponent <Animator> (); } else { Debug.LogWarning("Missing Animator."); } if (GameObject.Find("PinFormation")) { pinFormation = GameObject.Find("PinFormation"); renewPos = GameObject.Find("PinFormation").transform.position; } else { Debug.LogWarning("Missing PinFormation."); } if (GameObject.FindObjectOfType <PinCounter>()) { pinCounter = GameObject.FindObjectOfType <PinCounter>(); } else { Debug.LogWarning("Missing pinCounter."); } if (GameObject.FindObjectOfType <GameManager>()) { gameManager = GameObject.FindObjectOfType <GameManager>(); } else { Debug.LogWarning("Missing gameManager."); } }
///////////////////////////////////////////////////////////////////////////////////////////// void PinsHaveSettled() { int pinsNotStanding = lastSettledCount - PinCounter.amountPinsStanding(); //gets the amount of pins fell (reminder that lastSettledCount equals 10 at this point) lastSettledCount = PinCounter.amountPinsStanding(); //updates last settledcount List <int> pinsNotStandingList = new List <int>(); //Makes a list so it can be processed by the actionmaster, which ONLY takes lists pinsNotStandingList.Add(pinsNotStanding); ActionMaster2.Action action = ActionMaster2.NextAction(pinsNotStandingList); //Makes an action based on pinsNotStandingList. switch (action) //if action... { case ActionMaster2.Action.Tidy: // PinSetter.anim.SetTrigger("tidyTrigger"); break; case ActionMaster2.Action.Reset: PinSetter.anim.SetTrigger("resetTrigger"); break; case ActionMaster2.Action.EndGame: throw new UnityException("Implement the endgame fool"); break; case ActionMaster2.Action.EndTurn: PinSetter.anim.SetTrigger("resetTrigger"); break; } ball.BallReset(); //reset ball to old pos, removes velocity, etc lastUprightCount = -1; //Reintialization lastChangeTime = 0; ///Reintialization PinSetter.ballTouched = false; //Reintialization thaScore.color = Color.green; //make the text green b/c fun //Pin[] oldPins = FindObjectsOfType<Pin>(); //gets all the pins that exist //foreach (Pin pin in oldPins) {Destroy (pin.gameObject);} //Gets every pin in oldPins and destroys them //Instantiate (pins, this.transform.position, Quaternion.identity); //then make new ones!! }
void Start() { animator = GetComponent<Animator>(); pinCounter = GameObject.FindObjectOfType<PinCounter>(); }