Exemplo n.º 1
0
    int CalculateMonobeat(Sequence.Wall wall, Passage.Step step)
    {
        int measure = Mathf.FloorToInt(wall.Measure);
        int beat    = Mathf.RoundToInt((wall.Measure - measure) * 10);

        return(CalculateMonobeat(measure, beat) + ((step == null)? 0 : step.Beat));
    }
Exemplo n.º 2
0
    void AddToTargetMap(Sequence.Wall wall, Passage.Step step, TargetController target)
    {
        int key = CalculateMonobeat(wall, step);

        if (!TargetMap.ContainsKey(key))
        {
            TargetMap.Add(key, new List <TargetController>());
        }
        TargetMap[key].Add(target);
    }
Exemplo n.º 3
0
    void AddToWallMap(Sequence.Wall wall, WallController wc)
    {
        int key = CalculateMonobeat(wall, null);

        if (!WallMap.ContainsKey(key))
        {
            WallMap.Add(key, new List <WallController>());
        }
        WallMap[key].Add(wc);
    }
Exemplo n.º 4
0
    Vector2 MakeTarget(
        Sequence sequence,
        Sequence.Wall wall,
        WallController wallController,
        Passage.Step step,
        Transform drawingPlane,
        Vector2 position,
        float size,
        Vector2 last)
    {
        GameObject       target           = Instantiate(TargetPrefab, drawingPlane);
        TargetController targetController = target.GetComponent <TargetController>();

        wallController.Targets.Add(targetController);
        targetController.Step     = step;
        targetController.HitClip  = sequence.HitSound;
        targetController.MissClip = sequence.MissSound;
        targetController.Update(position, size, last);
        target.name = step.Beat + " left";
        AddToTargetMap(wall, step, targetController);

        return(position);
    }