// Start is called before the first frame update void Start() { instance = this; beatScroller.hasStarted = true; music.Play(); }
public void setupBeat(Sprite sprite, float speedToMove, InputType inputType, RhythmManager rhythmManager) { this.inputType = inputType; this.GetComponent <SpriteRenderer>().sprite = sprite; this.GetComponent <Rigidbody2D>().velocity = new Vector2(-speedToMove, 0f); rm = rhythmManager; }
//Установить поведение рыцаря public void SetKnightBehaviour(int health, SwordData swordData, int combometerNeededPoints) { foreach (GameObject sword in swords) { sword.SetActive(false); } if (gameManager == null) { gameManager = GameManager.instance; } if (rhythmManager == null) { rhythmManager = RhythmManager.instance; } if (attackMenu == null) { attackMenu = AttackMenu.instance; } currentHealth = health; defaultHealth = health; GameObject currentSword = swords[swordData.id]; currentSword.SetActive(true); combometer = currentSword.transform.Find("Knight Combometer").GetComponent <KnightCombometer>(); combometer.StartCombometer(combometerNeededPoints); }
//Функция вызывается при окончании работы загрузчика уровней public bool StartManager() { if (rhythmManager == null) { rhythmManager = RhythmManager.instance; } if (attackMenu == null) { attackMenu = AttackMenu.instance; } if (pauseMenu == null) { pauseMenu = MenuManager.instance; } if (knightHealthbar != null) //Если здороровье включено { healthbar = knightHealthbar.GetComponent <KnightHealth>(); //получить ссылку на скрипт здоровья } if (progress != null) //если прогресс включен { progress_bar = progress.GetComponent <ProgressBar>(); //получить ссылку на скрипт слайдер прогресса } audioSource = gameObject.GetComponent <AudioSource>(); //получить audioSource isLoaded = true; return(isLoaded); }
void Awake() { runManager = FindObjectOfType <RunManager>(); rhythmManager = FindObjectOfType <RhythmManager>(); hitArea = GameObject.FindWithTag("HitArea").transform; icon = transform.Find("Icon").GetComponent <SpriteRenderer>(); arrow = transform.Find("Arrow").GetComponent <SpriteRenderer>(); xMark = transform.Find("XMark").GetComponent <SpriteRenderer>(); }
void Awake() { rm = this; beatObserver = GetComponent<BeatObserver>(); normalColor = normalRing.GetComponent<Image>().color; rhythmCallbackList = new Dictionary<int, RhythmCallback>(); origTouchText = touchText; origOnthebeatText = onthebeatText; origBoostImage = boostImage; origRhythmRings = rhythmRings; }
private void Start() { if (GameObject.FindGameObjectWithTag("Rhythm Manager") != null) { rManager = GameObject.FindGameObjectWithTag("Rhythm Manager").GetComponent <RhythmManager>(); } drums.Add(drumRed.name, "Red"); drums.Add(drumGreen.name, "Green"); drums.Add(drumBlue.name, "Blue"); drums.Add(drumYellow.name, "Yellow"); }
// Use this for initialization void Awake() { instance = this; mNotesToSpawn['R'] = new Queue <NoteDataObject>(); mNotesToSpawn['G'] = new Queue <NoteDataObject>(); mNotesToSpawn['Y'] = new Queue <NoteDataObject>(); mSpawnedNotes['R'] = new Queue <GameObject>(); mSpawnedNotes['G'] = new Queue <GameObject>(); mSpawnedNotes['Y'] = new Queue <GameObject>(); }
//Функция срабатывает в первый фрейм сцены private void Start() { if (spriteRenderer == null) { gameObject.GetComponent <SpriteRenderer>(); } if (gameManager == null) { gameManager = GameManager.instance; } if (rhythmManager == null) { rhythmManager = RhythmManager.instance; } if (pointAnimator == null) { gameObject.GetComponent <Animator>(); } RhytmEvent.instance.ONRhytmButtonPress += OnButtonPress; }
void Awake() { if (_instance != null) { Destroy(gameObject); } _instance = this; _songProfiler = GetComponent <SongProfiler>(); spawnY = spawn.transform.position.y; targetY = target.transform.position.y; killY = kill.transform.position.y; jumpY = jump.transform.position.y; playerOne = PlayerMovement.Player1; playerTwo = PlayerMovement.Player2; // Get info about the note spawn/target spawnToTargetDistance = Mathf.Abs(targetY - spawnY); spawnToKillDistance = Mathf.Abs(killY - spawnY); spawnToJumpDistance = Mathf.Abs(jumpY - spawnY); }
public void StartPointSpawner(LocationData locationData, RhythmManager rhythmManager, GameManager gameManager) { levelIsStarted = false; pointSprite = locationData.pointSprite; bpm = locationData.beatTempos; timeStamps = locationData.timestamps; musicClip = locationData.audioClip; musicDelay = gameManager.musicDelay; PointBehaviour.beat_tempo = bpm[0]; PointBehaviour.end_point = endLine; audioLenght = musicClip.length; audioSource.Stop(); audioSource.clip = musicClip; musicAudioSource.Stop(); musicAudioSource.clip = musicClip; audioSource.Play(); StartCoroutine(StartMusic()); }
public void Start() { Scene scene = SceneManager.GetActiveScene(); sceneName = scene.name; playerRigid = GetComponent <Rigidbody2D>(); scrAnimations = GetComponent <CharacterMoveTransitions>(); if (rManager != null) { rManager = GameObject.FindGameObjectWithTag("Rhythm Manager").GetComponent <RhythmManager>(); } isPunching = false; if (sPunch == null) { Debug.LogError("| MISSING GAME OBJECT | | Player " + playerNumber + " | | PlayerMovement | | S Punch |"); } if (sRotate == null) { Debug.LogError("| MISSING GAME OBJECT | | Player " + playerNumber + " | | PlayerMovement | | S Rotate |"); } }
// Initialization void Awake() { // get reference to gameManager gameManager = Object.FindObjectOfType <GameManager>(); thoughtMenu = Object.FindObjectOfType <ThoughtMenu>(); tutorialManager = Object.FindObjectOfType <TutorialManager>(); // if no gameManager, load preload scene first if (gameManager == null) { SceneManager.LoadScene(0); return; } // get reference to playerController and rhythmManager player = Object.FindObjectOfType <PlayerController>(); rhythmManager = Object.FindObjectOfType <RhythmManager>(); // get initial runState based on profile runState = new RunState( gameManager.profile.GetInitialEnergy(), gameManager.profile.energyCap, new EmotionState(gameManager.profile.initialEmotions), gameManager.profile.bedTime ); Time.timeScale = 1; }
// Use this for initialization void Start() { _RManager = Object.FindObjectOfType <RhythmManager>(); IsRManager = isManager(); BaseSize = transform.localScale; }
private void OnDestroy() { singleton = null; }
private void Awake() { singleton = this; secondsPerSixteenth = 60f / beatsPerMinute / 4f; secondsPerEighthTriplet = 60f / beatsPerMinute / 6f; }
// Start is called before the first frame update void Start() { instance = this; }
private void Awake() { mInstance = this; }
private void OnDisable() { RhythmManager.RemoveHandler(rate, OnSubdivision); }
// TEST // private void Update() // { // if (Input.GetKeyDown(KeyCode.P)) // { // Spawn(); // } // else if (Input.GetKeyDown(KeyCode.O)) // { // Despawn(); // } // } private void OnEnable() { RhythmManager.AddHandler(rate, OnSubdivision); }
private void OnEnable() { RhythmManager.AddHandler(rate, instrument.PlayNextNote); }
private void OnDisable() { RhythmManager.RemoveHandler(rate, instrument.PlayNextNote); }
// Use this for initialization void Start () { _RManager = Object.FindObjectOfType<RhythmManager>(); IsRManager = isManager (); BaseSize = transform.localScale; }
private void OnDestroy() { _instance = null; }