Exemple #1
0
    void Start()
    {
        start     = GameObject.Find("JeesusPerkele").GetComponent <Button> ();
        nextScene = GameObject.Find("NextSceneManager").GetComponent <NextSceneManager> ();

        start.onClick.AddListener(NextSceneGo);
    }
    // Use this for initialization
    /// <summary>
    /// Find all cars, buttons and add listener
    /// </summary>
    void Start()
    {
        nextSceneManager = GameObject.Find("NextSceneManager").GetComponent <NextSceneManager>();

        playerCar = GameObject.Find("PlayerCar").GetComponent <PlayerCar>();

        xCar1 = GameObject.Find("X-Car1").GetComponent <XCar>();
        xCar2 = GameObject.Find("X-Car2").GetComponent <XCar>();
        xCar3 = GameObject.Find("X-Car3").GetComponent <XCar>();
        xCar4 = GameObject.Find("X-Car4").GetComponent <XCar>();
        xCar5 = GameObject.Find("X-Car5").GetComponent <XCar>();
        xCar6 = GameObject.Find("X-Car6").GetComponent <XCar>();

        yCar1 = GameObject.Find("Y-Car1").GetComponent <YCar>();
        yCar2 = GameObject.Find("Y-Car2").GetComponent <YCar>();
        yCar3 = GameObject.Find("Y-Car3").GetComponent <YCar>();
        yCar4 = GameObject.Find("Y-Car4").GetComponent <YCar>();
        yCar5 = GameObject.Find("Y-Car5").GetComponent <YCar>();
        yCar6 = GameObject.Find("Y-Car6").GetComponent <YCar>();

        right    = GameObject.Find("ButtonRight").GetComponent <Button>();
        left     = GameObject.Find("ButtonLeft").GetComponent <Button>();
        up       = GameObject.Find("ButtonUp").GetComponent <Button>();
        down     = GameObject.Find("ButtonDown").GetComponent <Button>();
        textArea = GameObject.Find("TextField").GetComponent <Text>();

        reset = GameObject.Find("ButtonReset/Continue").GetComponent <Button>();
        reset.onClick.AddListener(ResetGame);
        buttonText      = GameObject.Find("ButtonReset/Continue").GetComponentInChildren <Text>();
        buttonText.text = "Reset";
    }
Exemple #3
0
 void Start()
 {
     nextSceneManager = GameObject.Find("NextSceneManager").GetComponent <NextSceneManager>();
     buttonReset      = GameObject.Find("ButtonReset").GetComponent <Button> ();
     buttonContinue   = GameObject.Find("ButtonContinue").GetComponent <Button> ();
     buttonReset.onClick.AddListener(buttonRestart);
     buttonContinue.onClick.AddListener(buttonContinueGame);
     buttonContinue.gameObject.SetActive(false);
     // Finds the buttons and sets them non active at the start
 }
Exemple #4
0
 void Start()
 {
     nextSceneManager = GameObject.Find("NextSceneManager").GetComponent <NextSceneManager> ();
     ButtonRestart    = GameObject.Find("ButtonRestart").GetComponent <Button> ();
     ButtonContinue   = GameObject.Find("ButtonContinue").GetComponent <Button> ();
     rigidBody        = GetComponent <Rigidbody2D> ();
     animator         = transform.GetComponentInChildren <Animator> ();
     ButtonContinue.gameObject.SetActive(false);
     ButtonRestart.gameObject.SetActive(false);
     Score.highScore = PlayerPrefs.GetInt("highScore", Score.highScore);
     ButtonRestart.onClick.AddListener(Restart);
     ButtonContinue.onClick.AddListener(Continue);
 }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        button = GameObject.Find("ButtonA").GetComponent <Button>();
        button.onClick.AddListener(MeClicked);

        nextSceneManager = GameObject.Find("NextSceneManager").GetComponent <NextSceneManager>();

        if (textFile.text != null)
        {
            textLines = textFile.text.Split('\n');
        }
        lastLine = textLines.Length;
    }
Exemple #6
0
 void Awake()
 {
     //Set the instance only once.
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         //Enforces that there will always be one instance of a gameObject. This is for type errors prevention
         Destroy(gameObject);
         Debug.LogWarning("Another instance of NextSceneManager have been created and destoryed!");
     }
 }
    // Use this for initialization
    /// <summary>
    /// etsitään värit ja tehdään niistä Array
    /// </summary>
    void Start()
    {
        red    = GameObject.Find("Red").GetComponent <SpriteRenderer>();
        green  = GameObject.Find("Green").GetComponent <SpriteRenderer>();
        blue   = GameObject.Find("Blue").GetComponent <SpriteRenderer>();
        yellow = GameObject.Find("Yellow").GetComponent <SpriteRenderer>();
        Colors = new SpriteRenderer[] { red, green, blue, yellow };

        gameText         = GameObject.Find("GameText").GetComponent <Text>();
        nextSceneManager = GameObject.Find("NextSceneManager").GetComponent <NextSceneManager>();

        gameButton = GameObject.Find("GameButton").GetComponent <Button>();
        buttonText = GameObject.Find("GameButton").GetComponentInChildren <Text>();
        gameButton.onClick.AddListener(StartGame);
    }
Exemple #8
0
 /// <summary>
 /// When the Exit collider is touched it summons it
 /// </summary>
 void Start()
 {
     nextScenemanager = GameObject.Find("NextSceneManager").GetComponent <NextSceneManager> ();
 }