コード例 #1
0
        // Use this for initialization
        void Start()
        {
            GameObject historyObject = GameObject.Find("History");

            history = historyObject.GetComponent <History>();
            placeCar(history.levelName);

            maxSpeed        = history.getCarMaxSpeed();
            minSpeed        = history.getCarMinSpeed();
            laneChangeSpeed = history.getLaneChangeSpeed();

            fb = GameObject.FindObjectOfType <FitBoardHandler>();

            curLanePos = 0;
            child      = GameObject.Find("Car").GetComponent <Transform>();
            marker     = GameObject.Find("Marker").GetComponent <SpeedometerMarker>();
            velocity   = velocityExp;
            marker.updateMarker(velocityExp);
            moving          = false;
            left            = false;
            right           = false;
            hittingSide     = false;
            laneChangeHelp  = false;
            laneChangeHelp2 = false;
            noHits          = true;
            turnDegreeInput = 1;
            turnDegree      = (0.0015f * Mathf.Pow(turnDegreeInput, 2));
            relPos          = 0;
            active          = false;
        }
コード例 #2
0
#pragma warning restore 0649
        // Use this for initialization
        void Start()
        {
            fb   = FindObjectOfType <FitBoardHandler>();
            anim = GetComponent <Animator>();
            //StartCoroutine(MakeHole());
            canSpawn = true;
        }
コード例 #3
0
ファイル: BallGod.cs プロジェクト: ReGame-VR/fitboard-v2
    // Use this for initialization
    void Start()
    {
        // initalize all colors to true (can be changed in game settings)
        usingGreen  = true;
        usingBlue   = true;
        usingRed    = true;
        usingYellow = true;

        // setup inital preferences in playerprefsmanager
        PlayerPrefsManager.SetBallPopperDifficulty(0);     // set to Easy initially
        PlayerPrefsManager.SetBallPopperTimeLimit(0);      // set to 30 seconds initially
        PlayerPrefsManager.SetBallPopperVolume(0);         // volume set to zero (volume not implemented)
        PlayerPrefsManager.SetBallPopperSFXVolume(1);      // volume set to zero (volume not implemented)

        // set default time limit here
        timeLimit = 30;
        // set score to zero
        score = 0;
        // instance of audio source that plays pop noise
        popAudio = Object.FindObjectOfType <PlayPopNoise>();

        // hard coded width and height for game
        height = 8;
        width  = 15;

        // set ball velocities based off width and height
        SetVelocities();

        // start spawning balls!
        StartSpawning();

        fb = FindObjectOfType <FitBoardHandler>();
    }
コード例 #4
0
ファイル: Painter.cs プロジェクト: ReGame-VR/fitboard-scripts
        // Use this for initialization
        void Start()
        {
            fbHandler = FindObjectOfType <FitBoardHandler>();
            if (!fbHandler)
            {
                Debug.LogError("No FitBoardSettingsHandler object found in scene!");
            }

            PrintToText.filePath = Application.dataPath + "/";

            InitializeFields();

            SetColors();

            InitializeBoard();

            // if the there have been any trials or the data file does not exist
            if (!File.Exists(PrintToText.filePath + PrintToText.FILE_NAME))
            {
                // reset trial number
                trialNumber = 1;
            }
            else
            {
                // trial number is the number of lines in the file
                trialNumber = File.ReadAllLines(PrintToText.filePath + PrintToText.FILE_NAME).Length;
            }
        }
コード例 #5
0
        // Initialization
        void Start()
        {
            ding      = GetComponent <AudioSource>();
            fbHandler = FindObjectOfType <FitBoardHandler>();
            gameplayCanvas.SetActive(false);
            endLight.SetActive(false);
            scoreText.text = "";

            minLimit = 2;
            secLimit = 0;

            bryg    = new GameObject[4];
            bryg[0] = blue;
            bryg[1] = red;
            bryg[2] = yellow;
            bryg[3] = green;

            level       = 0;
            answerCount = 0;
            points      = 0;

            blue.SetActive(false);
            red.SetActive(false);
            yellow.SetActive(false);
            green.SetActive(false);

            startGame  = false;
            answerTurn = false;
        }
コード例 #6
0
 void Start()
 {
     fbHandler = FindObjectOfType <FitBoardHandler>();
     rb        = GetComponent <Rigidbody>();
     count     = 0;
     setCountText();
     end       = false;
     ballSpeed = defaultSpeed * PlayerPrefsManager.GetRollBallSpeed();
 }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     spritenum   = PlayerPrefsManager.GetMoveSpriteNumber();
     sr          = GetComponent <SpriteRenderer>();
     sr.sprite   = sprites[spritenum];
     gameMode    = PlayerPrefsManager.GetMoveGameMode();
     fb          = FindObjectOfType <FitBoardHandler>();
     audioSource = GetComponent <AudioSource>();
     keyPresses  = 0;
 }
コード例 #8
0
    /*
     * public static GameObject instance;
     *
     * void Awake() {
     *  if (instance) {
     *      Destroy(this.gameObject);
     *  } else {
     *      instance = this.gameObject;
     *      DontDestroyOnLoad(this.gameObject);
     *  }
     * }
     */

    private void Awake()
    {
        if (instance == null)
        {
            DontDestroyOnLoad(this.gameObject);
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
コード例 #9
0
ファイル: Painter.cs プロジェクト: ReGame-VR/fitboard-v2
                // Use this for initialization
                void Start()
                {
                    fbHandler = FindObjectOfType <FitBoardHandler>();
                    if (!fbHandler)
                    {
                        Debug.LogError("No FitBoardSettingsHandler object found in scene!");
                    }

                    InitializeFields();

                    InitializeBoard();

                    // if the there have been any trials or the data file does not exist
                    //trialNumber = PrintData.GetTrialNumber();
                }