Inheritance: MonoBehaviour
Example #1
0
    // Use this for initialization
    void Start()
    {
        pinSetter    = FindObjectOfType <PinSetter>();
        ball         = FindObjectOfType <Ball>();
        scoreDisplay = FindObjectOfType <ScoreDisplay>();

        promptsParent = GameObject.Find("Prompts");

        if (!promptsParent)
        {
            Debug.LogError("Could not find prompts parent object!");
            return;
        }

        replayPrompt = promptsParent.transform.Find("ReplayPrompt");

        if (!replayPrompt)
        {
            Debug.LogError("Could not find a replay prompt!");
        }

        /////////////Test code///////////////
        //var testScores = new List<int> { 10, 10, 10, 10, 9, 0, 10, 10, 10, 10, 10, 9, 1 };

        //foreach (var testScore in testScores)
        //{
        //    Bowl(testScore);
        //}
        /////////////Test code///////////////
    }
Example #2
0
 // 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()
 {
     ball       = GameObject.FindObjectOfType <BallMovement>();
     pinSetter  = GameObject.FindObjectOfType <PinSetter>();
     scoreBoard = GameObject.FindObjectOfType <ScoreDisplay>();
     EndgamePanel.SetActive(false);
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     playerOneNameText = GameObject.Find("Player one name").GetComponent <Text>();
     playerTwoNameText = GameObject.Find("Player two name").GetComponent <Text>();
     ball                        = GameObject.Find("Ball").GetComponent <Ball>();
     pinSetter                   = GameObject.Find("Pin Setter").GetComponent <PinSetter> ();
     scoreDisplayPlayerOne       = GameObject.Find("Score Panel Player One").GetComponent <ScoreDisplay> ();
     scoreDisplayPlayerTwo       = GameObject.Find("Score Panel Player Two").GetComponent <ScoreDisplay> ();
     gameMode                    = GameObject.FindObjectOfType <GameMode> ();
     levelManager                = GameObject.FindObjectOfType <LevelManager> ();
     originalBoardColor          = scoreDisplayPlayerOne.gameObject.GetComponent <Image> ().color;
     yellowBoardColor            = Color.yellow;
     marbleInitialTexture        = ball.gameObject.GetComponent <MeshRenderer> ().material;
     playerOneName               = gameMode.GetPlayerOneName();
     playerTwoName               = gameMode.GetPlayerTwoName();
     bowlsPlayerOne              = new List <int> ();
     bowlsPlayerTwo              = new List <int> ();
     playerOneNameText.text      = playerOneName;
     playerTwoNameText.text      = playerTwoName;
     thisPlayerTurn              = true;
     hasPlayerOneFinishedBowling = false;
     hasPlayerTwoFinishedBowling = false;
     playerOneFinalScore         = 0;
     playerTwoFinalScore         = 0;
     scoreDisplayPlayerOne.gameObject.GetComponent <Image> ().color = yellowBoardColor;
 }
Example #5
0
    void Start()
    {
        pinSetter = GameObject.FindObjectOfType <PinSetter>();
        ball      = GameObject.FindObjectOfType <rollBall>();

        scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>();
    }
Example #6
0
 void Start()
 {
     pinCounterText   = GameObject.Find("PinCounterText").GetComponent <Text> ();
     gameManager      = FindObjectOfType <GameManager> ();
     pinSetter        = FindObjectOfType <PinSetter> ();
     cameraController = FindObjectOfType <CameraController> ();
 }
Example #7
0
 // Use this for initialization
 void Start()
 {
     rolls        = new List <int>();
     pinSetter    = GameObject.FindObjectOfType <PinSetter>();
     ball         = GameObject.FindObjectOfType <Ball>();
     scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>();
 }
 private void Start()
 {
     ball         = FindObjectOfType <Ball>();       //找球
     dragLaunch   = FindObjectOfType <DragLaunch>(); //找發射板
     pinSetter    = FindObjectOfType <PinSetter>();
     scoreDisplay = FindObjectOfType <ScoreDisplay>();
 }
Example #9
0
 private void Start()
 {
     animator   = GameObject.Find("Pin Setter").GetComponent <Animator>();
     ball       = FindObjectOfType <Ball>();
     pinCounter = FindObjectOfType <PinCounter>();
     pinSetter  = FindObjectOfType <PinSetter>();
 }
Example #10
0
    //Ben's Code for nudge buttons
    //public bool inPlay = false;

    // Use this for initialization
    void Start()
    {
        initialPos           = transform.position;
        rigidBody            = GetComponent <Rigidbody>();
        audioSource          = GetComponent <AudioSource>();
        pinSetter            = FindObjectOfType <PinSetter>();
        rigidBody.useGravity = false;
    }
Example #11
0
    private void Start()
    {
        scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>();

        pinSetter = GameObject.FindObjectOfType <PinSetter>();

        ball = GameObject.FindObjectOfType <Ball>();
    }
Example #12
0
    // Use this for initialization
    void Start()
    {
        bowls     = new List <int>();
        pinSetter = FindObjectOfType <PinSetter>();
        ball      = FindObjectOfType <Ball>();

        scoreDisplay = FindObjectOfType <ScoreDisplay>();
    }
Example #13
0
    // Use this for initialization
    void Start()
    {
        pinSetter = GameObject.FindObjectOfType <PinSetter>();

        if (!pinSetter)
        {
            Debug.Log("No Pin Setter found.");
        }
    }
Example #14
0
 // Use this for initialization
 void Start()
 {
     animator  = GetComponent <Animator>();
     rigidbody = GetComponent <Rigidbody>();
     pinSetter = GameObject.FindObjectOfType <PinSetter>();
     angels    = gameObject.transform.rotation.eulerAngles;
     //print(angels);
     //Invoke("printAngels", 5);
 }
Example #15
0
 // Use this for initialization
 void Start()
 {
     pinSetter       = GameObject.FindObjectOfType <PinSetter>();
     scoreDisplay    = GameObject.FindObjectOfType <ScoreDisplay>();
     popupController = GameObject.FindObjectOfType <PopupController>();
     bowls           = new List <int>();
     frameScores     = new List <int>();
     gameComplete    = false;
 }
Example #16
0
    void Start () {
        //Vector3 currentVelocity = this.GetComponent<Rigidbody>().velocity;
        //this.GetComponent<Rigidbody2D>().velocity = new Vector2(currentVelocity.x + xBump, currentVelocity.y);
        pinSetter = GameObject.FindObjectOfType<PinSetter>();
        rigidBody = GetComponent<Rigidbody>();
        startPosition = transform.position;
        Reset();

    } // void Start () {
Example #17
0
 void Start()
 {
     _setter = gameObject.AddComponent <PinSetter>();
     Instantiate(pinsPrefab, pinsPosition.transform.position, Quaternion.identity, transform);
     _setter.FindPins();
     _player = GameObject.Find("GameManager").GetComponent <PlayerScore>();
     manager = GameObject.Find("GameManager").GetComponent <GameManager>();
     manager.SetPinSetter(_setter);
 }
Example #18
0
 // 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> ();
 }
Example #19
0
    //private AudioSource myAudioSource;

    // Use this for initialization
    void Start()
    {
        inPlay      = false;
        myRigidBody = GetComponent <Rigidbody> ();
        //myAudioSource = GetComponent<AudioSource> ();
        ballStartPos = transform.position;
        pinSetter    = GameObject.FindObjectOfType <PinSetter>();

        ResetPosition();
    }
Example #20
0
 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;
 }
Example #21
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);
    }
    void Start()
    {
        pinSetter    = GameObject.FindObjectOfType <PinSetter>();
        ball         = GameObject.FindObjectOfType <Ball>();
        scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>();

        touchPanel = GameObject.Find("Touch Input");
        resetPanel = GameObject.FindObjectOfType <ResetPanel>();

        touchPanel.SetActive(true);
        resetPanel.gameObject.SetActive(false);
    }
Example #23
0
    // Use this for initialization
    void Start()
    {
        rigidBody         = GetComponent <Rigidbody>();
        ballSpawnLocation = transform.position;
        ballSpawnRotation = transform.eulerAngles;

        rigidBody.useGravity = false;

        pinSetter = GameObject.FindObjectOfType <PinSetter>();

        sweeper = GameObject.FindObjectOfType <PinMaster2000>().transform.GetChild(1).gameObject;
    }
Example #24
0
 // Use this for initialization
 void Start()
 {
     playerNameText      = GameObject.Find("Player one name").GetComponent <Text>();
     ball                = GameObject.Find("Ball").GetComponent <Ball>();
     pinSetter           = GameObject.Find("Pin Setter").GetComponent <PinSetter> ();
     scoreDisplay        = GameObject.Find("Score Panel Player One").GetComponent <ScoreDisplay> ();
     gameMode            = GameObject.FindObjectOfType <GameMode> ();
     levelManager        = GameObject.FindObjectOfType <LevelManager> ();
     bowlsList           = new List <int> ();
     playerName          = gameMode.GetPlayername();
     playerNameText.text = playerName;
     playerFinalScore    = 0;
     SetUpBallSkin();
 }
Example #25
0
    // Use this for initialization
    void Start()
    {
        pinSetter = GameObject.FindObjectOfType <PinSetter> ();

        scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay> ();
        pcGO         = GameObject.FindObjectOfType <PlayerCountGO> ();
        levelManager = GameObject.FindObjectOfType <LevelManager> ();

        try{
            players = pcGO.GetPlayerCount();
        }catch {
            Debug.LogWarning("WARNING: no PlayerCountGO found. Did you start from menu?");
        }
        CreatePlayers();
    }
Example #26
0
	// Use this for initialization
	void Start () {
        if (ball == null)
        {
            ball = GameObject.FindObjectOfType<Ball>();
        }
        if (pinSetter == null)
        {
            pinSetter = GameObject.FindObjectOfType<PinSetter>();
        }
        if (scoreDisplay == null)
        {
            scoreDisplay = GameObject.FindObjectOfType<ScoreDisplay>();
        }
        InitializePinCounter();
	}
    void Start()
    {
        pinSetter    = GameObject.FindObjectOfType <PinSetter>();
        ball         = GameObject.FindObjectOfType <Ball>();
        scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay>();

        if (PlayerPrefs.HasKey(highScoreKey))
        {
            highScore = PlayerPrefs.GetInt(highScoreKey);
        }
        else
        {
            PlayerPrefs.SetInt(highScoreKey, 0);
            highScore = 0;
        }

        scoreDisplay.SetHighScore(highScore);
    }
Example #28
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator> ();
         myrigidbody = gameObject.GetComponent<Rigidbody>();
     pinSetter = GameObject.FindObjectOfType<PinSetter> ();
 }
Example #29
0
 // Use this for initialization
 void Start()
 {
     pinSetter = GameObject.FindObjectOfType<PinSetter> ();
     ball = GameObject.FindObjectOfType<Ball> ();
     scoreDisplay = GameObject.FindObjectOfType<ScoreDisplay> ();
 }
    // Use this for initialization
    void Start()
    {
        queue.Enqueue (player1);
        queue.Enqueue (player2);
        queue.Enqueue (player3);

        pinsetter = GameObject.FindObjectOfType<PinSetter>();
        ball = GameObject.FindObjectOfType<Ball> ();

        currentPlayer = queue.Peek ();
    }
Example #31
0
 void Start()
 {
     pinSetter = FindObjectOfType<PinSetter>();
 }
Example #32
0
 // Use this for initialization
 void Start()
 {
     scoreDisplay = FindObjectOfType <ScoreDisplay>();
     pinSetter    = FindObjectOfType <PinSetter>();
     ball         = FindObjectOfType <Ball>();
 }
 static RpiGpio()
 {
     Pins = new PinSetter();
     setup_io();
 }
Example #34
0
 void Start()
 {
     ball      = GetComponent <Ball>();
     pinSetter = GameObject.FindObjectOfType <PinSetter>();
 }
Example #35
0
 // Use this for initialization
 void Start()
 {
     pinSetter = FindObjectOfType <PinSetter>();
 }
Example #36
0
 // Use this for initialization
 void Start()
 {
     pinSetter = GameObject.FindObjectOfType<PinSetter>();
     ball = GameObject.FindObjectOfType<Ball>();
 }
Example #37
0
 // Use this for initialization
 void Start()
 {
     pinSetter = GameObject.FindObjectOfType <PinSetter> ();
 }
Example #38
0
 // Use this for initialization
 void Start()
 {
     pinSetter = FindObjectOfType<PinSetter>();
     pinSetterAnim = pinSetter.GetComponent<Animator>();
 }