Esempio n. 1
0
        internal void Init(PluginConfig pluginConfig,
                           NoteAssetLoader noteAssetLoader,
                           [Inject(Id = "cn.left.arrow")] SiraPrefabContainer.Pool leftArrowNotePool,
                           [Inject(Id = "cn.right.arrow")] SiraPrefabContainer.Pool rightArrowNotePool,
                           [InjectOptional(Id = "cn.left.dot")] SiraPrefabContainer.Pool leftDotNotePool,
                           [InjectOptional(Id = "cn.right.dot")] SiraPrefabContainer.Pool rightDotNotePool)
        {
            _pluginConfig       = pluginConfig;
            _leftArrowNotePool  = leftArrowNotePool;
            _rightArrowNotePool = rightArrowNotePool;

            _leftDotNotePool  = leftDotNotePool ?? _leftArrowNotePool;
            _rightDotNotePool = rightDotNotePool ?? _rightArrowNotePool;

            _customNote = noteAssetLoader.CustomNoteObjects[noteAssetLoader.SelectedNote];

            _gameNoteController         = GetComponent <GameNoteController>();
            _customNoteColorNoteVisuals = gameObject.AddComponent <CustomNoteColorNoteVisuals>();

            _gameNoteController.noteWasCutEvent      += WasCut;
            _gameNoteController.noteWasMissedEvent   += DidFinish;
            _gameNoteController.didInitEvent         += Controller_DidInit;
            _customNoteColorNoteVisuals.didInitEvent += Visuals_DidInit;

            noteCube = _gameNoteController.gameObject.transform.Find("NoteCube");

            MeshRenderer noteMesh = GetComponentInChildren <MeshRenderer>();

            noteMesh.forceRenderingOff = true;
        }
 internal CustomNoteManager([InjectOptional] Submission submission, NoteAssetLoader noteAssetLoader, IDifficultyBeatmap difficultyBeatmap, GameplayCoreSceneSetupData gameplayCoreSceneSetupData)
 {
     _submission                 = submission;
     _noteAssetLoader            = noteAssetLoader;
     _difficultyBeatmap          = difficultyBeatmap;
     _gameplayCoreSceneSetupData = gameplayCoreSceneSetupData;
 }
 internal CustomNoteManager([InjectOptional] Submission submission, NoteAssetLoader noteAssetLoader, GameplayCoreSceneSetupData gameplayCoreSceneSetupData, PluginConfig pluginConfig, IDifficultyBeatmap level)
 {
     _submission                 = submission;
     _noteAssetLoader            = noteAssetLoader;
     _gameplayCoreSceneSetupData = gameplayCoreSceneSetupData;
     _pluginConfig               = pluginConfig;
     _level = level;
 }
Esempio n. 4
0
        internal void Init(PluginConfig pluginConfig, NoteAssetLoader noteAssetLoader, [Inject(Id = "cn.bomb")] SiraPrefabContainer.Pool bombContainerPool)
        {
            _pluginConfig = pluginConfig;

            _customNote         = noteAssetLoader.CustomNoteObjects[noteAssetLoader.SelectedNote];
            _bombNoteController = GetComponent <BombNoteController>();
            _noteMovement       = GetComponent <NoteMovement>();
            _bombNoteController.didInitEvent     += Controller_Init;
            _noteMovement.noteDidFinishJumpEvent += DidFinish;
            bombMesh = gameObject.transform.Find("Mesh");
            bombPool = bombContainerPool;

            MeshRenderer bm = GetComponentInChildren <MeshRenderer>();

            bm.enabled = false;
        }
        internal void Init(PluginConfig pluginConfig, NoteAssetLoader noteAssetLoader, [InjectOptional(Id = "cn.bomb")] SiraPrefabContainer.Pool bombContainerPool)
        {
            _pluginConfig = pluginConfig;

            _customNote = noteAssetLoader.CustomNoteObjects[noteAssetLoader.SelectedNote];
            bombPool    = bombContainerPool;

            _bombNoteController = GetComponent <BombNoteController>();
            _noteMovement       = GetComponent <NoteMovement>();

            if (bombPool != null)
            {
                _bombNoteController.didInitEvent.Add(this);
                _noteMovement.noteDidFinishJumpEvent += DidFinish;
            }

            bombMesh = gameObject.transform.Find("Mesh");


            MeshRenderer bm = GetComponentInChildren <MeshRenderer>();

            if ((_pluginConfig.HMDOnly || LayerUtils.HMDOverride))
            {
                if (bombPool == null)
                {
                    // create fake bombs for Custom Notes without Custom Bombs
                    fakeFirstPersonBombMesh                  = UnityEngine.Object.Instantiate(bombMesh.gameObject);
                    fakeFirstPersonBombMesh.name             = "FakeFirstPersonBomb";
                    fakeFirstPersonBombMesh.transform.parent = bombMesh;

                    fakeFirstPersonBombMesh.transform.localScale    = Vector3.one;
                    fakeFirstPersonBombMesh.transform.localPosition = Vector3.zero;
                    fakeFirstPersonBombMesh.transform.rotation      = Quaternion.identity;
                    fakeFirstPersonBombMesh.layer = (int)LayerUtils.NoteLayer.FirstPerson;
                }
            }
            else if (bombPool != null)
            {
                bm.enabled = false;
            }
        }
        internal void Init(PluginConfig pluginConfig,
                           NoteAssetLoader noteAssetLoader,
                           [Inject(Id = "cn.left.arrow")] SiraPrefabContainer.Pool leftArrowNotePool,
                           [Inject(Id = "cn.right.arrow")] SiraPrefabContainer.Pool rightArrowNotePool,
                           [InjectOptional(Id = "cn.left.dot")] SiraPrefabContainer.Pool leftDotNotePool,
                           [InjectOptional(Id = "cn.right.dot")] SiraPrefabContainer.Pool rightDotNotePool)
        {
            _pluginConfig       = pluginConfig;
            _leftArrowNotePool  = leftArrowNotePool;
            _rightArrowNotePool = rightArrowNotePool;

            _leftDotNotePool  = leftDotNotePool ?? _leftArrowNotePool;
            _rightDotNotePool = rightDotNotePool ?? _rightArrowNotePool;

            _customNote = noteAssetLoader.CustomNoteObjects[noteAssetLoader.SelectedNote];

            _gameNoteController         = GetComponent <GameNoteController>();
            _customNoteColorNoteVisuals = gameObject.AddComponent <CustomNoteColorNoteVisuals>();

            _gameNoteController.didInitEvent.Add(this);
            _gameNoteController.noteWasMissedEvent.Add(this);
            _gameNoteController.noteWasCutEvent.Add(this);
            _customNoteColorNoteVisuals.didInitEvent += Visuals_DidInit;

            noteCube = _gameNoteController.gameObject.transform.Find("NoteCube");

            MeshRenderer noteMesh = GetComponentInChildren <MeshRenderer>();

            if (_pluginConfig.HMDOnly == false && LayerUtils.HMDOverride == false)
            {
                // only disable if custom notes display on both hmd and display
                noteMesh.forceRenderingOff = true;
            }
            else
            {
                noteMesh.gameObject.layer = (int)LayerUtils.NoteLayer.ThirdPerson;
            }
        }
Esempio n. 7
0
 internal CustomNoteManager([InjectOptional] Submission submission, NoteAssetLoader noteAssetLoader, GameplayCoreSceneSetupData gameplayCoreSceneSetupData)
 {
     _submission                 = submission;
     _noteAssetLoader            = noteAssetLoader;
     _gameplayCoreSceneSetupData = gameplayCoreSceneSetupData;
 }