private void FixedUpdate() { if (doChange) { Ggos.g.goPic2pieces[(int)Codes.firstPic7].transform.localPosition = Vector3.Lerp(Ggos.g.goPic2pieces[(int)Codes.firstPic7].transform.localPosition, target2Pos, 0.5f); Ggos.g.goPic2pieces[picID].transform.localPosition = Vector3.Lerp(Ggos.g.goPic2pieces[picID].transform.localPosition, target1Pos, 0.5f); if (Ggos.g.goPic2pieces[(int)Codes.firstPic7].transform.localPosition == target2Pos) { target2Pos.z = -0.02f; Ggos.g.goPic2pieces[(int)Codes.firstPic7].transform.localPosition = target2Pos; Ggos.g.goPic2pieces[(int)Codes.firstPic7].transform.localScale = normScale; target1Pos.z = -0.02f; Ggos.g.goPic2pieces[picID].transform.localPosition = target1Pos; Ggos.g.goPic2pieces[picID].transform.localScale = normScale; Codes.Swap(7, Array.IndexOf(Codes.codeReal[7], (int)Codes.firstPic7), Array.IndexOf(Codes.codeReal[7], picID)); Debug.Log(Codes.codeReal[7][0].ToString() + " * " + Codes.codeReal[7][1].ToString() + " * " + Codes.codeReal[7][2].ToString() + " * " + Codes.codeReal[7][3].ToString() + " * " + Codes.codeReal[7][4].ToString() + " * " + Codes.codeReal[7][5].ToString() + " * " + Codes.codeReal[7][6].ToString() + " * " + Codes.codeReal[7][7].ToString() + " * " + Codes.codeReal[7][8].ToString()); Codes.firstPic7 = null; Gcam.touchable = true; Codes.CheckCode(7); doChange = false; } } }
private void FixedUpdate() { if (rolling) { transform.localRotation = Quaternion.Slerp(transform.localRotation, Quaternion.Euler(rollTarget), Time.deltaTime * 30f); if (transform.localRotation == Quaternion.Euler(rollTarget)) { if (Codes.codeReal[6][rollID] == 6) { Codes.codeReal[6][rollID] = 0; rollTarget.y = 0; transform.localRotation = Quaternion.Euler(rollTarget); } Gcam.touchable = true; matBuff[Codes.codeReal[6][rollID] + 1] = Ggos.g.mats[0]; GetComponent <MeshRenderer>().materials = matBuff; Debug.Log(Codes.codeReal[6][0].ToString() + " * " + Codes.codeReal[6][1].ToString() + " * " + Codes.codeReal[6][2].ToString() + " * " + Codes.codeReal[6][3].ToString()); Codes.CheckCode(6); rolling = false; } } }
private void FixedUpdate() { if (doChange) { switch (count) { case 5: Ggos.g.goBookshelf2books[(int)Codes.firstBook3].GetComponent <MeshRenderer>().material = Ggos.g.mats[0]; Ggos.g.goBookshelf2books[bookID].GetComponent <MeshRenderer>().material = Ggos.g.mats[0]; Ggos.g.goBookshelf2books[(int)Codes.firstBook3].transform.localPosition = Codes.bookPos[Array.IndexOf(Codes.codeReal[3], bookID)]; Ggos.g.goBookshelf2books[bookID].transform.localPosition = Codes.bookPos[Array.IndexOf(Codes.codeReal[3], (int)Codes.firstBook3)]; count++; break; case 10: Ggos.g.goBookshelf2books[(int)Codes.firstBook3].GetComponent <MeshRenderer>().material = Ggos.g.mats[4]; Ggos.g.goBookshelf2books[bookID].GetComponent <MeshRenderer>().material = Ggos.g.mats[4]; count++; break; case 15: posTemp = Ggos.g.goBookshelf2books[(int)Codes.firstBook3].transform.localPosition; posTemp.y = 0f; Ggos.g.goBookshelf2books[(int)Codes.firstBook3].transform.localPosition = posTemp; posTemp = Ggos.g.goBookshelf2books[bookID].transform.localPosition; posTemp.y = 0f; Ggos.g.goBookshelf2books[bookID].transform.localPosition = posTemp; Codes.Swap(3, Array.IndexOf(Codes.codeReal[3], (int)Codes.firstBook3), Array.IndexOf(Codes.codeReal[3], bookID)); Debug.Log(Codes.codeReal[3][0].ToString() + " * " + Codes.codeReal[3][1].ToString() + " * " + Codes.codeReal[3][2].ToString() + " * " + Codes.codeReal[3][3].ToString() + " * " + Codes.codeReal[3][4].ToString() + " * " + Codes.codeReal[3][5].ToString() + " * " + Codes.codeReal[3][6].ToString()); Codes.firstBook3 = null; Gcam.touchable = true; Codes.CheckCode(3); doChange = false; count = 0; break; default: count++; break; } } }
private void OnMouseUpAsButton() { if (Gcam.touchable) { Ggos.g.goMainCamera.GetComponent <AudioSource>().PlayOneShot(Ggos.g.audioClips[3]); matBuff = GetComponent <MeshRenderer>().materials; matBuff[0] = Ggos.g.mats[0]; GetComponent <MeshRenderer>().materials = matBuff; GetComponent <BoxCollider>().enabled = false; Codes.codeReal[10][Codes.picPointer[10]] = btnID; Debug.Log(Codes.codeReal[10][0].ToString() + " * " + Codes.codeReal[10][1].ToString() + " * " + Codes.codeReal[10][2].ToString() + " * " + Codes.codeReal[10][3].ToString() + " * " + Codes.codeReal[10][4].ToString() + " * " + Codes.codeReal[10][5].ToString() + " * " + Codes.codeReal[10][6].ToString() + " * " + Codes.codeReal[10][7].ToString() + " * " + Codes.codeReal[10][8].ToString()); if (Codes.picPointer[10] == 8) { Codes.CheckCode(10); } else { Codes.picPointer[10]++; } } }