Пример #1
0
    void spawnMemoryNote(GameObject ring, Transform spawner, HitEvent hitObject, KeyCode key)
    {
        if (MemoryNoteManager.Instance.currentMemorySequence.Count > 0)
        {
            HitEvent memNote     = MemoryNoteManager.Instance.currentMemorySequence.Dequeue();
            var      currentRing = Instantiate(ring, spawner.localPosition, Quaternion.identity);
            currentRing.transform.SetParent(diamondHolder.transform, false);
            hitObject.setPlayMode(FetchNotePlayMode(hitObject));
            currentRing.GetComponent <DiamondRing>().Initialize(diamondHitbox.transform.localScale, hitObject.getOffset(), scrollDelay, hitObject);
            if (hitObject.getColorIntArray().Length == 4)
            {
                colorIntArray = hitObject.getColorIntArray();
            }
            int intKey = Array.IndexOf(colorIntArray, memNote.getKey());
            switch (intKey)
            {
            case 0:       // LEFT
                currentRing.GetComponent <DiamondRing>().keyCode = keyLeft;
                break;

            case 1:      // DOWN
                currentRing.GetComponent <DiamondRing>().keyCode = keyDown;
                break;

            case 2:      // UP
                currentRing.GetComponent <DiamondRing>().keyCode = keyUp;
                break;

            case 3:      // RIGHT
                currentRing.GetComponent <DiamondRing>().keyCode = keyRight;
                break;

            default:
                break;
            }
        }
    }
Пример #2
0
    public void spawnNotes(HitEvent hitObject)
    {
        switch (hitObject.getKey())
        {
        case 0:                                   // LEFT
            if (memoryMode || invertedMemoryMode) // Currently in a memory timing section
            {
                spawnMemoryNote(diamondRing, diamondRing.transform, hitObject, keyLeft);
            }
            else if (hitObject.IsMine())
            {
                spawnStepNote(bigMine, leftSpawnerBig, hitObject, keyLeft);
            }
            else
            {
                spawnStepNote(bigRing, leftSpawnerBig, hitObject, keyLeft);
            }
            break;

        case 1:      // DOWN
            if (memoryMode || invertedMemoryMode)
            {
                spawnMemoryNote(diamondRing, diamondRing.transform, hitObject, keyDown);
            }
            else if (hitObject.IsMine())
            {
                spawnStepNote(smallMine, leftSpawnerSmall, hitObject, keyDown);
            }
            else
            {
                spawnStepNote(smallRing, leftSpawnerSmall, hitObject, keyDown);
            }
            break;

        case 2:      // UP
            if (memoryMode || invertedMemoryMode)
            {
                spawnMemoryNote(diamondRing, diamondRing.transform, hitObject, keyUp);
            }
            else if (hitObject.IsMine())
            {
                spawnStepNote(smallMine, rightSpawnerSmall, hitObject, keyUp);
            }
            else
            {
                spawnStepNote(smallRing, rightSpawnerSmall, hitObject, keyUp);
            }
            break;

        case 3:      // RIGHT
            if (memoryMode || invertedMemoryMode)
            {
                spawnMemoryNote(diamondRing, diamondRing.transform, hitObject, keyRight);
            }
            else if (hitObject.IsMine())
            {
                spawnStepNote(bigMine, rightSpawnerBig, hitObject, keyRight);
            }
            else
            {
                spawnStepNote(bigRing, rightSpawnerBig, hitObject, keyRight);
            }
            break;

        default:
            break;
        }
    }