void Start()
    {
        baseline  = GameControl.currentBaselineAvg;
        threshold = GameControl.currentThresholdAvg;

        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("UDPReciever");

        if (gameControllerObject != null)
        {
            read2UDP = gameControllerObject.GetComponent <Read2UDP>();
        }
        if (read2UDP == null)
        {
            Debug.Log("Cannot find 'read2UDP' script");
        }

        for (int i = 0; i < matObject.Length; i++)
        {
            matObject[i].color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
            matObject[i].SetFloat("_Metallic", 1.0f);
        }

        score    = 0;
        distance = 350;

        distanceCanvas.alpha = 0;
        slideCanvas.alpha    = 0;
        AddDistance();
        UpdateScore();
        // UpdateDistance ();
        StartCoroutine(SpawnWaves());
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        baseline  = GameControl.currentBaselineAvg;
        threshold = GameControl.currentThresholdAvg;

        baselineSetText.text  = baseline.ToString();
        thresholdSetText.text = threshold.ToString();

        //matObject.color = Color.black;
        isSaved = false;
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("UDPReciever");

        if (gameControllerObject != null)
        {
            read2UDP = gameControllerObject.GetComponent <Read2UDP>();
        }
        if (read2UDP == null)
        {
            Debug.Log("Cannot find 'read2UDP' script");
        }

        i = 1f;       // initial smooth color changing

        hardFactor = 1;
        helpFactor = 0;
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        myRigidBody         = GetComponent <Rigidbody2D>();
        myAnimator          = GetComponent <Animator>();
        myFeet              = GetComponent <BoxCollider2D>();
        myCirclebody        = GetComponent <CircleCollider2D>();
        myWeapon            = GetComponent <PolygonCollider2D>();
        gravityScaleAtStart = myRigidBody.gravityScale;
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("UDPReceiver");

        if (gameControllerObject != null)
        {
            read2UDP = gameControllerObject.GetComponent <Read2UDP>();
        }
    }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        baseline  = GameControl.currentBaselineAvg;
        threshold = GameControl.currentThresholdAvg;
        isSaved   = false;
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("UDPReciever");

        if (gameControllerObject != null)
        {
            read2UDP = gameControllerObject.GetComponent <Read2UDP>();
        }
        if (read2UDP == null)
        {
            Debug.Log("Cannot find 'read2UDP' script");
        }
    }
    // Use this for initialization
    void Start()
    {
        matObject.color = new Color(0f, 0f, 0f, 255f);
        //matObject.color = Color.black;
        isSaved = false;
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("UDPReciever");

        if (gameControllerObject != null)
        {
            read2UDP = gameControllerObject.GetComponent <Read2UDP>();
        }
        if (read2UDP == null)
        {
            Debug.Log("Cannot find 'read2UDP' script");
        }
    }
Beispiel #6
0
    void Start()
    {
        baseline  = GameControl.currentBaselineAvg;
        threshold = GameControl.currentThresholdAvg;

        difficultDropdown.onValueChanged.AddListener(delegate {
            actionDropdownValueChanged(difficultDropdown);
        });

        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("UDPReciever");

        if (gameControllerObject != null)
        {
            read2UDP = gameControllerObject.GetComponent <Read2UDP>();
        }
        if (read2UDP == null)
        {
            Debug.Log("Cannot find 'read2UDP' script");
        }

        for (int i = 0; i < matObject.Length; i++)
        {
            matObject[i].color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
            matObject[i].SetFloat("_Metallic", 1.0f);
        }

        audioSource      = gameObject.GetComponent <AudioSource>();
        audioSource.clip = backgroundAudio;
        isPlayAudio      = false;

        score    = 0;
        distance = 350;

        centerSlideCanvas.alpha = 0;
        distanceCanvas.alpha    = 0;
        slideCanvas.alpha       = 0;
        AddDistance();
        UpdateScore();
        // UpdateDistance ();
        StartCoroutine(SpawnWaves());
    }
Beispiel #7
0
    // Use this for initialization
    void Start()
    {
        baseline  = GameControl.currentBaselineAvg;
        threshold = GameControl.currentThresholdAvg;
        isSaved   = false;
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("UDPReciever");

        if (gameControllerObject != null)
        {
            read2UDP = gameControllerObject.GetComponent <Read2UDP>();
        }
        if (read2UDP == null)
        {
            Debug.Log("Cannot find 'read2UDP' script");
        }
        myRigidBody         = GetComponent <Rigidbody2D>();
        myAnimator          = GetComponent <Animator>();
        myFeet              = GetComponent <BoxCollider2D>();
        myCirclebody        = GetComponent <CircleCollider2D>();
        myWeapon            = GetComponent <PolygonCollider2D>();
        gravityScaleAtStart = myRigidBody.gravityScale;
    }