void Start() { StartCoroutine(SceneChange.FadeOut(2)); audioSource = GetComponent <AudioSource>(); stageCount = stagePoints.transform.childCount; stagePointsObj = new GameObject[stageCount]; stagePoint = new StagePoint[stageCount]; for (int i = 0; i < stageCount; i++) { stagePointsObj[i] = stagePoints.transform.GetChild(i).gameObject; stagePoint[i] = stagePointsObj[i].GetComponent <StagePoint>(); } cameraPoint = new Vector3[stageCount]; cameraT.position = cameraPoint[0] + stageToCam; ufoT.position = stagePointsObj[0].transform.position + stageToUfo; defEmissionColor = stagePointsObj[0].GetComponent <Renderer>().materials[1].GetColor("_EmissionColor"); stagePointsObj[select].GetComponent <Renderer>().materials[1].SetColor("_EmissionColor", selectedEmissionColor); StartCoroutine(SetUp()); for (int i = 0; i < stageCount; i++) { cameraPoint[i] = stagePointsObj[i].transform.position; cameraPoint[i].x /= 1.1f; } StartCoroutine(MoveCamera()); explainText = explainObj.GetComponentInChildren <Text>(); StartCoroutine("Explain"); }
void Start() { StartCoroutine(GenerateAndManageStrings()); messageText = message.GetComponentInChildren <Text>(); menuCount = menus.Length; t_menu = new float[menuCount]; menuText = new Text[menuCount]; buttonTextColor = new Color[menuCount]; defMenuPos = new Vector3[menuCount]; message.color = Color.white - Color.black; cursor.color = Color.white - Color.black; cursor.rectTransform.position = cursorPos_menu[0].position; titleLogo.color = Color.white - Color.black; titleLogoEffect.GetComponent <Image>().color = Color.white - Color.black; for (int i = 0; i < menuCount; i++) { defMenuPos[i] = menus[i].rectTransform.position; menus[i].color = Color.white - Color.black; menuText[i] = menus[i].GetComponentInChildren <Text>(); buttonTextColor[i] = menuText[i].color; menuText[i].color = Color.white - Color.black; } for (int i = 0; i < 2; i++) { defYesNoPos[i] = yesNo[i].rectTransform.position; yesNo[i].color = Color.white - Color.black; } audioSource = GetComponent <AudioSource>(); StartCoroutine(SceneChange.FadeOut(2)); StartCoroutine(EnableMenu()); }
private void Start() { StartCoroutine(SceneChange.FadeOut()); if (GameStateManager.Instance.Score != 0f) { preScore = (int)GameStateManager.Instance.Score; } remainingTime = (int)TimeCount.Instance.remainingTime; //preScoreとのバランスをとるために10倍する remainingTime *= 10; //Normal if (GameStateManager.Instance.prestate == GameStateManager.State.Game2) { datapath = "Score/Normal"; } else if (GameStateManager.Instance.prestate == GameStateManager.State.Game3) { datapath = "Score/Hard"; } else if (GameStateManager.Instance.prestate == GameStateManager.State.Game4) { datapath = "Score/EX"; } preScoreText = GameObject.Find("Canvas/ScoreButton/Text").GetComponent <Text>(); timeText = GameObject.Find("Canvas/TimeButton/Text").GetComponent <Text>(); totalScoreText = GameObject.Find("Canvas/TotalScoreButton/Text").GetComponent <Text>(); rankText = GameObject.Find("Canvas/RankDisplay/Text").GetComponent <Text>(); inputField = GameObject.Find("Canvas/InputField").GetComponent <Image>(); placeHolder = GameObject.Find("Canvas/InputField/Placeholder").GetComponent <Text>(); scoreButtonImage = GameObject.Find("Canvas/ScoreButton").GetComponent <Image>(); timeButtonImage = GameObject.Find("Canvas/TimeButton").GetComponent <Image>(); timeT = GameObject.Find("Canvas/TimeButton/TimeText").GetComponent <Text>(); scoreT = GameObject.Find("Canvas/ScoreButton/ScoreText").GetComponent <Text>(); totalScoreButton = GameObject.Find("Canvas/TotalScoreButton").GetComponent <RectTransform>(); subPerFrameScore = preScore / 100; subPerFrameTime = remainingTime / 100; preScoreText.text = preScore.ToString(); timeText.text = remainingTime.ToString(); totalScoreText.text = totalScore.ToString(); aud = GetComponent <AudioSource>(); ReadFile(datapath); StartCoroutine(RankAnimation()); }
private void Start() { StartCoroutine(SceneChange.FadeOut()); aud = GetComponent <AudioSource>(); selectObject = firstObjects[0]; toGame = GameObject.Find("SceneChange").GetComponent <ToGame>(); animators[1].speed = 0f; cursorT = cursor.GetComponent <RectTransform>(); cursorPos[0] = cursorT.localPosition; cursorPos[1] = cursorPos[0]; cursorPos[1].y -= 120f; for (int i = 0; i < 2; i++) { f_rect[i] = firstObjects[i].GetComponent <RectTransform>(); f_image[i] = firstObjects[i].GetComponent <Image>(); defFirstPos[i] = f_rect[i].localPosition; } }
void Start() { aud = GetComponent <AudioSource>(); timeCount = GameObject.Find("Canvas/Time").GetComponent <TimeCount>(); StartCoroutine(SceneChange.FadeOut()); map = GameObject.Find("map").transform; isMoving = true; GameObject[] maps = GameObject.FindGameObjectsWithTag("Map"); foreach (GameObject g in maps) { if (g.name.Substring(0, 2) == "m1") { float color = Random.Range(0.7f, 1f); //g.GetComponent<SpriteRenderer>().color = new Color(color, color, color, Random.Range(0.9f, 1f)); } } cameraT = Camera.main.transform; playerT = GameObject.FindGameObjectWithTag("Player").transform; }