public static void DestroyMe(GameObject _gameObject) { inst.MyProc.Reset(); inst = null; Debug.Log("Destroy:BackGroundManager"); Destroy(_gameObject); }
void Start() { backGround = GameObject.Find("BackGround"); bgm = backGround.GetComponent <BackGroundManager>(); audioSource = GetComponent <AudioSource>(); }
[SerializeField] int baseSection = 20000; // タロットを変える区切り void Start() { backGround = GameObject.Find("BackGround"); bgm = backGround.GetComponent <BackGroundManager>(); textObj = GameObject.Find("ScoreText"); score = 0; }
private BackGroundManager bgm; // スクリプト参照 void Start() { backGround = GameObject.Find("BackGround"); this.BackGround_1 = GameObject.Find("BackGround1"); this.BackGround_2 = GameObject.Find("BackGround2"); SpriteWidth = BackGround_2.transform.position.x - BackGround_1.transform.position.x; bgm = backGround.GetComponent <BackGroundManager>(); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } }
public static BackGroundManager Create() { GameObject gameObject = new GameObject(); gameObject.name = "Background Manager"; BackGroundManager backgroundManager = gameObject.AddComponent <BackGroundManager>(); backgroundManager._bgPiecesCount = backgroundManager._backgroundPieces.Capacity; backgroundManager._bgPiece = Resources.Load <Sprite>("Sprites/BackgroundPieceNovo"); backgroundManager.AddComponentToPieces(backgroundManager._bgPiecesCount); backgroundManager.DesativatePieces(); return(backgroundManager); }
protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here sfxButtonPress = Content.Load <SoundEffect>(ASSET_NAME_SFX_BUTTON_PRESS); sfxScoreReached = Content.Load <SoundEffect>(ASSET_NAME_SFX_SCORE_REACHED); sfxHit = Content.Load <SoundEffect>(ASSET_NAME_SFX_HIT); _font = Content.Load <SpriteFont>("MyFont"); spriteSheetTexture = Content.Load <Texture2D>(ASSET_NAME_SPRITESHEET); _fadeInTexture = new Texture2D(GraphicsDevice, 1, 1); _fadeInTexture.SetData(new Color[] { Color.White }); trex = new Trex(spriteSheetTexture, new Vector2(TREX_START_POS_X, TREX_START_POS_Y - Trex.TREX_DEF_SPRITE_HEIGHT), sfxButtonPress, GraphicsDevice); trex.DrawOrder = 10; trex.JumpComplete += TrexJumpComplete; trex.Died += TrexDied; _scoreBoard = new ScoreBoard(spriteSheetTexture, new Vector2(SCORE_BOARD_POS_X, SCORE_BOARD_POS_Y), trex, sfxScoreReached); _inputController = new InputController(trex); _groundManager = new GroundManager(spriteSheetTexture, _entityManager, trex); _obstacleManager = new ObstacleManager(_entityManager, trex, _scoreBoard, spriteSheetTexture, GraphicsDevice); _backroundManager = new BackGroundManager(spriteSheetTexture, _entityManager, trex); _gameOverScreen = new GameOverScreen( spriteSheetTexture, new Vector2( (WINDOW_WIDTH - GameOverScreen.GAME_OVER_TEXTURE_WIDTH) / 2, (WINDOW_HEIGHT - GameOverScreen.GAME_OVER_TEXTURE_HEIGHT) / 3 ), this ); _entityManager.AddEntity(trex); _entityManager.AddEntity(_groundManager); _entityManager.AddEntity(_scoreBoard); _entityManager.AddEntity(_obstacleManager); _entityManager.AddEntity(_gameOverScreen); _entityManager.AddEntity(_backroundManager); }
protected override IEnumerator Start() { // f:初期設定 PlayerManager plm = PlayerManager.Inst; SoundManager sm = SoundManager.Inst; AppearManager am = AppearManager.Inst; PauseManager pm = PauseManager.Inst; ResultManager rm = ResultManager.Inst; BackGroundManager bm = BackGroundManager.Inst; GameManager gm = GameManager.Inst; PlayerUIManager puim = PlayerUIManager.Inst; // f: Debug.Log("1:target_loadingを生成する。"); Instantiate(Resources.Load("Prefabs/target_loading"), GameObject.Find("LoadingCanvas").transform).name = "target_loading"; plm.Starting(); // TimeLimitの生成 Instantiate(Resources.Load(ResourcesPath.Ui("TimeLimitCanvas")), GameObject.Find(CanvasName.UI).transform); sm.Starting(); am.Starting(); // yield return new WaitUntil(() => plm.MyProc.started && sm.MyProc.started && am.MyProc.started); yield return(pm.Starting()); rm.Starting(); bm.Starting(); GameManager.SetPCName(CharacterSelectManager.PC1Name ?? PC1Name, PlayerSlot.PC1); GameManager.SetPCName(CharacterSelectManager.PC2Name ?? PC2Name, PlayerSlot.PC2); gm.Starting(); yield return(new WaitUntil(() => GameManager.Pc1Player.MyProc.started && GameManager.Pc2Player.MyProc.started)); puim.Starting(); MyProc.started = true; Destroy(gameObject); }
public void RpcRoundHasStarted() { playerWantsToSkip = false; if (isLocalPlayer) //deactivate btn on local player { if (PRB) { PRB.gameObject.SetActive(false); } if (PSB) { PSB.gameObject.SetActive(true); } BackGroundManager BGM = GetComponent <BackGroundManager>(); if (BGM) { BGM.nextImage(); } } }
protected override IEnumerator Start() { yield return(new WaitUntil(() => NoaProcesser.BossProc.started)); BackGroundManager.DestroyMe(gameObject); }
private void Awake() { instance = this; }