private void Awake() { player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); Pr_vec = new float[] { .0061f, .0068f, .0074f, .0081f, .0089f, .0097f, .0105f, .0114f, 0.0124f, .0133f, .0143f, .0154f, .0165f, .0176f, .0188f, .020f, .0212f, .0224f, .0237f, .0249f, .0261f, .0274f, .0286f, .0298f, .031f, .0321f, .0332f, .0343f, .0353f, .0362f, .0371f, .0379f, .0386f, .0392f, .0398f, .0402f, .0406f, .0409f, .0410f, .0411f }; P_corrector_vec = new float[] { .0217f, .0219f, .0222f, .0224f, .0226f, .0228f, .0230f, .0232f, .0234f, .0236f, .0238f, .0240f, .0242f, .0244f, .0246f, .0247f, .0249f, .0251f, .0252f, .0253f, .255f, .0256f, .0257f, .0259f, .0260f, .0261f, .0262f, .0263f, .0263f, .0264f, .0265f, .0266f, .0266f, .0267f, .0267f, .0267f, .0268f, .0268f, .0268f, .0268f }; trialHistory = new ArrayList(); for (int i = 0; i < 40; i++) { trialHistory.Add(.5f); } ; sp.numTrialsTotal = numBaselineTrials + numTrainingTrials + numTestTrials; }
// Use this for initialization void Start() { GameObject player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); texture = new Texture2D(1, 1); renderers = GetComponentsInChildren <Renderer>(); foreach (var r in renderers) { // Do something with the renderer here... r.material.mainTexture = texture; // like disable it for example. } // jitter = .2f * (UnityEngine.Random.value - .5f); if (!sp.BlockWalls) { float tmp_morph = pc.towerJitter + sp.morph; color = Color.Lerp(Color.green, Color.blue, tmp_morph); } else { color = Color.Lerp(Color.green, Color.blue, .5f); } texture.SetPixel(1, 1, color); texture.filterMode = FilterMode.Point; texture.Apply(); }
public void Awake() { // for saving data GameObject player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); }
// Use this for initialization void Start() { player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); reward = GameObject.Find("Reward"); }
void Start() { // for saving data GameObject player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); notes = player.GetComponent <Notes>(); Debug.Log(sp.numTraversals); }
void Awake() { player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); //to = player.GetComponent<DebiasingAlg_TwoTower>(); to = player.GetComponent <TrialOrdering_TwoTower>(); baseline_half = (int)to.numBaselineTrials / 2; baseline_quart = (int)Mathf.Min(to.numBaselineTrials / 4, 10f); }
public void Awake() { // set speed speedBool = 0; // connect to playerController script GameObject player = GameObject.Find("Player"); pc = player.GetComponent <PC_TwoTower>(); sp = player.GetComponent <SP_TwoTower>(); }
// Use this for initialization void Start() { player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); //blackCam = GameObject.Find("Black Camera"); rr = player.GetComponent <RR_TwoTower>(); // to = player.GetComponent<DebiasingAlg_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); reward0 = GameObject.Find("Reward0"); reward1 = GameObject.Find("Reward1"); timeout0 = GameObject.Find("Timeout0"); timeout1 = GameObject.Find("Timeout1"); }
// Use this for initialization void Start() { player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); cameras = GetComponentsInChildren <Camera>(); foreach (var cam in cameras) { cam.clearFlags = CameraClearFlags.SolidColor; } }
// public float jitter; // Use this for initialization void Start() { player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); //blackCam = GameObject.Find("Black Camera"); rr = player.GetComponent <RR_TwoTower>(); // trialOrder = player.GetComponent<TrialOrdering_Test>(); eWall = GameObject.Find("East Wall"); eastRenderer = eWall.GetComponent <Renderer>(); wWall = GameObject.Find("West Wall"); westRenderer = wWall.GetComponent <Renderer>(); morph = sp.morph; }
private void Awake() { player = GameObject.Find("Player"); sp = player.GetComponent <SP_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); }
public void Awake() { player = GameObject.Find("Player"); sceneName = SceneManager.GetActiveScene().name; if (sceneName == "TwoTower_4Way") { dbtt_4way = player.GetComponent <DebiasingAlg_TwoTower_4Way>(); } else if (sceneName == "FreqMorph_Decision") { dbfm = player.GetComponent <DebiasingAlg_FreqMorph>(); } else { if (player.GetComponent <TrialOrdering_TwoTower>() != null) { tott = player.GetComponent <TrialOrdering_TwoTower>(); orderBool = false; } else { dbtt = player.GetComponent <DebiasingAlg_TwoTower>(); orderBool = true; } } rr = player.GetComponent <RR_TwoTower>(); dl = player.GetComponent <DL_TwoTower>(); pc = player.GetComponent <PC_TwoTower>(); ttls = player.GetComponent <SbxTTLs_TwoTower>(); notes = player.GetComponent <Notes>(); mouse = notes.mouse; today = DateTime.Today; Debug.Log(today.ToString("dd_MM_yyyy")); localDirectory = localDirectory_pre + mouse + '/' + today.ToString("dd_MM_yyy") + '/'; serverDirectory = serverDirectory_pre + mouse + '/' + today.ToString("dd_MM_yyy") + '/'; if (!Directory.Exists(localDirectory)) { Directory.CreateDirectory(localDirectory); } if (!Directory.Exists(serverDirectory)) { Directory.CreateDirectory(serverDirectory); } bool nameFlag = true; while (nameFlag) { localPrefix = localDirectory + "/" + sceneName + "_" + session.ToString(); serverPrefix = serverDirectory + "/" + sceneName + "_" + session.ToString(); if (File.Exists(localPrefix + ".sqlite")) { session++; } else { nameFlag = false; SqliteConnection.CreateFile(localPrefix + ".sqlite"); } } string connectionString = "Data Source=" + localPrefix + ".sqlite;Version=3;"; _connection = (IDbConnection) new SqliteConnection(connectionString); _connection.Open(); _command = _connection.CreateCommand(); _command.CommandText = "create table data (time REAL, morph REAL, trialnum INT, pos REAL, dz REAL, lick INT, reward INT," + "tstart INT, teleport INT, rzone INT, toutzone INT, clickOn NUMERIC, blockWalls NUMERIC, towerJitter REAL," + " wallJitter REAL, bckgndJitter REAL, scanning NUMERIC, manrewards INT, cmd INT)"; _command.ExecuteNonQuery(); // make table for session information // trial type numbers _command.CommandText = "create table trialInfo (baseline INT, training INT, test INT)"; _command.ExecuteNonQuery(); // if (sceneName == "TwoTower_4Way") //{ // _command.CommandText = "insert into trialInfo (baseline, training, test) values (" + dbtt_4way.numBaselineTrials + ", " + dbtt_4way.numTrainingTrials + ", " + dbtt_4way.numTestTrials + ")"; //} //else if (sceneName == "FreqMorph_Decision") // { // _command.CommandText = "insert into trialInfo (baseline, training, test) values ( 0 , " + dbfm.numTrainingTrials + ", " + db.numTestTrials + ")"; //} else //{ // if (orderBool) // { // _command.CommandText = "insert into trialInfo (baseline, training, test) values (" + dbtt.numBaselineTrials + ", " + dbtt.numTrainingTrials + ", " + dbtt.numTestTrials + ")"; // } //else //{ // _command.CommandText = "insert into trialInfo (baseline, training, test) values (" + tott.numBaselineTrials + ", " + tott.numTrainingTrials + ", " + tott.numTestTrials + ")"; // } // } //_command.ExecuteNonQuery(); }