// Start is called before the first frame update
    void Start()
    {
        FileWriter.CreateResultsFile(filepath);

        enhancementScriptWolski = GetComponent <ContrastEnhancementWolski>() as ContrastEnhancementWolski;
        enhancementScriptWanat  = GetComponent <ContrastEnhancementWanat>() as ContrastEnhancementWanat;
        monoRendering           = GetComponent <MonoRendering>() as MonoRendering;
        uglyImage = GetComponent <UglyImage>() as UglyImage;

        CreateTrialGenerators();
        ResetInstructions();
        instructions[0].active = true;

        playerObject.transform.position = StartLocation.transform.position;
        playerObject.transform.rotation = StartLocation.transform.rotation;

        player = Valve.VR.InteractionSystem.Player.instance;

        Debug.Log(Animator.StringToHash(SystemInfo.deviceName));
        //observerId = Animator.StringToHash(SystemInfo.deviceName).ToString();

        nTrials = repetitions * locations.Count;
        //SetNextLocation(false);

        ChangeModeHint();
    }
Esempio n. 2
0
    void SetupSteamVR2Controllers()
    {
        if (steamVRPlayArea == null)
        {
            steamVRPlayArea = FindObjectOfType <SteamVR_PlayArea>();
        }

        if (steamVRPlayArea != null)
        {
            foreach (SteamVR_Behaviour_Pose poseComp in steamVRPlayArea.GetComponentsInChildren <SteamVR_Behaviour_Pose>(true))
            {
                if (poseComp.inputSource == SteamVR_Input_Sources.RightHand)
                {
                    m_rightController = poseComp.gameObject;
                }
                else if (poseComp.inputSource == SteamVR_Input_Sources.LeftHand)
                {
                    m_leftController = poseComp.gameObject;
                }
            }
        }
        else
        {
            Valve.VR.InteractionSystem.Player PlayerComponent = FindObjectOfType <Valve.VR.InteractionSystem.Player>();

            m_rightController = PlayerComponent.rightHand.gameObject;
            m_leftController  = PlayerComponent.leftHand.gameObject;
        }

        if (m_steamVRClickAction == null)
        {
            Debug.LogError("CURVEDUI: No SteamVR action to use for button interactions. Choose the action you want to use to click the buttons on CurvedUISettings component.");
        }
    }
Esempio n. 3
0
    void SetupSteamVR2Controllers()
    {
        if (steamVRPlayArea == null)
        {
            steamVRPlayArea = FindObjectOfType <SteamVR_PlayArea>();
        }

        if (steamVRPlayArea != null)
        {
            foreach (SteamVR_Behaviour_Pose poseComp in steamVRPlayArea.GetComponentsInChildren <SteamVR_Behaviour_Pose>(true))
            {
                if (poseComp.inputSource == SteamVR_Input_Sources.RightHand)
                {
                    m_rightController = poseComp.gameObject;
                }
                else if (poseComp.inputSource == SteamVR_Input_Sources.LeftHand)
                {
                    m_leftController = poseComp.gameObject;
                }
            }
        }
        else
        {
#if CURVEDUI_STEAMVR_INT
            //Optional - SteamVR Interaction System
            Valve.VR.InteractionSystem.Player PlayerComponent = FindObjectOfType <Valve.VR.InteractionSystem.Player>();

            if (PlayerComponent != null)
            {
                m_rightController = PlayerComponent.rightHand.gameObject;
                m_leftController  = PlayerComponent.leftHand.gameObject;
            }
            else
#endif
            Debug.LogError("CURVEDUI: Can't find SteamVR_PlayArea component or InteractionSystem.Player component on the scene. One of these is required. Add a reference to it manually to CurvedUIInputModule on EventSystem gameobject.", this.gameObject);
        }

        if (m_steamVRClickAction == null)
        {
            Debug.LogError("CURVEDUI: No SteamVR action to use for button interactions. Choose the action you want to use to click the buttons on CurvedUISettings component.");
        }
    }
Esempio n. 4
0
 void Start()
 {
     player = FindObjectOfType <Valve.VR.InteractionSystem.Player>();
 }
Esempio n. 5
0
 private void Start()
 {
     _book      = Book.Instance;
     _player    = Valve.VR.InteractionSystem.Player.instance;
     _playerOwn = GetComponent <Player>();
 }
Esempio n. 6
0
 public override void Init()
 {
     _player = Valve.VR.InteractionSystem.Player.instance;
 }
Esempio n. 7
0
    /// <summary>
    /// Starts this instance.
    /// Sets all abilities and their UI elements as well as all character base variables such as current portal and health.
    /// </summary>
    void Start()
    {
        scoreText = null;
        Skill1    = new Ability(60, "Tornado", 1000, 2); //0 in list
        Skill2    = new Ability(30, "Placeholder2", 1000, 3);
        Skill3    = new Ability(30, "Placeholder3", 1000, 3);
        abilities = new List <Ability>();
        abilities.Add(Skill1);
        abilities.Add(Skill2);
        abilities.Add(Skill3);

        //Red School
        RedSkill1 = new Ability(0, "RedBeam", 1000, 2);
        RedSkill2 = new Ability(25, "PlaceholderRed2", 1000, 100);
        RedSkill3 = new Ability(10, "PlaceholderRed3", 1000, 2);

        //Purple
        PurpleSkill1 = new Ability(0, "PurpleBeam", 1000, 2);
        PurpleSkill2 = new Ability(25, "PlaceholderPurple2", 1000, 100);
        PurpleSkill3 = new Ability(10, "PlaceholderPurple3", 1000, 2);

        //Blue
        BlueSkill1 = new Ability(0, "BlueBeam", 1000, 2);
        BlueSkill2 = new Ability(25, "PlaceholderBlue2", 1000, 100);
        BlueSkill3 = new Ability(10, "PlaceholderBlue3", 1000, 2);

        abilities.Add(RedSkill1);
        abilities.Add(RedSkill2);
        abilities.Add(RedSkill3);

        abilities.Add(BlueSkill1);
        abilities.Add(BlueSkill2);
        abilities.Add(BlueSkill3);

        abilities.Add(PurpleSkill1);
        abilities.Add(PurpleSkill2);
        abilities.Add(PurpleSkill3);

        score = 0;

        maxshieldPower = 100;
        shieldPower    = maxshieldPower;

        shieldText.text = (((float)shieldPower / (float)maxshieldPower) * 100.00).ToString() + " %";
        StartCoroutine(PowerShield());
        maxHealth     = 100;
        currentHealth = maxHealth;

        vrPlayer   = this.GetComponent <Valve.VR.InteractionSystem.Player>();
        playerView = this.GetComponentInChildren <PlayerView>();

        transform.position = startPortal.spawnPos.position;
        currentPortal      = startPortal;
        lastPortal         = startPortal;

        startPortal.gameObject.SetActive(false);
        fade = GetComponentInChildren <Valve.VR.SteamVR_Fade>();


        //scoreText.text = score.ToString();
        StartCoroutine(ScoreTally());
        StartCoroutine(Cooldowns());
    }