コード例 #1
0
ファイル: TitleScene.cs プロジェクト: kurodakazumichi/Nekopon
        protected override IEnumerator Load()
        {
            var waitForCount = new WaitForCount();

            System.Action pre  = waitForCount.inc;
            System.Action done = waitForCount.dec;

            var rm = ResourceSystem.Instance;

            rm.Load <GameObject>("Title.Logo.prefab", pre, done, (res) => { this.logoPrefab = res; });
            rm.Load <GameObject>("Title.MenuCpu.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.MenuVs.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.MenuDemo.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.MenuOption.prefab", pre, done, (res) => { this.menuPrefabs.Add(res); });
            rm.Load <GameObject>("Title.EffectGenerator.prefab", pre, done, (res) => { this.effectPrefab = res; });
            rm.Load <GameObject>("Cursor.CatPaw.prefab", pre, done, (res) => { this.cursorPrefab = res; });
            rm.Load <AudioClip>("BGM.001", pre, done);
            rm.Load <AudioClip>("SE.Select01", pre, done);
            TitleLogo.Load(pre, done);
            Menu.Load(pre, done);
            Paw.Load(pre, done);
            EffectGenerator.Load(pre, done);

            yield return(waitForCount);

            this.isLoaded = true;
            this.state.SetState(State.Setup);
        }
コード例 #2
0
ファイル: TitleScene.cs プロジェクト: kurodakazumichi/Nekopon
        //-------------------------------------------------------------------------
        // ステートマシン

        /// <summary>
        /// リソースからゲームオブジェクトを生成する
        /// </summary>
        private void OnSetupEnter()
        {
            // タイトルロゴ
            this.logo = Instantiate(this.logoPrefab).GetComponent <TitleLogo>();
            this.logo.SetParent(this.CacheTransform);
            this.logo.SetActive(false);

            // カーソル
            this.cursor = Instantiate(this.cursorPrefab).GetComponent <Paw>();
            this.cursor.SetParent(this.CacheTransform);
            this.cursor.SetActive(false);
            this.cursor.PadNo = 0;

            // メニュー
            this.menuPrefabs.ForEach((prefab) => {
                var menu = Instantiate(prefab).GetComponent <Menu>();
                menu.SetParent(this.CacheTransform);
                menu.SetActive(false);
                menu.SceneType = SceneSystem.SceneType.Title;
                this.menus.Add(menu);
            });

            // エフェクト
            this.effect = Instantiate(this.effectPrefab).GetComponent <EffectGenerator>();
            this.effect.SetParent(this.CacheTransform);

            // Introへ
            this.state.SetState(State.Intro);
        }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        m_titlestate = TitleState.Start;
        m_girl       = GameObject.Find("girl").GetComponent <TitleGirl>();
        m_ribbon     = GameObject.Find("ribbon_circle").GetComponent <TitleRibbon>();
        m_titlelogo  = GameObject.Find("TitleLogo").GetComponent <TitleLogo>();
        m_titleui    = GameObject.Find("TitleUI").GetComponent <TitleUI>();
        //  m_invisibleribbon = GameObject.Find("ribbon2/obj1").GetComponent<InvisibleRibbon>();
        m_fadeCanvas.gameObject.SetActive(true);
        bgm000_startFlag = false;
        se001_startFlag  = false;
        se017_startFlag  = false;

        //QualitySettings.vSyncCount = 0;
        //Application.targetFrameRate = 60;
    }
コード例 #4
0
ファイル: TitleScene.cs プロジェクト: kurodakazumichi/Nekopon
        protected override void OnMyDestory()
        {
            SoundSystem.Instance.StopBGM();
            var rm = ResourceSystem.Instance;

            rm.Unload("Title.Logo.prefab");
            rm.Unload("Title.MenuCpu.prefab");
            rm.Unload("Title.MenuVs.prefab");
            rm.Unload("Title.MenuDemo.prefab");
            rm.Unload("Title.MenuOption.prefab");
            rm.Unload("Title.EffectGenerator.prefab");
            rm.Unload("Cursor.CatPaw.prefab");
            rm.Unload("BGM.001");
            rm.Unload("SE.Select01");

            TitleLogo.Unload();
            Menu.Unload();
            Paw.Unload();
            EffectGenerator.Unload();
        }
コード例 #5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            SpriteBatch = new SpriteBatch(GraphicsDevice);
            Pixel       = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
            Pixel.SetData(new[] { Color.White });
            Logo    = new TitleLogo(this);
            SideBar = new SideBar(this);

            MouseInput    = new MouseInput();
            TouchInput    = new TouchInput();
            UnifiedInput  = new UnifiedInput(this);
            KeyboardInput = new KeyboardInput(this);
            UnifiedInput.TapListeners.Add(t => Arena?.OnTap(t));

            Textures.LoadContent(Content);
            Sprites.LoadContent(this, Content);
            Fonts.LoadContent(Content);
            Sounds = new Sounds(this);

            TileSet01 = new TileSet(Strings.Park, new Color(37f / 255f, 92f / 255f, 64f / 255f), Textures.TileSetJungle01, Textures.TileSetShadows, Textures.TileSetBridges);
            TileSet02 = new TileSet(Strings.Jungle, new Color(13f / 255f, 69f / 255f, 17f / 255f), Textures.TileSetJungle02, Textures.TileSetShadows, Textures.TileSetBridges);
            TileSet03 = new TileSet(Strings.RoadBlock, new Color(101f / 255f, 97f / 255f, 96f / 255f), Textures.TileSetRoad01, Textures.TileSetShadows, Textures.TileSetBridgesRoad);
            TileSet04 = new TileSet(Strings.Geiger, new Color(39f / 255f, 37f / 255f, 92f / 255f), Textures.TileSetGeiger01, Textures.TileSetShadows, Textures.TileSetBridgesGeiger);


            TileSets = new TileSet[] { TileSet01, TileSet02, TileSet03, TileSet04 };
            TileSet  = TileSets[GameSettings.TileSet];

            MenuMap.Initialize();

            MenuArena  = new MenuArena(this);
            PauseArena = new PauseArena(this, MenuArena);

            _arena = MenuArena;
            _arena.Initialise();
        }