Ejemplo n.º 1
0
 void Start()
 {
     scoreObject = GameObject.Find("ScoreKeeper");
     scoreScript = scoreObject.GetComponent <score>();
     timeObject  = GameObject.Find("TimeKeeper");
     timerScript = timeObject.GetComponent <timerScript>();
 }
Ejemplo n.º 2
0
    //private AIModes hive;
    // Start is called before the first frame update
    void Start()
    {
        routineNeeded = true;
        //Checks if the this is the first time the player is playing the game to show the tutorial
        if (PlayerPrefs.GetInt("firstTime") == 1)
        {
            tutorialShow.SetActive(true);
        }
        else
        {
            tutorialShow.SetActive(false);
        }
        InvokeRepeating("updateGraph", 2.0f, 1f);//Repeats the function to refresh the graph at a rate of 1 second
        if (!PlayerPrefs.HasKey("rentDays"))
        {
            PlayerPrefs.SetInt("rentDays", 4);
        }


        clock  = GetComponent <timerScript>();
        task   = GetComponent <taskManager>();
        player = GameObject.Find("Player").GetComponent <PlayerMovement>();
        if (!PlayerPrefs.HasKey("bankBalance"))
        {
            PlayerPrefs.SetFloat("bankBalance", 0.0f);
        }

        performanceSlider.maxValue = 100;
        //Retrieves the player's performance
        performanceSlider.value = PlayerPrefs.GetInt("performanceManager");
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     leftNum         = 0;
     rightNum        = 0;
     leftScore.text  = leftNum.ToString();
     rightScore.text = rightNum.ToString();
     timer           = FindObjectOfType <timerScript>();
     bIsGameWon      = false;
 }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        GameObject clock = GameObject.Find("Clock");
        clockScript = (timerScript)clock.GetComponent(typeof(timerScript));
        ts = (TextMesh)gameObject.GetComponent("TextMesh");
        int time = clockScript.getTime();

        ts.text = time.ToString();
    }
Ejemplo n.º 5
0
    private void Start()
    {
        fillCon   = gameObject.GetComponent <WaterFillController>();
        timer     = gameObject.GetComponent <timerScript>();
        wallCon   = gameObject.GetComponent <WallController>();
        raycaster = gameObject.GetComponent <globals>();

        timer.StartTimer();
    }
Ejemplo n.º 6
0
    private void Start()
    {
        ts  = gameObject.GetComponent <timerScript>();
        rc  = gameObject.GetComponent <RoundController>();
        wfc = gameObject.GetComponent <WaterFillController>();

        timer.text           = rc.roundLength.ToString();
        rounds.text          = "0";
        waterLevel.text      = "0%";
        waterOverlay.enabled = false;
    }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     playerRB = GetComponent <Rigidbody2D>();
     playerM  = GetComponent <PlayerMovement>();
     timer    = GameObject.Find("GameManager").GetComponent <timerScript>();
     //Intialises the maximum value and the current value of the slider
     staminaSlider.maxValue = maxStamina;
     staminaSlider.value    = maxStamina;
     //Sets the multiplier for different rates
     staminaFallRate    = 1; //Fall rate
     staminaRegainRate  = 1; //Recovery rate
     staminaMaxFallRate = 1; //Max fall rate
 }
Ejemplo n.º 8
0
    void Start()
    {
        //Get and store a reference to the Rigidbody2D component so that we can access it.
        garbage         = new GameObject[transform.childCount];
        garbageCount    = transform.childCount;
        initialPosition = transform.GetChild(0).position;
        for (int i = 0; i < transform.childCount; i++)
        {
            garbage[i] = transform.GetChild(i).gameObject;
        }

        rigidBody          = garbage[0].GetComponent <Rigidbody2D>();
        rigidBody.bodyType = RigidbodyType2D.Kinematic;
        pointer            = GameObject.Find("pointer");
        zero_vector        = Vector2.zero;
        shootButton        = GameObject.Find("Button");


        timer = GameObject.Find("TimeKeeper").GetComponent <timerScript>();
        //Debug.Log("Start Complete");
    }
Ejemplo n.º 9
0
 // Start is called before the first frame update
 void Start()
 {
     time = GetComponent <timerScript>();
     InvokeRepeating("waitToSpawn", 2.0f, 3.0f);//Repeats this process every 3 seconds after the first 2 second of the game
 }
 // Start is called before the first frame update
 void Start()
 {
     gameTime      = GameObject.Find("GameManager").GetComponent <timerScript>();
     originalSpeed = speed; //Stores the player's initial speed
 }
 // Start is called before the first frame update
 void Start()
 {
     timer = GameObject.Find("GameManager").GetComponent <timerScript>();
 }