コード例 #1
0
ファイル: EventChain.cs プロジェクト: adrupen/radar
    // Use this for initialization
    void Start()
    {
        objectSpawner = GetComponent <SpawnObjects> ();

        ContinueUI   = GameObject.FindWithTag("ContinueUI").gameObject;
        FirstRow     = ContinueUI.transform.GetChild(0).GetComponent <Text>();
        SecondRow    = ContinueUI.transform.GetChild(1).GetComponent <Text>();
        inputButtons = GameObject.FindWithTag("InputButtons").GetComponentsInChildren <Image> ();

        radars             = new int[] { 1, 2, 3 };
        tutorialRadarOrder = new int[] { 1, 1, 1, 2, 3 };

        // Shuffle radar order
        radars = randomizeRadarOrder(radars);

        currentRadar = tutorialRadarOrder[0];

        GameObject radarRootObject = GameObject.Find("Radars");

        RadarObjects = new Dictionary <int, GameObject>();
        RadarObjects.Add(1, radarRootObject.transform.GetChild(0).gameObject);
        RadarObjects.Add(2, radarRootObject.transform.GetChild(1).gameObject);
        RadarObjects.Add(3, radarRootObject.transform.GetChild(2).gameObject);

        RadarObjects[currentRadar].SetActive(true);
        objectSpawner.setLabelCamera(RadarObjects[currentRadar].GetComponentInChildren <Camera>());

        tutorials          = new List <List <Marker> >();
        scenarios          = new List <List <Marker> >();
        original_scenarios = new List <List <Marker> >();

        tutorials.Add(tutorial1Markers);
        tutorials.Add(tutorial2Markers);
        tutorials.Add(tutorial3Markers);
        tutorials.Add(tutorial4Markers);
        tutorials.Add(tutorial5Markers);

        original_scenarios.Add(scenario1Markers);
        original_scenarios.Add(scenario2Markers);
        original_scenarios.Add(scenario3Markers);
        original_scenarios.Add(scenario4Markers);
        original_scenarios.Add(scenario5Markers);
        original_scenarios.Add(scenario6Markers);
        original_scenarios.Add(scenario7Markers);
        original_scenarios.Add(scenario8Markers);
        original_scenarios.Add(scenario9Markers);
        original_scenarios.Add(scenario10Markers);

        scenarios = randomizeScenarioOrder(original_scenarios);

        csvFileName = Application.dataPath + "/participantData.csv";
        playerId    = generateID();
        Debug.Log("Player Id is: " + playerId);
    }
コード例 #2
0
ファイル: EventChain.cs プロジェクト: adrupen/radar
 void switchRadar(bool tutorial = false)
 {
     RadarObjects[currentRadar].SetActive(false);
     if (!tutorial)
     {
         currentRadar = radars[radarCounter];
         scenarios    = randomizeScenarioOrder(original_scenarios);
     }
     else
     {
         currentRadar = tutorialRadarOrder[tutorialCounter];
     }
     RadarObjects[currentRadar].SetActive(true);
     objectSpawner.setLabelCamera(RadarObjects[currentRadar].transform.GetComponentInChildren <Camera>());
     if (currentRadar == 3)
     {
         objectSpawner.setIs2d(true);
     }
     else
     {
         objectSpawner.setIs2d(false);
     }
 }