Queue <KeyValuePair <string, string> > quizs = new Queue <KeyValuePair <string, string> >(); //맨앞에 것만 쏙쏙 뺄거니깐 큐로 충분 //키밸류 페어는 별수 없다고 생각함 void Awake() { if (inst == null) { inst = this; } }
// Use this for initialization void Start() { script = new WordScript(); script.setLines(); timerStatus = 0; resetBools(); //Debug.Log(Application.persistentDataPath); //get player object player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); //instatiate puzzle list puzzleList = new List <Puzzle>(); //load all the puzzles into the list puzzleList = loadPuzzles(); //load the previous progress in so we know which puzzle to spawn on startup. puzzleID = loadID(); timerStatus = loadID(); //set current puzzle setPuzzle(puzzleID); secondHand = GameObject.FindGameObjectWithTag("Second Hand"); minuteHand = GameObject.FindGameObjectWithTag("Minute Hand"); hourHand = GameObject.FindGameObjectWithTag("Hour Hand"); secondHand.GetComponent <Rigidbody>().centerOfMass = new Vector3(0, -1.4f, 0); minuteHand.GetComponent <Rigidbody>().centerOfMass = new Vector3(0, -1.2f, 0); hourHand.GetComponent <Rigidbody>().centerOfMass = new Vector3(0, -.75f, 0); DateTime currentTime = DateTime.Now; float secondsDegree = -(currentTime.Second / 60f) * 360f; secondHand.GetComponent <Rigidbody>().MoveRotation(Quaternion.Euler(new Vector3(0, 0, secondsDegree))); if (testTime) { float minutesDegree = -(testMin / 60f) * 360f; minuteHand.GetComponent <Rigidbody>().MoveRotation(Quaternion.Euler(new Vector3(0, 0, minutesDegree))); float hoursDegree = -(testHour / 12f) * 360f; hourHand.GetComponent <Rigidbody>().MoveRotation(Quaternion.Euler(new Vector3(0, 0, hoursDegree))); } else { float minutesDegree = -(currentTime.Minute / 60f) * 360f; minuteHand.GetComponent <Rigidbody>().MoveRotation(Quaternion.Euler(new Vector3(0, 0, minutesDegree))); float hoursDegree = -(currentTime.Hour / 12f) * 360f; hourHand.GetComponent <Rigidbody>().MoveRotation(Quaternion.Euler(new Vector3(0, 0, hoursDegree))); } secondHand.GetComponent <Rigidbody>().angularVelocity = new Vector3(0, 0, clockSpeed); minuteHand.GetComponent <Rigidbody>().angularVelocity = new Vector3(0, 0, clockSpeed / 60); hourHand.GetComponent <Rigidbody>().angularVelocity = new Vector3(0, 0, clockSpeed / (60 * 60 * 12)); timer = 0f; cText.text = script.Lines[timerStatus]; Debug.Log(script.Lines[timerStatus]); }
public void CheckForValidWords() { foreach (GameObject s in WordsOnScreen) { WordScript script = s.GetComponent <WordScript>(); if (script.Text.ToLower() == InputText.text.ToLower()) { script.CompletedWord(); if (GameMode != (int)GameModes.Casual) { Score++; } if (Score > StatsHandler.HighestScore) { StatsHandler.HighestScore = Score; } InputText.text = ""; break; } } }