private void Start() { _agentScripts = transform.GetComponentsInChildren <AnimationInfo>(); _dropDownRectAgents = new DropDownRect(new Rect(115, 20, 90, 300)); _dropDownRectAnimNames = new DropDownRect(new Rect(210, 20, 90, 300)); _dropDownRectNationality = new DropDownRect(new Rect(115, 60, 90, 300)); _dropDownRectProfession = new DropDownRect(new Rect(210, 60, 90, 300)); for (int i = 0; i < 32; i++) { _driveParams[i] = new DriveParams(); } #if !WEBMODE for (int i = 0; i < 32; i++) { _driveParams[i].ReadValuesDrives(i); } #elif WEBMODE for (int i = 0; i < 32; i++) { this.StartCoroutine(_driveParams[i].GetValuesDrives(i, "funda")); } #endif _firstRun = true; _agentSelInd = 0; _persMapper = new PersonalityMapper(); foreach (AnimationInfo t in _agentScripts) { Reset(t); } AgentText = new GUIText[_agentScripts.Length]; // FormatData("motionEffortCoefs.txt"); MathDefs.SetSeed(30); }
private void Start() { _agentScripts = transform.GetComponentsInChildren <AnimationInfo>(); _dropDownRectAgents = new DropDownRect(new Rect(115, 20, 90, 300)); for (int i = 0; i < 32; i++) { _driveParams[i] = new DriveParams(); } for (int i = 0; i < 32; i++) { _driveParams[i].ReadValuesDrives(i); } _firstRun = true; _agentSelInd = 0; _persMapper = new PersonalityMapper(); foreach (AnimationInfo t in _agentScripts) { Reset(t); } AgentText = new GUIText[_agentScripts.Length]; // FormatData("motionEffortCoefs.txt"); MathDefs.SetSeed(30); }
void Start() { //FUNDA // UserInfo.Hit = 0; for (int i = 0; i < _agentsLeft.Length; i++) { _agentsLeft[i] = GameObject.Find("AgentPrefabLeft" + i).GetComponent <AnimationInfo>(); _agentsRight[i] = GameObject.Find("AgentPrefabRight" + i).GetComponent <AnimationInfo>(); //Make all invisible so that users can't see the models _agentsLeft[i].gameObject.SetActive(false); _agentsRight[i].gameObject.SetActive(false); } //TODO: Hits start from 0!! _agentsLeft[(UserInfo.Hit / 3)].gameObject.SetActive(true); _agentsRight[(UserInfo.Hit / 3)].gameObject.SetActive(true); for (int i = 0; i < 32; i++) { _driveParams[i] = new DriveParams(); } _qCnt = 10; #if DEBUGMODE UserInfo.Hit = 0; UserInfo.IsMale = true; UserInfo.IsNative = true; UserInfo.Age = 20; UserInfo.UserId = "fd"; #endif //_taskQInd = 9; _taskQInd = 0; //initial question's index _isSubmittedStr = new string[_qCnt]; _isSubmitted = new bool[_qCnt]; _alreadyPlayed = new bool[_qCnt]; for (int i = 0; i < _isSubmittedStr.Length; i++) { _isSubmittedStr[i] = "";//"Answer NOT submitted"; } for (int i = 0; i < _alreadyPlayed.Length; i++) { _alreadyPlayed[i] = false; } UpdateCameraBoundaries(); // _drivesAchieved = false; //Read all drive and shape parameters #if !WEBMODE for (int i = 0; i < 32; i++) { _driveParams[i].ReadValuesDrives(i); } #elif WEBMODE for (int i = 0; i < 32; i++) { this.StartCoroutine(_driveParams[i].GetValuesDrives(i, "funda")); } #endif _persMapper = new PersonalityMapper(); _firstQFirstPlay = true; _agentLeft = GameObject.Find("AgentPrefabLeft" + (UserInfo.Hit / 3)).GetComponent <AnimationInfo>(); _agentRight = GameObject.Find("AgentPrefabRight" + (UserInfo.Hit / 3)).GetComponent <AnimationInfo>(); if ((UserInfo.Hit % 3) == 2) //walking { _agentLeft.transform.position -= Vector3.forward * 10; _agentRight.transform.position -= Vector3.forward * 10; } Reset(_agentLeft); Reset(_agentRight); }
void Start() { for (int i = 0; i < 32; i++) { _driveParams[i] = new DriveParams(); } _agentLeft = GameObject.Find("AgentPrefabLeft"); _agentRight = GameObject.Find("AgentPrefabRight"); if (!_agentLeft) { Debug.Log("AgentLeft prefab not found"); return; } if (!_agentRight) { Debug.Log("AgentRight prefab not found"); return; } _personality = UserInfo.Personality; #if WEBMODE _animInd = UserInfo.AnimInd; _qCnt = UserInfo.QCnt; #elif !WEBMODE _animInd = 1; _qCnt = 48; #endif _taskQInd = 0; //initial question's index _arePositionsSwapped = new bool[_qCnt * 2]; _isSubmittedStr = new string[_qCnt + 2]; _isSubmitted = new bool[_qCnt + 2]; _alreadyPlayed = new bool[_qCnt]; //compute effortCombination hashes for (int i = 0; i < 32; i++) { int val = _effortList[i, 3] + _effortList[i, 2] * 3 + _effortList[i, 1] * 9 + _effortList[i, 0] * 27; _effortCombination.Add(val, i); } for (int i = 0; i < _isSubmittedStr.Length; i++) { _isSubmittedStr[i] = "";//"Answer NOT submitted"; } for (int i = 0; i < _alreadyPlayed.Length; i++) { _alreadyPlayed[i] = false; } UpdateCameraBoundaries(); // _drivesAchieved = false; //Read all drive and shape parameters #if !WEBMODE for (int i = 0; i < 32; i++) { _driveParams[i].ReadValuesDrives(i); } #elif WEBMODE for (int i = 0; i < 32; i++) { this.StartCoroutine(_driveParams[i].GetValuesDrives(i, "funda")); } //wait till drives are achieved /* * _drivesAchieved = true; * for (int i = 0; i < 32; i++) //make sure all the drives are achieved * _drivesAchieved = _drivesAchieved && _driveParams[i].DrivesAchieved; * */ #endif //Select if positions are swapped in the beginning for (int i = 0; i < _arePositionsSwapped.Length / 2; i++) { if (MathDefs.GetRandomNumber(2) == 1) { //50% chance _arePositionsSwapped[i] = true; } else { _arePositionsSwapped[i] = false; } } Reset(); _firstQFirstPlay = true; _goldQ1Ind = MathDefs.GetRandomNumber(2, 4); _goldQ2Ind = MathDefs.GetRandomNumber(4, 6); _goldQ1Asked = _goldQ2Asked = false; _quality = 0; }
void Start() { UserInfo.Hit = 5; _quality = 0; for (int i = 0; i < _agentsLeft.Length; i++) { _agentsLeft[i] = GameObject.Find("AgentPrefabLeft" + i).GetComponent <AnimationInfo>(); _agentsRight[i] = GameObject.Find("AgentPrefabRight" + i).GetComponent <AnimationInfo>(); //Make all invisible so that users can't see the models _agentsLeft[i].gameObject.SetActive(false); _agentsRight[i].gameObject.SetActive(false); } //TODO: Hits start from 0!! _agentsLeft[(UserInfo.Hit / 3)].gameObject.SetActive(true); _agentsRight[(UserInfo.Hit / 3)].gameObject.SetActive(true); for (int i = 0; i < 32; i++) { _driveParams[i] = new DriveParams(); } _qCnt = 5; #if DEBUGMODE UserInfo.Hit = 0; #endif _taskQInd = 4; //_taskQInd = 0; //initial question's index _arePositionsSwapped = new bool[_qCnt]; _isSubmittedStr = new string[_qCnt]; _isSubmitted = new bool[_qCnt]; _alreadyPlayed = new bool[_qCnt]; for (int i = 0; i < _isSubmittedStr.Length; i++) { _isSubmittedStr[i] = "";//"Answer NOT submitted"; } for (int i = 0; i < _alreadyPlayed.Length; i++) { _alreadyPlayed[i] = false; } UpdateCameraBoundaries(); // _drivesAchieved = false; //Read all drive and shape parameters #if !WEBMODE for (int i = 0; i < 32; i++) { _driveParams[i].ReadValuesDrives(i); } #elif WEBMODE for (int i = 0; i < 32; i++) { this.StartCoroutine(_driveParams[i].GetValuesDrives(i, "funda")); } #endif //Select if positions are swapped in the beginning for (int i = 0; i < _arePositionsSwapped.Length / 2; i++) { if (MathDefs.GetRandomNumber(2) == 1) { //50% chance _arePositionsSwapped[i] = true; } else { _arePositionsSwapped[i] = false; } } _persMapper = new PersonalityMapper(); _firstQFirstPlay = true; _agentLeft = GameObject.Find("AgentPrefabLeft" + (UserInfo.Hit / 3)).GetComponent <AnimationInfo>(); _agentRight = GameObject.Find("AgentPrefabRight" + (UserInfo.Hit / 3)).GetComponent <AnimationInfo>(); // _agentLeft = new Agent("AgentPrefabLeft" + (UserInfo.Hit/3)); // _agentRight = new Agent("AgentPrefabRight" + (UserInfo.Hit / 3)); if ((UserInfo.Hit % 3) == 2) //walking { _agentLeft.transform.position -= Vector3.forward * 4; _agentRight.transform.position -= Vector3.forward * 4; } Reset(_agentLeft); Reset(_agentRight); }