// Use this for initialization
    void Start()
    {
        var mus = GameObject.FindGameObjectWithTag("MusicSys");

        if (mus)
        {
            music_sys = mus.GetComponent <MusicSys>();
        }

        level_stats = GameObject.FindGameObjectWithTag("LevelPlaylist").GetComponent <LevelPlaylist>();

        gameoverPanel.gameObject.SetActive(false);
        score_list = new List <PlayerScoreData>();

        State = GameState.Setup;

        var entDB = GameObject.FindGameObjectWithTag("EntityDatabase");

        stats = entDB.GetComponent <GameplayDatabase>().Stats[0];

        scores = new List <int>();
        scores.Add(stats.Score_first);
        scores.Add(stats.Score_second);
        scores.Add(stats.Score_third);
        scores.Add(stats.Score_fourth);

        if (music_sys)
        {
            music_sys.StopCurrent();
        }
    }
        public AudicaTargetHitState TargetHit(GameplayStats gameplayStats, SongCues.Cue cue, Vector2 targetHitPos)
        {
            AudicaTargetHitState targetHit = new AudicaTargetHitState();

            targetHit.targetIndex       = cue.index;
            targetHit.type              = this.cueToTargetType(cue);
            targetHit.hand              = this.cueToHand(cue);
            targetHit.timingScore       = gameplayStats.GetLastTimingScore();
            targetHit.aimScore          = gameplayStats.GetLastAimScore();
            targetHit.score             = targetHit.timingScore + targetHit.aimScore; // TODO: may need to multiply by combo? Need to test
            targetHit.tick              = cue.tick;
            targetHit.targetHitPosition = targetHitPos;

            return(targetHit);
        }
    // Use this for initialization
    void Start()
    {
        var mus=GameObject.FindGameObjectWithTag("MusicSys");
        if (mus)
            music_sys=mus.GetComponent<MusicSys>();

        level_stats=GameObject.FindGameObjectWithTag("LevelPlaylist").GetComponent<LevelPlaylist>();

        gameoverPanel.gameObject.SetActive(false);
        score_list=new List<PlayerScoreData>();

        State=GameState.Setup;

        var entDB=GameObject.FindGameObjectWithTag("EntityDatabase");
        stats=entDB.GetComponent<GameplayDatabase>().Stats[0];

        scores=new List<int>();
        scores.Add(stats.Score_first);
        scores.Add(stats.Score_second);
        scores.Add(stats.Score_third);
        scores.Add(stats.Score_fourth);

        if (music_sys)
            music_sys.StopCurrent();
    }
Пример #4
0
 public static void Postfix(ref GameplayStats __instance, ref SongCues.Cue cue, ref Vector2 targetHitPos)
 {
     MelonLoader.MelonModLogger.Log("Target Hit! " + targetHitPos.ToString());
     AudicaTargetHitState targetHit = AudicaHTTPStatus.AudicaTargetState.TargetHit(__instance, cue, targetHitPos);
     // TODO: feed output into JSON parser then to HTTP server as websocket event
 }