private void FixedUpdate() { //fireCheckflag = FireFlag.MasterFrag; GameObject g = GameObject.Find("Checker"); CheckObject c = g.GetComponent <CheckObject>(); GameObject h = GameObject.Find("Checker"); Move_Check d = h.GetComponent <Move_Check>(); if (moveFlag == true) { //if (fireCheckflag == false) //{ if (tag == "Panel" || tag == "Panel_union") { // transform.position += vec[i] * 10; if (transform.position != _tmp2) { transform.position = Vector3.MoveTowards(transform.position, _tmp2, 100 * Time.deltaTime); } if (transform.position == _tmp2) { moveFlag = false; c.RFlag = true; if (d.move_Check == 1) { d.Check(); } } } //} } }
void Start() { g_game_Con_Script = GameObject.Find("Game_Controller").GetComponent <Game_Controller>(); g_check_Script = this.GetComponent <Move_Check>(); g_dice_fall_Script = this.GetComponent <Dice_Fall>(); g_undo_Script = GameObject.Find("Game_Controller").GetComponent <Undo_Script>(); //配列を生成 g_work_Objs_Array = new GameObject[g_array_max, g_array_max, g_array_max]; }
public void OnUserAction(string tag, bool flag) { int cnt = 0; Vector3 rota = new Vector3(0.0f, 90.0f, 0.0f); GameObject g = GameObject.Find("Checker"); CheckObject c = g.GetComponent <CheckObject>(); GameObject h = GameObject.Find("Checker"); Move_Check d = h.GetComponent <Move_Check>(); if (tag == "Start" || tag == "Goal" || tag == "Wall") { if (d.move_Check == 1) { d.Check(); } } for (int i = 0; i < 4; i++) { if (CheckMove(vec[i], tag) == true) { if (moveFlag == false) { _tmp = vec[i]; _tmp2 = transform.position + vec[i] * 10; moveFlag = true; } if (tag == "Panel_rota") { transform.Rotate(rota); c.RFlag = true; d.Check(); } //Debug.Log(tag); break; } if (!CheckMove(vec[i], tag) == true) { cnt++; if (cnt == 4 && d.move_Check == 1) { d.Check(); cnt = 0; } } //else if(CheckMove(vec[i], tag) == false && c.GetComponent<CheckObject>().RFlag == false && moveFlag == false) //{ // c.GetComponent<CheckObject>().RFlag = true; //} } }
void FixedUpdate() { GameObject g = GameObject.Find("Checker"); Move_Check c = g.GetComponent <Move_Check>(); if (Input.GetMouseButtonDown(0) && RFlag == false) { if (c.Check() == true) { Ray ray = new Ray(); RaycastHit hit = new RaycastHit(); ray = Camera.main.ScreenPointToRay(Input.mousePosition); //Panelにhitしたか判定 if (Physics.Raycast(ray.origin, ray.direction, out hit, Mathf.Infinity)) { if (_flag == false && movve_Panel == 0) { _flag = true; string tag = hit.collider.GetComponent <move_panel>().tag; hit.collider.GetComponent <move_panel>().OnUserAction(tag, _flag); } if (_flag == true) { RFlag = true; } } else if (!Physics.Raycast(ray.origin, ray.direction, out hit, Mathf.Infinity)) { c.Check(); } } } if (RFlag == true) { RFlag = false; _flag = false; } }