private void Awake() { foreach (FadeCanvas t in GetComponentsInChildren <FadeCanvas>()) { if (t.gameObject.name == "Logo") { logoFade = t; continue; } else if (t.gameObject.name == "DisplayOptions") { displayFade = t; continue; } } foreach (Button button in GetComponentsInChildren <Button>()) { if (button.gameObject.name == "VrModeButton") { vrModeButton = button; } else if (button.gameObject.name == "PortraitModeButton") { portraitModeButton = button; } } optionsFade = GetComponent <FadeCanvas>(); }
//シーンの読み込みと待機を行うコルーチン IEnumerator WaitForLoadScene(int stageNum) { // キャラの移動を停止させる playerRigidbody.isKinematic = true; //フェードオブジェクトを生成 fadeCanvasClone = Instantiate(fadeCanvasPrefab); //コンポーネントを取得 fadeCanvas = fadeCanvasClone.GetComponent <FadeCanvas>(); //フェードインさせる fadeCanvas.fadeIn = true; yield return(new WaitForSeconds(fadeWaitTime)); //シーンを非同期で読込し、読み込まれるまで待機する yield return(SceneManager.LoadSceneAsync(stageName[stageNum])); // 中間ポイントが存在するかどうか if (middlePoint != null) { // 中間ポイントを取っていたら,そこから再開 if (middleResumeFlag) { player.transform.position = middlePoint.transform.position + new Vector3(0.0f, 0.5f, 0.0f); camera.transform.rotation = middlePoint.transform.rotation; } } //フェードアウトさせる fadeCanvas.fadeOut = true; // シーン遷移が終わったことを示す transitionFlag = false; }
//シーンの読み込みと待機を行うコルーチン IEnumerator WaitForLoadScene(int sceneNum) { CurrentSceneNum = sceneNum; //フェードオブジェクトを生成 fadeCanvasObj = Instantiate(fadeCanvasPrefab); //コンポーネントを取得 fadeCanvas = fadeCanvasObj.GetComponent <FadeCanvas>(); //フェードインさせる fadeCanvas.fadeIn = true; yield return(new WaitForSeconds(fadeWaitTime)); //シーンを非同期で読込し、読み込まれるまで待機する yield return(SceneManager.LoadSceneAsync(sceneNum)); //フェードアウトさせる fadeCanvas.fadeOut = true; yield return(new WaitForSeconds(fadeWaitTime)); Destroy(fadeCanvasObj); }
private void Start() { fadeCanvas = GameManager.fadeCanvas; // シーン遷移後のイベント追加 SceneManager.sceneLoaded += (scene, loadSceneMode) => { fadeCanvas.fadeOut = true; }; }
// Use this for initialization void Start() { fadeCanvas = GetComponentInChildren <FadeCanvas>(); menuState = MenuState.HIDE; if (type == MenuType.VR) { reticleMeshRender.enabled = false; } }
// Start is called before the first frame update void Start() { button = FrontSceneManager.eventButton; buttonText = FrontSceneManager.buttonText; naviCanvas = FrontSceneManager.naviCanvas; fadeCanvas = GameManager.fadeCanvas; enemy = GameObject.FindGameObjectWithTag("Enemy").GetComponent <Enemy>(); points = gameObject.GetComponentsInChildren <Transform>(); }
private void Awake() { fadeCanvas = GetComponent <FadeCanvas>(); videoController = GetComponentInParent <VideoController>(); menuController = GetComponentInParent <MenuController>(); GameObject reticlePointer = GameObject.FindGameObjectWithTag("MainCamera").GetComponentInChildren <GvrReticlePointer>().gameObject; reticleMeshRender = reticlePointer.GetComponent <MeshRenderer>(); playerController = GetComponentInParent <PlayerController>(); }
// Use this for initialization private void Awake() { if (Instance != null) { Destroy(gameObject); return; } Instance = this; DontDestroyOnLoad(gameObject); }
// Start is called before the first frame update private void Awake() { // シーンを切り替えてもこのゲームオブジェクトを削除しないようにする if (created) { Destroy(gameObject); } else { created = true; DontDestroyOnLoad(gameObject); } fadeCanvas = GetComponentInChildren <FadeCanvas>(true); audioSource = GetComponentInChildren <AudioSource>(true); }
private void Start() { naviCanvas = FrontSceneManager.naviCanvas; fadeCanvas = GameManager.fadeCanvas; Transform cameraParent = Camera.main.transform.parent.parent; cameraAnimator = cameraParent.GetComponent <Animator>(); nanamiAnimator = FrontSceneManager.enemy.GetComponent <Animator>(); playerAnimator = FrontSceneManager.player.GetComponent <Animator>(); cameraAnimator.enabled = false; moving = cameraParent.GetComponent <CameraMoving>(); protect = cameraParent.GetComponent <ProtectFromWall>(); pointLight = GetComponentInChildren <Light>(true); particle = GetComponentInChildren <ParticleSystem>(true); audioSource = GetComponentInChildren <AudioSource>(true); }
// Start is called before the first frame update virtual protected void Start() { button = FrontSceneManager.eventButton; buttonText = FrontSceneManager.buttonText; fadeCanvas = GameManager.fadeCanvas; textCanvas = FrontSceneManager.textCanvas; // audioController = GameManager.audioController; naviCanvas = FrontSceneManager.naviCanvas; gameClearCanvas = FrontSceneManager.gameClearCanvas; enemy = FrontSceneManager.enemy.gameObject; player = FrontSceneManager.player.transform; if (unityEvent == null) { unityEvent = new UnityEvent(); } }
//シーンの読み込みと待機を行うコルーチン IEnumerator WaitForLoadScene() { //フェードオブジェクトを生成 fadeCanvasClone = Instantiate(fadeCanvasPrefab); //コンポーネントを取得 fadeCanvas = fadeCanvasClone.GetComponent <FadeCanvas>(); //フェードインさせる fadeCanvas.fadeIn = true; yield return(new WaitForSeconds(fadeWaitTime)); //シーンを非同期で読込し、読み込まれるまで待機する yield return(SceneManager.LoadSceneAsync(stageName[currentStageNum])); //フェードアウトさせる fadeCanvas.fadeOut = true; }
IEnumerator ChangeLevelCoroutine(string name) { GameObject go = Instantiate(fadeCanvasPrefab); go.transform.SetParent(transform); FadeCanvas fade = go.GetComponent <FadeCanvas>(); FadeCanvas.FadeOperation fadeOp = fade.SetFade(FadeCanvas.FadeDirection.FadeIn, transitionFadeDuration); while (!fadeOp.complete) { yield return(null); } SceneManager.LoadScene(name, LoadSceneMode.Single); fadeOp = fade.SetFade(FadeCanvas.FadeDirection.FadeOut, transitionFadeDuration); while (!fadeOp.complete) { yield return(null); } Destroy(go); }
private IEnumerator PlayerTranlate(Character character) { Debug.Log("Translate"); SystemCtrl.canCtrl = false; animator.SetBool("Open", true); animator.SetBool("Close", false); nextDoor.animator.SetBool("Open", true); nextDoor.animator.SetBool("Close", false); GameObject fadeObj = Instantiate(SystemCtrl.fadeCanvas); FadeCanvas fade = fadeObj.GetComponent <FadeCanvas>(); fade.alpha = 0; fade.fadeSwitch = 2; while (fade.fadeSwitch != 0) { yield return(null); } character.transform.position = nextDoor.transform.position; character.body.SetActive(false); yield return(new WaitForSeconds(1f)); fade.fadeSwitch = 2; while (fade.fadeSwitch != 0) { yield return(null); } Destroy(fadeObj); animator.SetBool("Open", false); animator.SetBool("Close", true); nextDoor.animator.SetBool("Open", false); nextDoor.animator.SetBool("Close", true); character.body.SetActive(true); character.canJump = true; while (!stateInfo.IsName("Door_Idle")) { yield return(null); } SystemCtrl.canCtrl = true; character.onDoor = nextDoor; yield break; }
//シーンの読み込みと待機を行うコルーチン IEnumerator WaitForLoadScene(int stageNum) { //フェードオブジェクトを生成 fadeCanvasClone = Instantiate(fadeCanvasPrefab); //コンポーネントを取得 fadeCanvas = fadeCanvasClone.GetComponent <FadeCanvas>(); //フェードインさせる fadeCanvas.fadeIn = true; yield return(new WaitForSeconds(fadeWaitTime)); //シーンを非同期で読込し、読み込まれるまで待機する yield return(SceneManager.LoadSceneAsync(stageName[stageNum])); //フェードアウトさせる fadeCanvas.fadeOut = true; //読み込んだシーンがタイトルなら if (currentStageNum == 1) { TitleDisplay(); } //読み込んだシーンがゲーム画面なら if (currentStageNum == 2) { //Playerのコンポーネント取得 player = GameObject.FindGameObjectWithTag("Player"); playerControl = player.GetComponent <PlayerControl>(); playerRigidbody = player.GetComponent <Rigidbody>(); playerCollider = player.GetComponent <Collider>(); stageCreate = GameObject.Find("StageCreater").GetComponent <StageCreate>(); stageMove = GameObject.Find("Floor").GetComponent <StageMove>(); } }
public void SetMyOnSceneLoadedEventReplacable() { FadeCanvas.SetSceneLoadedEventReplacable(m_OnMySceneLoadedReplaceable); }
public void SetMyOnSceneLoadedEvent() { FadeCanvas.SetSceneLoadedEvent(m_OnMySceneLoaded); }
public void RemoveReplaceableSceneChangeEvent() { m_OnMySceneLoadedReplaceable = new UnityEvent(); FadeCanvas.SetSceneLoadedEventReplacable(m_OnMySceneLoadedReplaceable); }
protected override void Awake() { base.Awake(); fadeCanvas = FindObjectOfType <FadeCanvas>(); }