void Start()
    {
        timer = ScriptableObject.CreateInstance <AdvancedTimer>();
        timer.Init(1.5f, -1, true, 0, 1.5f, false, false, false);

        score        = new float[numTrials];
        reactionTime = new float[numTrials];
        forceBlink   = new bool[numTrials];

        #region Randomly Assign Forced Blinks
        for (int i = 0; i < (int)numTrials / 2; i++)
        {
            int randIndex = Random.Range(0, numTrials);

            while (true)
            {
                if (!forceBlink[randIndex])
                {
                    forceBlink[randIndex] = true;
                    break;
                }
                else
                {
                    randIndex = Random.Range(0, numTrials);
                }
            }
        }
        #endregion

        Instructions.gameObject.SetActive(true);
        PromptInput.gameObject.SetActive(false);
    }
Exemple #2
0
    void Start()
    {
        intendedPosition = transform.position;
        kickTimer        = ScriptableObject.CreateInstance <AdvancedTimer>();

        kickTimer.Init(recoverDur, -1, false, 0, 0, false);
        kickTimer.Stop();
        kickTimer.ContinuousReset = false;
    }
    void Start()
    {
        intendedPosition = transform.position;
        kickTimer = ScriptableObject.CreateInstance<AdvancedTimer>();

        kickTimer.Init(recoverDur, -1, false, 0,0, false);
        kickTimer.Stop();
        kickTimer.ContinuousReset = false;
    }
    void Start()
    {
        platChar       = GetComponent <PlatformerCharacter2D>();
        platController = GetComponent <Platformer2DUserControl>();

        SetupParticles();
        DisableAllParticles();

        if (Runner.Inst == null)
        {
            Runner.Inst = this;
            //Debug.Log(Runner.Inst);
        }

        score = new float[] { 0.0f, 0.0f, 0.0f, 0.0f };

        WorldIndex = 0;

        shiftTimer = ScriptableObject.CreateInstance <AdvancedTimer>();
        shiftTimer.Init(shiftCooldown, 0, true, 0, 0, false, false);

        healthSlider.maxValue = maxHealth;
        healthSlider.value    = health;

        //speedSlider.maxValue = maxSpeed;
        //speedSlider.minValue = minSpeed;
        //speedSlider.value = speed;

        speed = (maxSpeed + minSpeed) / 2;
        //speed = minSpeed;

        Lanes = new GameObject[4, 4];

        Kicks        = new CameraKick[4];
        ScoreDisplay = new Text[4];
        for (int i = 0; i < Cameras.Length; i++)
        {
            Kicks[i] = Cameras[i].GetComponent <CameraKick>();

            ScoreDisplay[i] = Cameras[i].transform.FindChild("Camera Canvas").FindChild("Panel").FindChild("Score Text").GetComponent <Text>();
        }

        PhaseShift(Random.Range(0, 3));
        SetCameras();
    }
Exemple #5
0
    public void Start()
    {
        triggerParticle = Resources.Load <GameObject>("Danger");
        string spriteFileName = "";

        if (affiliation == Element.Fire)
        {
            spriteFileName = "RedBox";
            //sRend.material.color = new Color(8f, .25f, .0f);
        }
        if (affiliation == Element.Water)
        {
            spriteFileName = "BlueBox";
            //sRend.material.color = new Color(.3f, .3f, .8f);
        }
        if (affiliation == Element.Earth)
        {
            spriteFileName = "BrownBox";
            //sRend.material.color = new Color(.6f, .6f, .2f);
        }
        if (affiliation == Element.Air)
        {
            spriteFileName = "GreenBox";
            //sRend.material.color = new Color(.2f, .7f, .5f);
        }

        resetTimer = ScriptableObject.CreateInstance <AdvancedTimer>();
        resetTimer.Init(.75f);
        resetTimer.ContinuousReset = false;

        DisabledImage = Resources.Load <Sprite>(spriteFileName + "Disabled");
        ActiveImage   = Resources.Load <Sprite>(spriteFileName);

        sRend.sprite = ActiveImage;

        //normal = sRend.material.color;
        //disabled = new Color(normal.r, normal.g, normal.b, .3f);
    }
    public void Start()
    {
        triggerParticle = Resources.Load<GameObject>("Danger");
        string spriteFileName = "";
        if (affiliation == Element.Fire)
        {
            spriteFileName = "RedBox";
            //sRend.material.color = new Color(8f, .25f, .0f);
        }
        if (affiliation == Element.Water)
        {
            spriteFileName = "BlueBox";
            //sRend.material.color = new Color(.3f, .3f, .8f);
        }
        if (affiliation == Element.Earth)
        {
            spriteFileName = "BrownBox";
            //sRend.material.color = new Color(.6f, .6f, .2f);
        }
        if (affiliation == Element.Air)
        {
            spriteFileName = "GreenBox";
            //sRend.material.color = new Color(.2f, .7f, .5f);
        }

        resetTimer = ScriptableObject.CreateInstance<AdvancedTimer>();
        resetTimer.Init(.75f);
        resetTimer.ContinuousReset = false;

        DisabledImage = Resources.Load<Sprite>(spriteFileName + "Disabled");
        ActiveImage = Resources.Load<Sprite>(spriteFileName);

        sRend.sprite = ActiveImage;

        //normal = sRend.material.color;
        //disabled = new Color(normal.r, normal.g, normal.b, .3f);
    }
Exemple #7
0
 static void TestFunc0(AdvancedTimer whichTimer)
 {
     Console.WriteLine("TESTFUNC0");
 }
    void Start()
    {
        timer = ScriptableObject.CreateInstance<AdvancedTimer>();
        timer.Init(1.5f, -1, true, 0, 1.5f, false, false, false);

        score = new float[numTrials];
        reactionTime = new float[numTrials];
        forceBlink = new bool[numTrials];

        #region Randomly Assign Forced Blinks
        for (int i = 0; i < (int) numTrials / 2; i++)
        {
            int randIndex = Random.Range(0, numTrials);

            while (true)
            {
                if (!forceBlink[randIndex])
                {
                    forceBlink[randIndex] = true;
                    break;
                }
                else
                {
                    randIndex = Random.Range(0, numTrials);
                }
            }
        }
        #endregion

        Instructions.gameObject.SetActive(true);
        PromptInput.gameObject.SetActive(false);
    }