private void CameraMove() { float MoveX = InputManagerScript.GetAxisX(); float MoveY = InputManagerScript.GetAxisY(); m_scriptGameUICameraMng.CameraLocalMove(-(MoveX * MoveSpeed), -(MoveY * MoveSpeed), 0.0f); }
public virtual void Start() { tokenTypes = (Object[])Resources.LoadAll("_Core/Tokens/"); gridArray = new GameObject[gridWidth, gridHeight]; MakeGrid(); matchManager = GetComponent <MatchManagerScript>(); inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); }
//can be overridden public virtual void Start() { tokenTypes = (Object[])Resources.LoadAll("_Core/Tokens/"); //grabbing prefabs gridArray = new GameObject[gridWidth, gridHeight]; //creating the grid MakeGrid(); //populating the grid matchManager = GetComponent <MatchManagerScript>(); //assigning scripts to variables inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); }
public virtual void Start() { //load the tokens, make the grid, and create references to the other scripts tokenTypes = (Object[])Resources.LoadAll("Tokens/"); gridArray = new GameObject[gridWidth, gridHeight]; MakeGrid(); matchManager = GetComponent <MatchManagerScript>(); inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); }
public virtual void Start() { tokenTypes = Resources.LoadAll("Tokens/"); gridArray = new GameObject[gridWidth, gridHeight]; MakeGrid(); matchManager = GetComponent <MatchManagerScript>(); Debug.Assert(matchManager != null, "Attach a match manager to this object."); inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); }
public override void Update() { if (m_scriptKittyTotalManager != null) { m_scriptKittyTotalManager.Update(); } if (!IsUpdate()) { return; } if (Main.game.GetIsGameEnd()) { return; } base.Update(); // CameraSlowMove(); if (IsMove()) { CameraMove(); } else if (IsZoom()) { #if UNITY_EDITOR // Zoom if (InputManagerScript.GetMouseWheelDown()) { InputManagerScript.SmothZoomInOut(Main.inst.GetGameUICameraManager(), (int)ZOOM_STATE._OUT, 200.0f); } else if (InputManagerScript.GetMouseWheelUp()) { InputManagerScript.SmothZoomInOut(Main.inst.GetGameUICameraManager(), (int)ZOOM_STATE._IN, 200.0f); } #elif UNITY_IPHONE || UNITY_ANDROID InputManagerScript.SmothZoomInOut(Main.inst.GetGameUICameraManager(), 200.0f); InputManagerScript.ResetAxis(); #else // Zoom if (InputManagerScript.GetMouseWheelDown()) { InputManagerScript.SmothZoomInOut(Main.inst.GetGameUICameraManager(), (int)ZOOM_STATE._OUT, 200.0f); } else if (InputManagerScript.GetMouseWheelUp()) { InputManagerScript.SmothZoomInOut(Main.inst.GetGameUICameraManager(), (int)ZOOM_STATE._IN, 200.0f); } #endif } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } keysPressed = new List <KeyClass>(); allCommands = new List <KeyClass>(); assigned = false; }
void Awake() { ballColors = MyTools.GetRainbowColor(); Toplid = GameObject.Find("TopLid").GetComponent <TopLidScript> (); BottomLid = GameObject.Find("BottomLid").GetComponent <OpenBottomScript> (); statManager = GetComponent <StatsManagerScript> (); Admanager = GetComponent <ManagerAdScript> (); inputmanager = GetComponent <InputManagerScript> (); loadsave = GetComponent <LoadSaveScript> (); setNewGameState(GameState.MainMenu); // for Debug only //setNewGameState (GameState.ConfigPlayer); }
private void Init() { Application.runInBackground = true; Resources.UnloadUnusedAssets(); System.GC.Collect(); SetROOTObjects(); SetResourceObjectROOTChildren(); TextParserScript = new TextParser(); if (!gameObject.GetComponent <DefineBaseManager>()) { gameObject.AddComponent <DefineBaseManager>(); } InitGameCamera(); InitEzGuiCamera(); FullHDScreenSize.x = 1920; FullHDScreenSize.y = 1080; UIScreenSizeX2Max = 1600; UIScreenSizeX2Num = 1.5f; SetDefineScreen(); SetGameUICameraInspector(); SetUICameraInspector(); MainMoveXPercent = 1.5f; MainMoveYPercent = 1.5f; InitPlatform(); InitDevice(); ApplicationDataPath = Application.persistentDataPath; if (DefineBaseManager.inst.GetTouchInput()) { InputManagerScript = this.gameObject.AddComponent <MobileInputManager>(); } else { InputManagerScript = this.gameObject.AddComponent <InputManager>(); } InputManagerScript.Create(); m_LoadStep = LOAD_STEP._STEP1; }
public virtual void Awake() { tokenTypes = (UnityEngine.Object[])Resources.LoadAll("Tokens/"); noteSprites = Resources.LoadAll <Sprite>("Sprites/Note sprites"); gridArray = new GameObject[gridWidth, gridHeight]; matchManager = GetComponent <MatchManagerScript>(); inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); numberManager = GetComponent <NumberManager>(); stringGraphic = Resources.Load("String") as GameObject; timeBetweenBeats = 60.0f / bpm; music = GameObject.Find(SPEAKER_OBJ).GetComponent <AudioSource>(); healthText = transform.root.Find(UI_CANVAS).Find(HEALTH_TEXT).GetComponent <Text>(); MakeGrid(); ChangeGridDuplicates(); }
//AudioManager aScript; // Use this for initialization void Start() { int x = 20; int y = 40; GameObject turnMan = Instantiate(tmanager); GameObject mapCreator = Instantiate(mcreator); GameObject unitCreator = Instantiate(ucreator); GameObject inputMan = Instantiate(imanager); //GameObject audioMan = Instantiate (amanager); tScript = turnMan.GetComponent <TurnManagerScript> (); mScript = mapCreator.GetComponent <MapCreation> (); uScript = unitCreator.GetComponent <UnitCreator> (); iScript = inputMan.GetComponent <InputManagerScript> (); uScript.mapSize = new Vector2(20, 40); int[,] map = new int [x, y]; for (int i = 0; i < x; ++i) { for (int j = 0; j < y; ++j) { if (i == 0 || i == x - 1 || j == 0 || j == y - 1) { map [i, j] = 0; } else { map [i, j] = Random.Range(1, 4); } } } //just to test map [10, 10] = -1; map [10, 20] = -1; mScript.setMatrix(map, x, y, new Vector3(45, -45, 0), 0.8f, Color.white); uScript.tutorialUnits(); turnMan.GetComponent <TurnManagerScript> ().unitMap = uScript.getUnitMap(); turnMan.GetComponent <TurnManagerScript> ().unitList = uScript.getUnitLists(); tScript.mapSize = new Vector2(20, 40); tScript.terrain = map; inputMan.GetComponent <InputManagerScript> ().setTurnMan(tScript); inputMan.GetComponent <InputManagerScript> ().setMapCreat(mScript); }
private void ReleaseScript() { if (InputManagerScript) { InputManagerScript.Release(); } if (DataManagerScript != null) { DataManagerScript.Release(); } if (StageManagerScript != null) { StageManagerScript.Release(); } if (HudManagerScript != null) { HudManagerScript.Release(); } }
public virtual void Start() { _tokenTypes = Resources.LoadAll("ChessPieces/"); gridArray = new GameObject[gridWidth, gridHeight]; MakeGrid(); if (playerColor == ChessPiece.PieceColor.Black) { opponentColor = ChessPiece.PieceColor.White; } else { opponentColor = ChessPiece.PieceColor.Black; } matchManager = GetComponent <MatchManagerScript>(); inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); opponentController = GetComponent <OpponentController>(); }
public override void OnStartClient() { base.OnStartClient(); //calls the base class that has been overwritten by this //when player 2+ joins, the player 1 object he loads might already have a character selected - this loads that character on that object if (charNumber != -1) { SetChar(charNumber); } //healthbar above the character sprite hp = gameObject.GetComponentInChildren <HealthBarScript>(); //anything which should only be triggered by the player who owns this player object will go under this if (!base.hasAuthority) { return; } inputManager = gameObject.GetComponent <InputManagerScript>(); }
public virtual void Start() { //load the tokens, make the grid, and create references to the other scripts tokenTypes = (UnityEngine.Object[])Resources.LoadAll("Tokens/"); dummySprites = Resources.LoadAll <Sprite>("Sprites/Dummy sprites"); gridArray = new GameObject[gridWidth, gridHeight]; matchManager = GetComponent <MatchManagerScript>(); inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); scoreManager = transform.root.Find("Score canvas").Find("Score").GetComponent <ScoreManager>(); stringGraphic = Resources.Load("String") as GameObject; MakeGrid(); ChangeGridDuplicates(); SceneManager.LoadScene(INSTRUCTION_SCENE_NAME, LoadSceneMode.Additive); winLoseManager = GetComponent <WinLoseManager>(); chordsRemaining = transform.root.Find(SCORE_CANVAS).Find(CHORDS_REMAINING).GetComponent <Text>(); ChordsPlayed = 0; //set the text correctly at the start of the game scoreRequired = transform.root.Find(SCORE_CANVAS).Find(SCORE_REQUIRED).GetComponent <Text>(); scoreRequired.text = winLoseManager.ScoreToWin + " to win"; }
private void Awake() { Dictionary <string, object>[] array = EditorManagerScript.DeserializeJson("Students.json"); this.students = new StudentEditorScript.StudentData[array.Length]; for (int i = 0; i < this.students.Length; i++) { this.students[i] = StudentEditorScript.StudentData.Deserialize(array[i]); } Array.Sort <StudentEditorScript.StudentData>(this.students, (StudentEditorScript.StudentData a, StudentEditorScript.StudentData b) => a.id - b.id); for (int j = 0; j < this.students.Length; j++) { StudentEditorScript.StudentData studentData = this.students[j]; UILabel uilabel = UnityEngine.Object.Instantiate <UILabel>(this.studentLabelTemplate, this.listLabelsOrigin); uilabel.text = "(" + studentData.id.ToString() + ") " + studentData.name; Transform transform = uilabel.transform; transform.localPosition = new Vector3(transform.localPosition.x + (float)(uilabel.width / 2), transform.localPosition.y - (float)(j * uilabel.height), transform.localPosition.z); uilabel.gameObject.SetActive(true); } this.studentIndex = 0; this.bodyLabel.text = StudentEditorScript.GetStudentText(this.students[this.studentIndex]); this.inputManager = UnityEngine.Object.FindObjectOfType <InputManagerScript>(); }
void Awake() { if (inputManager == null) { inputManager = FindObjectOfType <InputManagerScript>(); } menuBtns = new List <Button>(menuList.childCount); for (int i = 0; i < (menuList.childCount); i++) { menuBtns.Add(menuList.GetChild(i).GetComponent <Button>()); } currentBtn = menuBtns[0]; //currentBtn.Select(); ColorBlock cb = currentBtn.colors; cb.normalColor = cb.highlightedColor; currentBtn.colors = cb; //currentBtn.colors.highlightedColor = SelectedColor; //Debug.Log(currentBtn.name + " , " + currentBtn.colors.highlightedColor); }
private void Awake() { this.inputManager = UnityEngine.Object.FindObjectOfType <InputManagerScript>(); }
void Start() { uiCam = GameObject.FindGameObjectWithTag("UICam").GetComponent <Camera>(); //Grab the object that contains the timer inputManagerScript = GameObject.FindGameObjectWithTag("Input").GetComponent <InputManagerScript>(); //Grab the object that contains the input manager }
//ADDED this public void Awake() { instance = this; }
// Use this for initialization void Start() { transition = GameObject.FindGameObjectWithTag("Transition").GetComponent<TransitionScript>(); eventManager = GameObject.FindGameObjectWithTag("EventManager").GetComponent<EventManagerScript>(); input = GameObject.Find ("EventManager").GetComponent<InputManagerScript>(); inventory = GameObject.Find ("EventManager").GetComponent<InventoryScript>(); currentPosition = start.GetComponent<ItemPositionScript>(); positions = new ItemPositionScript[transform.childCount]; for(int i = 0; i < transform.childCount; i++){ positions[i] = transform.GetChild (i).GetComponent<ItemPositionScript>(); } }
void Start() { _inputManager = GetComponent <InputManagerScript>(); _moveTokens = GetComponent <MoveTokensScript>(); }
// string classSpeed = Page110ManagerScript.classSpeed; // Start is called before the first frame update void Start() { //左グラフ各カラムにセットしたい値を格納する変数 leftColumn1Value = 30.0f; leftColumn2Value = 40.0f; leftColumn3Value = 50.0f; leftColumn4Value = 60.0f; leftColumn5Value = 70.0f; leftColumn6Value = 60.0f; leftColumn7Value = 50.0f; leftColumn8Value = 40.0f; leftColumn9Value = 30.0f; leftColumn10Value = 20.0f; //右グラフ各カラムにセットしたい値を格納する変数 rightColumn1Value = 90.0f; rightColumn2Value = 80.0f; rightColumn3Value = 70.0f; rightColumn4Value = 60.0f; rightColumn5Value = 50.0f; rightColumn6Value = 40.0f; rightColumn7Value = 30.0f; rightColumn8Value = 20.0f; rightColumn9Value = 10.0f; rightColumn10Value = 5.0f; //===== 右バーチャートにおける対象のスライダーの色を変える =====// //対象となる適切なスライダーをセット GameObject targetRightColumn = rightColumn4; //スライダーの対象要素を検索し色を変えるロジック Slider targetRightslider = targetRightColumn.GetComponent <Slider>(); foreach (Transform childTransform in targetRightslider.gameObject.transform) { foreach (Transform grandChildTransform in childTransform) { if (grandChildTransform.gameObject.name == "Fill") { grandChildTransform.gameObject.GetComponent <Image>().color = Color.yellow; } } } //===== 左バーチャートにおける対象のスライダーの色を変える =====// //対象となる適切なスライダーをセット GameObject targetLeftColumn = leftColumn4; //スライダーの対象要素を検索し色を変えるロジック Slider targetLeftslider = targetLeftColumn.GetComponent <Slider>(); foreach (Transform childTransform in targetLeftslider.gameObject.transform) { foreach (Transform grandChildTransform in childTransform) { if (grandChildTransform.gameObject.name == "Fill") { grandChildTransform.gameObject.GetComponent <Image>().color = Color.yellow; } } } //=========== テキストエリア表示 ============// //入力した年齢を取得 int getInputAge = InputManagerScript.GetInputAge(); string currentAge = "(" + getInputAge.ToString() + "歳)"; Score = textScoreSpeed.GetComponent <Text>(); Age = textAgeSpeed.GetComponent <Text>(); Score.text = scoreSpeed.ToString() + "点"; Age.text = ageSpeed.ToString() + "歳"; //現在年齢を付加 Age.text = Age.text + currentAge; }
// Use this for initialization void Start() { fms = GameObject.FindGameObjectWithTag("FamilyManager").GetComponent<FamilyManagerScript>(); eventManager = GetComponent<EventManagerScript>(); input = GameObject.FindGameObjectWithTag("EventManager").GetComponent<InputManagerScript>(); audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioManagerScript>(); }
// Use this for initialization void Start() { input = GetComponent<InputManagerScript>(); }
// Use this for initialization void Start() { slides = GetComponent<SlidesScript>(); slides.starting = false; familyManager = GameObject.FindGameObjectWithTag("FamilyManager").GetComponent<FamilyManagerScript>(); itemPosManager = GameObject.FindGameObjectWithTag("ItemPositions").GetComponent<ItemPositionManagerScript>(); transition = GameObject.FindGameObjectWithTag("Transition").GetComponent<TransitionScript>(); walkHome = GameObject.FindGameObjectWithTag("WalkHome").GetComponent<SideScrollWalkScript>();; audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioManagerScript>(); baking = GetComponent<BakingScript>(); finances = GetComponent<FinancesScript>(); customerManager = GetComponent<CustomerManagerScript>(); conversationManager = GetComponent<ConversationManagerScript>(); inventory = GetComponent<InventoryScript>(); input = GetComponent<InputManagerScript>(); phase = "setup"; dailyTransactions = new Transaction[customersToday]; }
// Use this for initialization void Start() { transition = GameObject.FindGameObjectWithTag("Transition").GetComponent<TransitionScript>(); input = GetComponent<InputManagerScript>(); GameObject go; for(int i = 0; i < startingPastries.Length; i++){ go = (GameObject)Instantiate(startingPastries[i]); go.transform.position = new Vector3(999f, 999f, 999f); inventory.Add (go); } bottom = Mathf.Min (inventory.Count, 6); }
// Start is called before the first frame update void Start() { //左グラフ各カラムにセットしたい値を格納する変数 TmtaBrainAct1 = 10f; TmtaBrainAct2 = 20f; TmtaBrainAct3 = 30f; TmtaBrainAct4 = 40f; TmtaBrainAct5 = 50f; TmtaBrainAct6 = 60f; TmtaBrainAct7 = 70f; TmtaBrainAct8 = 60f; TmtaBrainAct9 = 50f; TmtaBrainAct10 = 50f; TmtaBrainAct11 = 60f; TmtaBrainAct12 = 40f; TmtaBrainAct13 = 30f; TmtaBrainAct14 = 20f; TmtaBrainAct15 = 20f; TmtaBrainAct16 = 30f; TmtaBrainAct17 = 40f; TmtaBrainAct18 = 50f; TmtaBrainAct19 = 60f; TmtaBrainAct20 = 60f; TmtaBrainAct21 = 70f; TmtaBrainAct22 = 70f; TmtaBrainAct23 = 60f; TmtbBrainAct1 = 30f; TmtbBrainAct2 = 40f; TmtbBrainAct3 = 50f; TmtbBrainAct4 = 60f; TmtbBrainAct5 = 80f; TmtbBrainAct6 = 90f; TmtbBrainAct7 = 90f; TmtbBrainAct8 = 70f; TmtbBrainAct9 = 50f; TmtbBrainAct10 = 50f; TmtbBrainAct11 = 40f; TmtbBrainAct12 = 30f; TmtbBrainAct13 = 40f; TmtbBrainAct14 = 40f; TmtbBrainAct15 = 30f; TmtbBrainAct16 = 30f; TmtbBrainAct17 = 40f; TmtbBrainAct18 = 50f; TmtbBrainAct19 = 60f; TmtbBrainAct20 = 70f; TmtbBrainAct21 = 70f; TmtbBrainAct22 = 80f; TmtbBrainAct23 = 90f; ResultSpeed = textResultSpeed.GetComponent <Text>(); ResultAttention = textResultAttention.GetComponent <Text>(); ResultBrain = textResultBrain.GetComponent <Text>(); ResultDeclines = textResultDeclines.GetComponent <Text>(); //初期化処理 //Start()の中で計算して描画関数で値を更新 ResultSpeed.text = "Calculating. . ."; ResultAttention.text = "Calculating. . ."; ResultBrain.text = "Calculating. . ."; ResultDeclines.text = "Calculating. . ."; /* * * TMT1 * * プレフィックス= TMT1_ * * */ /* * //全タッチ関連静的変数 * public static int pushDownTask1 = 0; * public static int pdtTask1 = 0; * public static DateTime[] pushDownTimeTask1 = new DateTime[500]; * public static TimeSpan totalTapTimePushDownTask1; * public static double meanTimePushDownTask1; * public static double maxTaptimePushDownTask1 = 0; * public static double minTaptimePushDownTask1 = 0; * //15秒で110回プッシュできたので45秒で330回 * //60秒までの拡張を見越して440回で500回に */ //総タッチ数 int tmt1_pushDownTask1 = S522Test1GameManagerScript.GetPushDownTask1(); //総タッチ各タッチ時刻 DateTime[] tmt1_pushDownTimeTask1 = S522Test1GameManagerScript.GetPushDownTimeTask1(); //総タッチ平均タッチ時間 double tmt1_meanTimePushDownTask1 = S522Test1GameManagerScript.GetMeanTimePushDownTask1(); //総タッチ最大(最遅)タッチ時間 double tmt1_maxTaptimePushDownTask1 = S522Test1GameManagerScript.GetMaxTaptimePushDownTask1(); //総タッチ最小(最速)タッチ時間 double tmt1_minTaptimePushDownTask1 = S522Test1GameManagerScript.GetMinTaptimePushDownTask1(); // Debug.Log("Page70GameManagerScript.tmt1__pushDownTask1" + tmt1_pushDownTask1); // Debug.Log("Page70GameManagerScript.tmt1__meanTimePushDownTask1" + tmt1_meanTimePushDownTask1); // Debug.Log("Page70GameManagerScript.tmt1__maxTaptimePushDownTask1" + tmt1_maxTaptimePushDownTask1); // Debug.Log("Page70GameManagerScript.tmt1__minTaptimePushDownTask1" + tmt1_minTaptimePushDownTask1); /* * //正答タッチ数関連静的変数 * public static int rightPushTask1 = 0; * public static int rptTask1 = 0; * public static DateTime[] rightPushTimeTask1 = new DateTime[180]; * public static TimeSpan totalTapTimeRightPushTask1; * public static double meanTimeRightPushTask1; * public static double maxTaptimeRightPushTask1 = 0; * public static double minTaptimeRightPushTask1 = 0; */ //正答タッチ数 int tmt1_rightPushTask1 = S522Test1GameManagerScript.GetRightPushTask1(); //正答タッチ各タッチ時刻 DateTime[] tmt1_rightPushTimeTask1 = S522Test1GameManagerScript.GetRightPushTimeTask1(); //正答タッチ平均タッチ時間 double tmt1_meanTimeRightPushTask1 = S522Test1GameManagerScript.GetMeanTimeRightPushTask1(); //正答タッチ最大(最遅)タッチ時間 double tmt1_maxTaptimeRightPushTask1 = S522Test1GameManagerScript.GetMaxTaptimeRightPushTask1(); //正答タッチ最小(最速)タッチ時間 double tmt1_minTaptimeRightPushTask1 = S522Test1GameManagerScript.GetMinTaptimeRightPushTask1(); /* * Debug.Log("Page70GameManagerScript.rightPushTask1" + tmt1_rightPushTask1); * Debug.Log("Page70GameManagerScript.meanTimeRightPushTask1" + tmt1_meanTimeRightPushTask1); * Debug.Log("Page70GameManagerScript.maxTaptimeRightPushTask1" + tmt1_maxTaptimeRightPushTask1); * Debug.Log("Page70GameManagerScript.minTaptimeRightPushTask1" + tmt1_minTaptimeRightPushTask1); */ /* * //誤答タッチ数関連静的変数 * public static int wrongPushTask1 = 0; * public static int wptTask1 = 0; * public static DateTime[] wrongPushTimeTask1 = new DateTime[500]; * public static TimeSpan totalTapTimeWrongPushTask1; * public static double meanTimeWrongPushTask1; * public static double maxTaptimeWrongPushTask1 = 0; * public static double minTaptimeWrongPushTask1 = 0; */ //誤答タッチ数 int tmt1_wrongPushTask1 = S522Test1GameManagerScript.GetWrongPushTask1(); //誤答タッチ各タッチ時刻 DateTime[] tmt1_wrongPushTimeTask = S522Test1GameManagerScript.GetWrongPushTimeTask1(); //誤答タッチ平均タッチ時間 double tmt1_meanTimeWrongPushTask1 = S522Test1GameManagerScript.GetMeanTimeWrongPushTask1(); //誤答タッチ最大(最遅)時間 double tmt1_maxTaptimeWrongPushTask1 = S522Test1GameManagerScript.GetMaxTaptimeWrongPushTask1(); //誤答タッチ最小(最速)時間 double tmt1_minTaptimeWrongPushTask1 = S522Test1GameManagerScript.GetMinTaptimeWrongPushTask1(); /* * Debug.Log("Page70GameManagerScript.wrongPushTask1" + tmt1_wrongPushTask1); * Debug.Log("Page70GameManagerScript.meanTimeWrongPushTask1" + tmt1_meanTimeWrongPushTask1); * Debug.Log("Page70GameManagerScript.maxTaptimeWrongPushTask1" + tmt1_maxTaptimeWrongPushTask1); * Debug.Log("Page70GameManagerScript.minTaptimeWrongPushTask1" + tmt1_minTaptimeWrongPushTask1); */ /* * * TMT2 * * プレフィックス= TMT2_ * * */ /* * //全タッチ関連静的変数のグローバル変数(別クラスで宣言) * public static int pushDownTask1 = 0; * public static int pdtTask1 = 0; * public static DateTime[] pushDownTimeTask1 = new DateTime[500]; * public static TimeSpan totalTapTimePushDownTask1; * public static double meanTimePushDownTask1; * public static double maxTaptimePushDownTask1 = 0; * public static double minTaptimePushDownTask1 = 0; * //15秒で110回プッシュできたので45秒で330回 * //60秒までの拡張を見越して440回で500回に */ // int tmt2_pushDownTask1 = S524Test2GameManagerScript.GetPushDownTask1(); DateTime[] tmt2_pushDownTimeTask1 = S524Test2GameManagerScript.GetPushDownTimeTask1(); double tmt2_meanTimePushDownTask1 = S524Test2GameManagerScript.GetMeanTimePushDownTask1(); double tmt2_maxTaptimePushDownTask1 = S524Test2GameManagerScript.GetMaxTaptimePushDownTask1(); double tmt2_minTaptimePushDownTask1 = S524Test2GameManagerScript.GetMinTaptimePushDownTask1(); /* * Debug.Log("Page90GameManagerScript.pushDownTask1" + tmt2_pushDownTask1); * Debug.Log("Page90GameManagerScript.meanTimePushDownTask1" + tmt2_meanTimePushDownTask1); * Debug.Log("Page90GameManagerScript.maxTaptimePushDownTask1" + tmt2_maxTaptimePushDownTask1); * Debug.Log("Page90GameManagerScript.minTaptimePushDownTask1" + tmt2_minTaptimePushDownTask1); */ //タッチ正答数関連静的変数 /* * //タッチ正答数のグローバル変数(別クラスで宣言) * public static int rightPushTask1 = 0; * public static int rptTask1 = 0; * public static DateTime[] rightPushTimeTask1 = new DateTime[180]; * public static TimeSpan totalTapTimeRightPushTask1; * public static double meanTimeRightPushTask1; * public static double maxTaptimeRightPushTask1 = 0; * public static double minTaptimeRightPushTask1 = 0; */ //タッチ正答数 int tmt2_rightPushTask1 = S524Test2GameManagerScript.GetRightPushTask1(); DateTime[] tmt2_rightPushTimeTask1 = S524Test2GameManagerScript.GetRightPushTimeTask1(); double tmt2_meanTimeRightPushTask1 = S524Test2GameManagerScript.GetMeanTimeRightPushTask1(); double tmt2_maxTaptimeRightPushTask1 = S524Test2GameManagerScript.GetMaxTaptimeRightPushTask1(); double tmt2_minTaptimeRightPushTask1 = S524Test2GameManagerScript.GetMinTaptimeRightPushTask1(); /* * Debug.Log("Page90GameManagerScript.rightPushTask1" + tmt2_rightPushTask1); * Debug.Log("Page90GameManagerScript.meanTimeRightPushTask1" + tmt2_meanTimeRightPushTask1); * Debug.Log("Page90GameManagerScript.maxTaptimeRightPushTask1" + tmt2_maxTaptimeRightPushTask1); * Debug.Log("Page90GameManagerScript.minTaptimeRightPushTask1" + tmt2_minTaptimeRightPushTask1); */ /* * //タッチ誤答数のグローバル変数(別クラスで宣言) * public static int wrongPushTask1 = 0; * public static int wptTask1 = 0; * public static DateTime[] wrongPushTimeTask1 = new DateTime[500]; * public static TimeSpan totalTapTimeWrongPushTask1; * public static double meanTimeWrongPushTask1; * public static double maxTaptimeWrongPushTask1 = 0; * public static double minTaptimeWrongPushTask1 = 0; */ int tmt2_wrongPushTask1 = S524Test2GameManagerScript.GetWrongPushTask1(); DateTime[] tmt2_wrongPushTimeTask = S524Test2GameManagerScript.GetWrongPushTimeTask1(); double tmt2_meanTimeWrongPushTask1 = S524Test2GameManagerScript.GetMeanTimeWrongPushTask1(); double tmt2_maxTaptimeWrongPushTask1 = S524Test2GameManagerScript.GetMaxTaptimeWrongPushTask1(); double tmt2_minTaptimeWrongPushTask1 = S524Test2GameManagerScript.GetMinTaptimeWrongPushTask1(); /* * Debug.Log("Page90GameManagerScript.wrongPushTask1" + tmt2_wrongPushTask1); * Debug.Log("Page90GameManagerScript.meanTimeWrongPushTask1" + tmt2_meanTimeWrongPushTask1); * Debug.Log("Page90GameManagerScript.maxTaptimeWrongPushTask1" + tmt2_maxTaptimeWrongPushTask1); * Debug.Log("Page90GameManagerScript.minTaptimeWrongPushTask1" + tmt2_minTaptimeWrongPushTask1); */ /*************** リザルトの計算 ************/ //入力した年齢を取得 int getInputAge = InputManagerScript.GetInputAge(); //低下している認知機能リスト出力用オブジェクト StringBuilder resultDeclines = new StringBuilder(); string resultDecline; // //平均処理速度 //処理速度のスコア、順位など //TMT1のみ利用する(TMT2は注意力や作動記憶を必要とするため) //または誤答は勘案せずにTMT1とTMT2を使うか //TMT2は悩むのでタッチ数が少なくなるがそれがスコアに //反映されると納得感があるかもしれない //0.5歩先で難易度が高い状態にしておく // //処理速度スコアを計算する //この関数Start()で宣言した変数でグローバル変数を取得している // //若者は4周できるとするとタッチ個数=点数 // //int calc_ten_speed = tmt1_pushDownTask1; //暫定で一律62点 // int calc_ten_speed = 62; int calc_ten_speed = CalcScoreSpeed(); if (calc_ten_speed > 99) { calc_ten_speed = 100; } //処理速度年齢を取得する int calc_age_speed = CalcAgeSpeed(calc_ten_speed); /* *○✕評価 * 自分の年齢+-10歳は○ * 自分の年齢+11歳以上は◎ * 自分の年齢-11歳以上は△ */ string str_hantei_speed = ""; if (getInputAge - calc_age_speed > 11) { str_hantei_speed = "◎"; } else if (getInputAge - calc_age_speed < -11) { str_hantei_speed = "△"; resultDecline = "処理速度 "; resultDeclines.Append(resultDecline); } else { str_hantei_speed = "○"; } StringBuilder result_speed = new StringBuilder(); string str_calc_ten_speed = calc_ten_speed.ToString(); string str_calc_age_speed = calc_age_speed.ToString(); // result_speed.Append( str_calc_ten_speed + "点 "); // result_speed.Append( str_calc_age_speed + "歳 "); result_speed.Append(str_calc_ten_speed + " "); result_speed.Append(str_calc_age_speed + " "); result_speed.Append(str_hantei_speed); //以下の結果をInvokeで描画関数で実行してタメをもたせる //ResultSpeed.text = result_speed.ToString(); rSpeed = result_speed.ToString(); // //注意力 //注意力のスコア、順位など //TMT1、TMT2を利用する //回答総数に対する誤答数の数か //回答総数が少ないかつ誤答数が少ない場合の扱いを考える //TMT2の回答総数はTMT1の○%減まで認める //それ以下だと注意力は低いとみなす //ゆっくりの場合は注意力を発揮していないとと考える // //注意力は注意する対象を定義する必要があるため //それが今提示のものであっても過去の経験記憶のものであっても //作動記憶が必要となる // //注意力スコアを計算する //この関数Start()で宣言した変数でグローバル変数を取得している //暫定で72点を表示する // int calc_ten_attention = 72; int calc_ten_attention = CalcScoreAttention(); if (calc_ten_attention > 99) { calc_ten_attention = 100; } //注意力年齢を取得する int calc_age_attention = CalcAgeAttention(calc_ten_attention); /* *○✕評価 * 自分の年齢+-10歳は○ * 自分の年齢+11歳以上は◎ * 自分の年齢-11歳以上は△ */ string str_hantei_attention = ""; if (getInputAge - calc_age_attention > 11) { str_hantei_attention = "◎"; } else if (getInputAge - calc_age_attention < -11) { str_hantei_attention = "△"; resultDecline = "注意力 "; resultDeclines.Append(resultDecline); } else { str_hantei_attention = "○"; } StringBuilder result_attention = new StringBuilder(); string str_calc_ten_attention = calc_ten_attention.ToString(); string str_calc_age_attention = calc_age_attention.ToString(); // result_attention.Append(str_calc_ten_attention + "点 "); // result_attention.Append(str_calc_age_attention + "歳 "); result_attention.Append(str_calc_ten_attention + " "); result_attention.Append(str_calc_age_attention + " "); result_attention.Append(str_hantei_attention); //以下の結果をInvokeで描画関数で実行してタメをもたせる //ResultAttention.text = result_attention.ToString(); rAttention = result_attention.ToString(); // //脳活動 //脳活動のスコア、順位など // //脳活動スコアを計算する //この関数Start()で宣言した変数でグローバル変数を取得している //暫定で39点を表示する int calc_ten_brain = 39; if (calc_ten_brain > 99) { calc_ten_brain = 100; } //脳活動年齢を取得する int calc_age_brain = CalcAgeBrain(calc_ten_brain); /* *○✕評価 * 自分の年齢+-10歳は○ * 自分の年齢+11歳以上は◎ * 自分の年齢-11歳以上は△ * 実年齢 - 計算年齢 = 11以上なら若い * 実年齢 - 計算年齢= -11以下なら老いてる */ string str_hantei_brain = ""; if (getInputAge - calc_age_brain > 11) { str_hantei_brain = "◎"; } else if (getInputAge - calc_age_brain < -11) { str_hantei_brain = "△"; resultDecline = "脳活動"; resultDeclines.Append(resultDecline); } else { str_hantei_brain = "○"; } StringBuilder result_brain = new StringBuilder(); string str_calc_ten_brain = calc_ten_brain.ToString(); string str_calc_age_brain = calc_age_brain.ToString(); // result_brain.Append(str_calc_ten_brain + "点 "); // result_brain.Append(str_calc_age_brain + "歳 "); result_brain.Append(str_calc_ten_brain + " "); result_brain.Append(str_calc_age_brain + " "); result_brain.Append(str_hantei_brain); //以下の結果をInvokeで描画関数で実行してタメをもたせる //ResultBrainActivity.text = result_brain.ToString(); rBrain = result_brain.ToString(); /*************** リザルト表示前にもったいぶる ************/ //別スレッドで○秒後に実施する //Invokeで呼ばれる関数で後続処理を記載すればよい //例えば画面描画とか //○f秒後に実行される Invoke("ShowResultSpeed", 3.5f); Invoke("ShowResultAttention", 4.5f); Invoke("ShowResultBrain", 5.5f); //低下機能リストはここで文字列化 rDeclines = resultDeclines.ToString(); Invoke("ShowResultDeclines", 6.5f); /*************** 他シーン連携用 ************/ /* * //処理速度 * public static int scoreSpeed; //点 * public static int ageSpeed; //年齢 * public static string classSpeed; //◎○△ */ scoreSpeed = calc_ten_speed; ageSpeed = calc_age_speed; classSpeed = str_hantei_speed; /* * //注意力 * public static int scoreAttention; //点 * public static int ageAttention; //年齢 * public static string classAttention; //◎○△ */ scoreAttention = calc_ten_attention; ageAttention = calc_age_attention; classAttention = str_hantei_attention; /* * //脳活動 * public static int scoreBrainActivity; //点 * public static int ageBrainActivity; //年齢 * public static string classBrainActivity; //◎○△ */ scoreBrain = calc_ten_brain; ageBrain = calc_age_brain; classBrain = str_hantei_brain; }