void Start() { //必要なスクリプトを所持 obj_sceneControll = GameObject.Find("SceneController"); sceneControll = obj_sceneControll.GetComponent <SceneControll>(); obj_portal = GameObject.Find("TutrialCamera"); distortPortal = obj_portal.GetComponent <DistortPortal>(); obj_crtNoise = GameObject.Find("TutrialCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); //ゴールorPortalのメアスオブジェ portalPosObj = GameObject.FindGameObjectWithTag("GoleObject"); //キャンバスを最初は消しておく foreach (var image in PouseRogo) { image.enabled = false; } //フラグ関係の初期化 changeSceneFrag = false; stageClearFrag = false; playerDeadFrag = false; outBlackAlpha = true; pouseSelect = PouseSelect.ToContinue; }
void Start() { //シーン情報を取得 obj_PerformanceCamera = GameObject.Find("PerformanceCamera"); obj_scene = GameObject.Find("SceneController"); sceneControll = obj_scene.GetComponent <SceneControll>(); obj_stageInstructs = GameObject.Find("StageConfiguration"); stageInstructs = obj_stageInstructs.GetComponent <StageInstructs>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); obj_crtNoise = GameObject.Find("SelectMainCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); //演出用のカメラの情報を一つ前のシーンの状態と同じにする obj_PerformanceCamera.transform.position = cameraInformation.CameraPos; obj_PerformanceCamera.transform.rotation = cameraInformation.CameraRota; //セレクトシーンに入った瞬間はNoneとして初期化 sceneControll.CurrentStage = NextStage.None; ChangeSceneFrag = false; ChangeSceneCount = 2; //シーン移行の際につかう黒い画像なので最初は表示しない image.enabled = false; }
private void Start() { rightFingerId = -1; sceneController = GameObject.FindGameObjectWithTag("SceneController").GetComponent <SceneControll>(); shootingButtonPressed = false; meleeScript = GetComponentInChildren <MeleeAttack>(); ammoHealthScript = GetComponent <PlayerHealthAmmo>(); camDistance = mainCamera.transform.localPosition.z; cameraCam = mainCamera.GetComponent <Camera>(); startCamPos = mainCamera.transform.localPosition; startFOV = cameraCam.fieldOfView; crossImage = cross.GetComponent <Image>(); aiming = false; nonAimingButton.SetActive(false); shootingButton.SetActive(false); controller = GetComponent <CharacterController>(); animator = player.GetComponent <Animator>(); startCrossColor = crossImage.color; reloadImgItself = reloadImg.GetComponent <Image>(); reloadImg.SetActive(false); meleeObject.SetActive(false); shootingAudioSource = shootPoint.GetComponent <AudioSource>(); tanyaSoundSource = GetComponent <AudioSource>(); startStepPos = transform.position; shootlight = shootPoint.GetComponent <Light>(); shootlight.enabled = false; startIntensity = shootlight.intensity; //flashlight = shootPoint.transform.GetChild(0).gameObject.GetComponent<Light>(); //flashlight.cookie = lightCookie; }
void Start() { //必要なスクリプトを所持 obj_sceneControll = GameObject.Find("SceneController"); sceneControll = obj_sceneControll.GetComponent <SceneControll>(); obj_portal = GameObject.Find("PlayCamera"); distortPortal = obj_portal.GetComponent <DistortPortal>(); obj_crtNoise = GameObject.Find("PlayCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); //ゴールorPortalのメアスオブジェ portalPosObj = GameObject.FindGameObjectWithTag("GoleObject"); //キャンバスを最初は消しておく foreach (var image in PouseRogo) { image.enabled = false; } //フラグ関係の初期化 changeSceneFrag = false; stageClearFrag = false; playerDeadFrag = false; outBlackAlpha = true; lastStageClearFrag = false; pouseSelect = PouseSelect.ToContinue; //シーン移行の際につかう黒い画像なので最初は表示しない // LeanTween.colorText(outBlack.GetComponent<RectTransform>(), new Color(1, 1, 1, 0), 0.5f); }
void Start() { //アクティブでないシーンはカメラを着る MainCam.SetActive(false); scene = GameObject.Find("SceneController"); sceneControll = scene.GetComponent <SceneControll>(); //現在のステージと自身が存在するシーンが異なればレイヤー設定 if (GetSceneContainObject(gameObject) != sceneControll.CurrentStage.ToString() + "ChildScene" || sceneControll.CurrentScene == SceneName.SelectScene) { List <GameObject> list = ChildLayer.GetAll(stageObj); foreach (var childTransform in list) { childTransform.gameObject.layer = LayerMask.NameToLayer("Production"); } } if (SceneManager.GetActiveScene().name == SceneName.SelectScene.ToString()) { foreach (var light_ in light) { light_.SetActive(false); } } }
public void StartGame() { SceneControll sceneController = GameObject.FindGameObjectWithTag("SceneController").GetComponent <SceneControll>(); SaveSystem.FromStart(sceneController); //StartCoroutine(LoadAsync(1)); StartCoroutine(LoadAsync(Random.Range(1, SceneManager.sceneCountInBuildSettings))); }
private void Start() { controller = GameObject.FindGameObjectWithTag("SceneController").GetComponent <SceneControll>(); highScore.text += controller.highScore; if (controller.died) { ContinueButon.interactable = false; } }
public static void SavePlayer(SceneControll sceneController) { string path = Application.persistentDataPath + "/saveFile.zss"; BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Create); PlayerSaveData data = new PlayerSaveData(sceneController); formatter.Serialize(stream, data); stream.Close(); }
IEnumerator BtnFlick() { for (int i = 0; i < 5; i++) { startBtn.image.color = Color.clear; yield return(new WaitForSeconds(0.2f)); startBtn.image.color = Color.white; yield return(new WaitForSeconds(0.2f)); } SceneControll.ChangeScene("PreEntrance"); }
public static void FromStart(SceneControll sceneController) { string path = Application.persistentDataPath + "/saveFile.zss"; if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Create); PlayerSaveData data = new PlayerSaveData(sceneController); data.fromStart = true; formatter.Serialize(stream, data); stream.Close(); } }
public PlayerSaveData(SceneControll sceneControll) { died = sceneControll.died; highScore = sceneControll.highScore; savedScore = sceneControll.savedKilledInGame; fromStart = sceneControll.fromStart; currentSceneIndex = sceneControll.currentSceneIndex; savedShot = sceneControll.savedShot; savedHealth = sceneControll.savedHealth; savedAmmo = sceneControll.savedAmmo; savedPosition = new float[3]; savedPosition[0] = sceneControll.savedPlayerPos.x; savedPosition[1] = sceneControll.savedPlayerPos.y; savedPosition[2] = sceneControll.savedPlayerPos.z; }
//void Awake() void Start() { soundTimer = Random.Range(1f, 8f); zombieSound = GetComponent <AudioSource>(); dead = false; agent = GetComponent <NavMeshAgent>(); zombie = transform.GetChild(0).transform.GetChild(1).gameObject; mat = zombie.GetComponent <Renderer>().material; animator = transform.GetChild(0).GetComponent <Animator>(); startCol = mat.color; startHealth = health; animator.SetFloat("cycleOffset", Random.Range(0f, 1f)); localSceneController = GameObject.FindGameObjectWithTag("SceneController").GetComponent <SceneControll>(); //player = GameObject.FindGameObjectWithTag("Player"); player = localSceneController.player; playerScript = player.GetComponent <PlayerHealthAmmo>(); captureSpot.GetComponent <CapturePoint>().zombiesInGame.Add(this.gameObject); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Stop")) { velocityWalk = 0; characterWalking.enabled = false; characterLooking.enabled = true; StartCoroutine("TimeToWaitStart"); } if (collision.CompareTag("Castle")) { SceneControll.ChangeScene("Castle"); } if (collision.CompareTag("Stop2")) { _CastleTransition.CharPlayer.SetActive(true); this.gameObject.SetActive(false); } }
void Start() { //すべてEnableにする for (int i = 0; i < tutorialImages_.Length; i++) { //Debug.Log("消しました"); tutorialImages_[i].enabled = false; } for (int i = 0; i < tutorial_1_text.Length; i++) { //Debug.Log("消しました"); tutorial_1_text[i].enabled = false; } for (int i = 0; i < tutorial_2_text.Length; i++) { //Debug.Log("消しました"); tutorial_2_text[i].enabled = false; } for (int i = 0; i < tutorial_3_text.Length; i++) { tutorial_3_text[i].enabled = false; } for (int i = 0; i < controllerGuide_.Length; i++) { controllerGuide_[i].enabled = false; } ButtonImage_.enabled = false; //スクリプト読み込み scene_ = GameObject.Find("SceneController").GetComponent <SceneControll>(); player_ = GameObject.Find("FPSPlayer").GetComponent <Player>(); key_ = player_.GetComponent <KeyRestriction>(); shooter_ = player_.GetComponent <Shooter>(); moveObjget_ = GameObject.Find("moveObjGet").GetComponent <tutorialMoveObjGet>(); tutorialcontroll_ = GameObject.Find("TutorialControll").GetComponent <TutorialControll>(); textCount_ = 0; //debug player_.isStop_ = true; }
//string name; void Start() { //持っているカメラ情報を取得 MainCam = GameObject.Find("TitleMainCamera"); SubCam = GameObject.Find("TitleSubCamera"); //使用するスクリプトを保持 //シーン情報を取得 obj_scene = GameObject.Find("SceneController"); sceneControll = obj_scene.GetComponent <SceneControll>(); //ポータルに支持を出すための変数 distortPortal = MainCam.GetComponent <DistortPortal>(); obj_crtNoise = GameObject.Find("TitleMainCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); //演出の関係上必要になったフラグ sceneChangeFrag = false; image_black.enabled = false; //SoundManager.GetInstance.PlayBGM("6815"); }
IEnumerator TimeToWaitStart() { yield return(new WaitForSeconds(timeToChange)); SceneControll.ChangeScene("Entrance"); }
private void Start() { timer = timerReload; saveIcon.SetActive(false); sceneController = GameObject.FindGameObjectWithTag("SceneController").GetComponent <SceneControll>(); }
// Use this for initialization void Start() { scene_ = GameObject.Find("SceneController").GetComponent <SceneControll>(); }
private void Awake() { timeToDisappear = 30f; sceneController = GameObject.FindGameObjectWithTag("SceneController").GetComponent <SceneControll>(); sceneController.medkitsInGame.Add(this.gameObject); }