Exemplo n.º 1
0
        public override void Initialize()
        {
            base.Initialize();

            GameplaySystem gs = GameSystemManager.FindSystem <GameplaySystem>();


            _scores = new List <ScoremeterScore>();
            _od     = gs.Beatmap.Settings.Difficulty.OverallDifficutly;

            SizeMultiplier = 1.0f;

            var scoreSys = FindSystem <ScoreV1System>();

            Size     = new Vector2((float)scoreSys.HitThresholds[scoreSys.ScoreMiss] * 2.0f, 8);
            Position = new Vector2(
                gs.Skin.Settings.PlayfieldPositionX +
                gs.Skin.PlayfieldLineTexture.Width * gs.Beatmap.Settings.Difficulty.KeyAmount / 2.0f -
                Size.X * SizeMultiplier / 2.0f, 400);

            _hitColors = new Dictionary <string, Color>
            {
                { scoreSys.ScoreMarvelous, new Color(255, 255, 255) },
                { scoreSys.ScorePerfect, new Color(233, 201, 27) },
                { scoreSys.ScoreGreat, new Color(0, 231, 33) },
                { scoreSys.ScoreGood, new Color(0, 185, 231) },
                { scoreSys.ScoreBad, new Color(229, 0, 151) },
                { scoreSys.ScoreMiss, new Color(199, 0, 0) }
            };
        }
Exemplo n.º 2
0
 private void OnGUI()
 {
     if (GameSystemManager.GetSystem <ScreenEffect>().screen_covered)
     {
         DrawAnimation();
     }
 }
Exemplo n.º 3
0
 public void AccomplishTarget(int index)
 {
     targetObject[index].GetComponent <Image>().color = new Color(0.19f, 1, 0.063f, 0.39f);
     Level.levelScene nowLevel = GameObject.Find("MainScreenObject").GetComponent <Level>().nowLevel;
     GameSystemManager.GetSystem <StudentEventManager>().logStudentEvent("target_accomplished", "{level:'" + nowLevel + "'" +
                                                                         ", target:'" + (index + 1) + "', target_content:'" + targets[index] + "' }");
 }
Exemplo n.º 4
0
        public IEnumerator CheckOutAsync <T>(string name, System.Action <T> callback, bool forceLoad = false) where T : class
        {
                        #if ASSET_BUNDLE
            if (GameSystemManager.Get <AssetBundleManager>().IsAssetBundle(name))
            {
                yield return(StartCoroutine(CheckOutAssetBundleAsync <T>(name, callback, forceLoad)));
            }
                        #endif

            if (forceLoad)
            {
                yield return(StartCoroutine(LoadResourceAsync(name)));
            }

            Resource res = null;

            if (m_resources.ContainsKey(name))
            {
                res = m_resources[name];
                res.CheckoutCount++;
            }

            if (callback != null)
            {
                callback((T)res.Res);
            }
        }
Exemplo n.º 5
0
        public SfmlGraphicsSystem(GameSystemManager manager, GameStateHelper gameStateHelper, RenderWindow sfmlWindow, Tile[,] gameTiles)
        {
            LoadGlobals();

            SystemManager = manager;

            _gameStateHelper = gameStateHelper;
            _sfmlWindow      = sfmlWindow; //Don't create window here as we need the events to be in user input system
            _gameTiles       = gameTiles;
            worldXLength     = this._gameTiles.GetLength(0);
            worldYLength     = this._gameTiles.GetLength(1);

            _systemEntities = new List <Entity>();
            var fontPath = @"G:\Programming\CSConsoleRL\Oct172018Try\CSConsoleRL\CSConsoleRL\bin\Debug\Data\Fonts\arial.ttf";

            if (!File.Exists(fontPath))
            {
                fontPath = @"F:\Programming\CSConsoleRL\Data\Fonts\arial.ttf";
            }
            if (!File.Exists(fontPath))
            {
                fontPath = @"/home/jason/dev/CSConsoleRL/Data/Fonts/arial.ttf";
            }
            _gameFont = new Font(fontPath);

            LoadTextures();
        }
Exemplo n.º 6
0
 public bool Pull(string remote, string branch)
 {
     if (remotes.Contains(remote))
     {
         if (serverRepository.hasBranch(branch))
         {
             confilctFiles = new List <string>();
             //Debug.Log(serverRepository.nowBranch.nowCommit.allFiles.Count + " : " + modifiedFiles.Count);
             for (int i = 0; i < serverRepository.nowBranch.nowCommit.allFiles.Count; i++)
             {
                 for (int j = 0; j < modifiedFiles.Count; j++)
                 {
                     //Debug.Log(serverRepository.nowBranch.nowCommit.allFiles[i].Key + " : " +  modifiedFiles[j].Key);
                     if (serverRepository.nowBranch.nowCommit.allFiles[i].Key == modifiedFiles[j].Key)
                     {
                         //Debug.Log("Conflicted: " + modifiedFiles[j].Key);
                         confilctFiles.Add(modifiedFiles[j].Key);
                     }
                 }
             }
             if (confilctFiles.Count > 0)
             {
                 conflicted = true;
                 GameSystemManager.GetSystem <PanelManager>().AddSubPanel(conflictSystem);
                 conflictSystem.OpenConflict(confilctFiles, modifiedFiles, serverRepository.nowBranch.nowCommit.allFiles, false, "");
                 conflictSystem.gameObject.SetActive(true);
             }
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 7
0
 void IStoreListener.OnInitialized(IStoreController controller, IExtensionProvider extensions)
 {
     storeController = controller;
     if (PlayerPrefs.HasKey("RestoreIAP"))
     {
     }
     else
     {
         Debug.Log("재설치 복원시작");
         bool check = PlayerData.isRemoveAd;
         extensions.GetExtension <IAppleExtensions>().RestoreTransactions(result => {
             if (result)
             {
                 if (check != PlayerData.isRemoveAd)
                 {
                     GameSystemManager.ShowAlertMessage(new AlertMessage(1, LocalizationManager.GetText("Alert_RestoreIAPSuccess"), null, null, null));
                 }
             }
             else
             {
                 // Restoration failed.
             }
         });
         PlayerPrefs.SetInt("RestoreIAP", 1);
     }
     Debug.Log("결제 기능 초기화");
 }
Exemplo n.º 8
0
 public ShellSystem(GameSystemManager manager)
 {
     SystemManager = manager;
     DefineSupportedShellFunctions();
     _shellHistory   = new shellHistory();
     _systemEntities = new List <Entity>();
 }
Exemplo n.º 9
0
 public void GameUndo()
 {
     if (!isUndo && !isRestart && IsPlaying)
     {
         if (PlayerData.undoCount > 0)
         {
             StartCoroutine("UndoDelay");
             if (playingRecords.Count == 0)
             {
                 Debug.Log("원지점입니다.");
                 GameSystemManager.ShowAlertMessage(new AlertMessage(2, LocalizationManager.GetText("Alert_WarningUndoStart"), null, null, null));
             }
             else
             {
                 PlayingRecord record = playingRecords.Pop();
                 controller.UndoMove(record);
                 PlayerData.UseUndoCount();
                 UpdateUI();
             }
         }
         else
         {
             GameSystemManager.ShowAlertMessage(new AlertMessage(2, LocalizationManager.GetText("Alert_WarningUndo"), null, null, null));
         }
     }
 }
Exemplo n.º 10
0
 private void Start()
 {
     consoleCanvas.gameObject.SetActive(true);
     //GameSystemManager.AddSystem<DeveloperConsole>(gameObject);
     CreateCommands();
     GameSystemManager.GetSystem <PanelManager>().AddSubPanel(this);
 }
Exemplo n.º 11
0
 public void OnClickButton()
 {
     if (!PlayerData.isRemoveAd)
     {
         GameSystemManager.ShowAlertMessage(new AlertMessage(0, string.Format("{0}", LocalizationManager.GetText("Alert_BuyRemoveAd")), alertSprite, null, PurchaseRemoveAd));
     }
 }
Exemplo n.º 12
0
        public void SendEvent()
        {
            GameSystemManager.Get <EventManager>().SendEvent(InputManager.MOUSE_INPUT, new InputData(Status, PressPosition, ReleasePosition, HeldTime));

            if (Status == InputStatus.Pressed)
            {
                m_pressed       = true;
                m_pressPosition = PressPosition;
            }
            else if (Status == InputStatus.Released && m_pressed)
            {
                m_pressed = false;
                if (ReleasePosition.x - m_pressPosition.x > Screen.width * 0.1f)
                {
                    GameSystemManager.Get <EventManager>().SendEvent(InputManager.SWAP_LEFT);
                }

                if (ReleasePosition.x - m_pressPosition.x < Screen.width * -0.1f)
                {
                    GameSystemManager.Get <EventManager>().SendEvent(InputManager.SWAP_RIGHT);
                }

                m_pressPosition = Vector2.zero;
            }
        }
    // ---------- ゲーム終了 ----------
    private void EndStart()
    {
        StateStartCommon();
        //結果画面を表示
        uiCanvas.SetActive(false);
        resultCanvas.SetActive(true);
        bestScoreImage.SetActive(false);
        // スコアを設定
        resultScoreText.text = score.ToString();
        // ベストスコアの設定
        float bestScore = GameSystemManager.GetFloat(GameUtil.Const.SAVE_KEY_BEST_SCORE);

        if (bestScore == 0 || bestScore < score)
        {
            // ベストスコアの場合、保存する
            GameSystemManager.SetFloat(GameUtil.Const.SAVE_KEY_BEST_SCORE, score);
            bestScoreImage.SetActive(true);
        }
        // スコアの登録(ベストタイムに限らず送信)
        SendScore(score);
        // タワー全体をカメラ視点対象に設定
        cameraController.LookTowerTarget();
        // BGM変更
        assetsManager.PlayBGM(GameUtil.Const.BGM_KEY_MAGGOAL, false);
    }
Exemplo n.º 14
0
 protected void setUp()
 {
     nowLevel = nextLevel;
     nowLevel--;
     if (nextLevel == levelScene.Level1)
     {
         nowLevel = levelScene.Level0;
     }
     nextLevelButton.onClick.AddListener(delegate
     {
         restartCount = 0;
         GameSystemManager.GetSystem <SceneStateManager>().LoadSceneState(new LoadSceneState("MainSceneState", nextLevel + "Scene"), true);
     });
     restartLevelButton.onClick.AddListener(delegate
     {
         restartCount++;
         GameSystemManager.GetSystem <SceneStateManager>().LoadSceneState(new LoadSceneState("MainSceneState", nowLevel + "Scene"), true);
         GameSystemManager.GetSystem <StudentEventManager>().logStudentEvent("level_restart", "{level:'" + nowLevel + "'}");
     });
     returnTitleButton.onClick.AddListener(delegate
     {
         restartCount = 0;
         GameSystemManager.GetSystem <SceneStateManager>().LoadSceneState(new LoadSceneState("MainSceneState", "TitleScene"), true);
         GameSystemManager.GetSystem <StudentEventManager>().logStudentEvent("level_quit", "{level:'" + nowLevel + "'}");
     });
     if (GameSystemManager.GetSystem <StudentEventManager>())
     {
         GameSystemManager.GetSystem <StudentEventManager>().logStudentEvent("level_start", "{level:'" + nowLevel + "'}");
     }
     levelCost    = 0;
     passedLevel  = false;
     levelStarted = true;
 }
Exemplo n.º 15
0
        private void DrawUi()
        {
            var time = (long)FindSystem <GameTimeSystem>().Time;

            // Debug things
            _spriteBatch.DrawString(Skin.Font, time.ToString(), new Vector2(12, 12), Color.Red);
            _spriteBatch.DrawString(Skin.Font, ScrollingSpeed.ToString("F1"), new Vector2(12, 48), Color.Red);

            _spriteBatch.DrawString(Skin.Font,
                                    $"Song Speed: {FindSystem<MusicSystem>().PlaybackRate:F1}",
                                    new Vector2(12, 64),
                                    Color.DarkRed);

            var scoreSystem = GameSystemManager.FindSystem <ScoreV1System>();

            string scores = $"Marvelous: {scoreSystem.MarvelousCount}\n" +
                            $"Perfect: {scoreSystem.PerfectCount}\n" +
                            $"Great: {scoreSystem.GreatCount}\n" +
                            $"Good: {scoreSystem.GoodCount}\n" +
                            $"Bad: {scoreSystem.BadCount}\n" +
                            $"Miss: {scoreSystem.MissCount}";

            _spriteBatch.DrawString(Skin.Font, scores, new Vector2(800, 10), Color.Black);
            _spriteBatch.DrawString(Skin.Font,
                                    $"ScoremeterScore: {scoreSystem.Score}\n" +
                                    $"Combo: {scoreSystem.Combo}\n" +
                                    $"Accuracy: {scoreSystem.Accuracy * 100:F2}%\n" +
                                    $"HP: {FindSystem<HealthSystem>().Health}",
                                    new Vector2(15, 300), Color.Black);
        }
Exemplo n.º 16
0
 public void OnClickSelectItemYes()
 {
     if (selectItem > 0)
     {
         SoundManager.PlaySound(SoundManager.Sound.AlertYes);
         Item item = shopItemList[selectItem - 1];
         if (PlayerData.goldCube >= item.value)
         {
             PlayerData.UseGoldCube(item.value);
             if (item.type == 0)
             {
                 ItemManager.Instance.ItemUseableBuy(item);
                 GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("`{0}`{1}", LocalizationManager.GetText("ItemName" + item.number), LocalizationManager.GetText("Alert_BuySuccess")), item.sprite, null, null));
             }
             else if (item.type == 1)
             {
                 PlayerData.AddCharacter(item.number);
                 GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("`{0}`{1}", LocalizationManager.GetText("ItemName" + item.number), LocalizationManager.GetText("Alert_BuySuccess")), null, item.prefab, null));
             }
             ItemSelectCheckPanelTransform.gameObject.SetActive(false);
             shopItemSlotList[selectItem].GetChild(3).gameObject.SetActive(false);
             RefreshShopItemUI();
         }
         selectItem = 0;
     }
 }
Exemplo n.º 17
0
    // Start is called before the first frame update
    void Start()
    {
        leftButton.onClick.AddListener(delegate
        {
            PrePage();
        }
                                       );
        rightButton.onClick.AddListener(delegate
        {
            NextPage();
        }
                                        );
        pageText.text  = (nowPage + 1) + "/" + count;
        dialougeString = dialouge[nowPage];
        if (sprites[nowPage])
        {
            image.sprite = sprites[nowPage];
        }

        waitEnd = true;
        GameObject tipsObject = gameObject;

        dialougeText.text = "";
        image.enabled     = false;
        GameSystemManager.GetSystem <TimerManager>().Add(new Timer(4, TipsStart, null));
    }
Exemplo n.º 18
0
    public override bool Update()
    {
        if (m_Request != null)
        {
            return(false);
        }

        LoadedAssetBundle bundle = GameSystemManager.Get <AssetBundleManager>().GetLoadedAssetBundle(m_AssetBundleName, out m_DownloadingError);

        if (bundle != null)
        {
            if (m_IsAdditive)
            {
                m_Request = Application.LoadLevelAdditiveAsync(m_LevelName);
            }
            else
            {
                m_Request = Application.LoadLevelAsync(m_LevelName);
            }
            return(false);
        }
        else
        {
            return(true);
        }
    }
Exemplo n.º 19
0
        public IEnumerator LoadResourceAsync(string name)
        {
                        #if ASSET_BUNDLE
            if (GameSystemManager.Get <AssetBundleManager>().IsAssetBundle(name))
            {
                yield return(StartCoroutine(LoadAssetBundleAsync(name)));
            }
                        #endif

            if (m_resources.ContainsKey(name))
            {
                yield break;
            }

            ResourceRequest resourceRequest = Resources.LoadAsync(name);

            while (!resourceRequest.isDone)
            {
                yield return(0);
            }

            Resource res = new Resource();
            res.Res           = (object)resourceRequest.asset;
            res.CheckoutCount = 0;

            if (res.Res == null)
            {
                Debug.LogError("[ResourceManager] - Failed to find resource '" + name + "'");
            }

            m_resources[name] = res;
        }
Exemplo n.º 20
0
        static void Main(string[] args)
        {
            var mapInfo = new MapFile(new Tile[30, 30], new List <Spawn>());

            for (int y = 0; y < mapInfo.TileSet.GetLength(1); y++)
            {
                for (int x = 0; x < mapInfo.TileSet.GetLength(0); x++)
                {
                    mapInfo.TileSet[x, y].TileType = EnumTileTypes.Snow;
                }
            }

            var mapIndex    = args.Length > 0 ? args[0] : null;
            var newFileMenu = new MapFileHandler.MapFileHandler(ref mapInfo, mapIndex);

            //Set LOS default
            for (int y = 0; y < mapInfo.TileSet.GetLength(1); y++)
            {
                for (int x = 0; x < mapInfo.TileSet.GetLength(0); x++)
                {
                    mapInfo.TileSet[x, y].IsInLos = false;
                }
            }

            var gameSystemManager = new GameSystemManager(mapInfo);
        }
Exemplo n.º 21
0
        private void DoScore(HitObject hitObject, int hitValue)
        {
            if (hitValue < 0)
            {
                return;
            }

            string hitValueName;

            if (hitValue == HitValues[ScoreMarvelous])
            {
                CurrentScoreSplash = new ScoreSplash(_gameplay.Skin.ScoreMarvelousTexture);
                MarvelousCount++;
                hitValueName = ScoreMarvelous;
            }
            else if (hitValue == HitValues[ScorePerfect])
            {
                CurrentScoreSplash = new ScoreSplash(_gameplay.Skin.ScorePerfectTexture);
                PerfectCount++;
                hitValueName = ScorePerfect;
            }
            else if (hitValue == HitValues[ScoreGreat])
            {
                CurrentScoreSplash = new ScoreSplash(_gameplay.Skin.ScoreGreatTexture);
                GreatCount++;
                hitValueName = ScoreGreat;
            }
            else if (hitValue == HitValues[ScoreGood])
            {
                CurrentScoreSplash = new ScoreSplash(_gameplay.Skin.ScoreGoodTexture);
                GoodCount++;
                hitValueName = ScoreGood;
            }
            else if (hitValue == HitValues[ScoreBad])
            {
                CurrentScoreSplash = new ScoreSplash(_gameplay.Skin.ScoreBadTexture);
                BadCount++;
                hitValueName = ScoreBad;
            }
            else if (hitValue == HitValues[ScoreMiss])
            {
                CurrentScoreSplash = new ScoreSplash(_gameplay.Skin.ScoreMissTexture);
                MissCount++;
                DoBreakCombo();
                hitValueName = ScoreMiss;
            }
            else
            {
                throw new InvalidDataException("ScoremeterScore not found");
            }

            OnScoreGet?.Invoke(this, new OnScoreGetEventHandler(hitValueName, HitValues[hitValueName], (float)FindSystem <GameTimeSystem>().Time - hitObject.Position));
            GameSystemManager.FindSystem <ScoremeterSystem>()?.AddScore((long)FindSystem <GameTimeSystem>().Time,
                                                                        hitObject.Position, hitValueName);

            ProceedCombo(hitValue);
            CalculateScore(hitValueName);
            CalculateAccuracy();
        }
Exemplo n.º 22
0
 public AiSystem(GameSystemManager _manager, Tile[,] _gameTiles, GameStateHelper gameStateHelper)
 {
     SystemManager    = _manager;
     _systemEntities  = new List <Entity>();
     this._gameTiles  = _gameTiles;
     _aiEnabled       = true;
     _gameStateHelper = gameStateHelper;
 }
Exemplo n.º 23
0
 public void Commit()
 {
     if (hasRepository() && !conflicted)
     {
         gitFileObject.SetActive(true);
         GameSystemManager.GetSystem <PanelManager>().AddSubPanel(this);
     }
 }
Exemplo n.º 24
0
        public override void Initialize()
        {
            base.Initialize();

            _gameplay = GameSystemManager.FindSystem <GameplaySystem>();

            InitValues();
        }
Exemplo n.º 25
0
 public LosSystem(GameSystemManager manager, Tile[,] gameTiles)
 {
     SystemManager   = manager;
     _systemEntities = new List <Entity>();
     _gameTiles      = gameTiles;
     _tileDictionary = new TileTypeDictionary();
     _fowEnabled     = false;
 }
Exemplo n.º 26
0
 private void Start()
 {
     seAudioSource  = gameObject.AddComponent <AudioSource>();
     bgmAudioSource = gameObject.AddComponent <AudioSource>();
     // ボリュームオンオフ情報を取得
     boolBGMOff = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_BOOL_BGM_VOLUME_OFF);
     boolSEOff  = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_BOOL_SE_VOLUME_OFF);
 }
Exemplo n.º 27
0
 public MovementSystem(GameSystemManager manager, Tile[,] gameTiles, GameStateHelper gameState)
 {
     SystemManager   = manager;
     _systemEntities = new List <Entity>();
     _gameTiles      = gameTiles;
     _tileDictionary = new TileTypeDictionary();
     _gameState      = gameState;
 }
Exemplo n.º 28
0
        public void StopListenForEvent(string eventName)
        {
            if (m_eventListeners.ContainsKey(eventName))
            {
                m_eventListeners.Remove(eventName);

                GameSystemManager.Get <EventManager>().UnregisterListener(eventName, this);
            }
        }
Exemplo n.º 29
0
        public virtual void Destroy()
        {
            foreach (string eventName in m_eventListeners.Keys)
            {
                GameSystemManager.Get <EventManager>().UnregisterListener(eventName, this);
            }

            m_eventListeners.Clear();
        }
Exemplo n.º 30
0
 public void PurchaseRemoveAd()
 {
     PlayerData.isRemoveAd = true;
     PlayerDataSystem.Save();
     PlayerData.AddCharacter(16);
     AdMobManager.Instance.HideBanner();
     GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_BuyRemoveAdYes")), null, GameAssetsManager.instance.CharacterAssets[16].asset, null));
     StartManager.Instance.AddCharToGrid(16);
     Debug.Log("광고 구매완료");
 }
        public void VerifyLoad()
        {
            var manager = new GameSystemManager();

            manager.LoadSkillListings();
            manager.LoadSizes();
            manager.LoadRaceListing();

            var gameSystem = manager.GameSystem;

            Assert.That(gameSystem.SkillListings.Count, Is.EqualTo(26));
            Assert.That(gameSystem.Sizes.Count, Is.EqualTo(9));
            Assert.That(gameSystem.RaceListings.Count, Is.EqualTo(7));
        }
Exemplo n.º 32
0
        public MainWindow()
        {
            InitializeComponent();

            GameSystemManager = new GameSystemManager();

            GameSystemManager.LoadSkillListings();
            GameSystemManager.LoadSizes();
            GameSystemManager.LoadRaceListing();
            GameSystemManager.LoadCharacters();

            DataContext = new MainWindowViewModel
            {
                Characters = GameSystemManager.Characters.Select(c => new CharacterViewModel(c)).ToList()
            };
        }