Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        instance = this;
        beatScroller.hasStarted = true;

        music.Play();
    }
Example #2
0
 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;
 }
Example #3
0
    //Установить поведение рыцаря
    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);
    }
Example #4
0
        //Функция вызывается при окончании работы загрузчика уровней
        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);
        }
Example #5
0
 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>();
 }
Example #6
0
	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;
 }
Example #10
0
    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());
    }
Example #12
0
    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;
 }
Example #14
0
 // Use this for initialization
 void Start()
 {
     _RManager  = Object.FindObjectOfType <RhythmManager>();
     IsRManager = isManager();
     BaseSize   = transform.localScale;
 }
Example #15
0
 private void OnDestroy()
 {
     singleton = null;
 }
Example #16
0
 private void Awake()
 {
     singleton               = this;
     secondsPerSixteenth     = 60f / beatsPerMinute / 4f;
     secondsPerEighthTriplet = 60f / beatsPerMinute / 6f;
 }
Example #17
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
 }
Example #18
0
 private void Awake()
 {
     mInstance = this;
 }
Example #19
0
 private void OnDisable()
 {
     RhythmManager.RemoveHandler(rate, OnSubdivision);
 }
Example #20
0
    // TEST
    // private void Update()
    // {
    //     if (Input.GetKeyDown(KeyCode.P))
    //     {
    //         Spawn();
    //     }
    //     else if (Input.GetKeyDown(KeyCode.O))
    //     {
    //         Despawn();
    //     }
    // }

    private void OnEnable()
    {
        RhythmManager.AddHandler(rate, OnSubdivision);
    }
Example #21
0
 private void OnEnable()
 {
     RhythmManager.AddHandler(rate, instrument.PlayNextNote);
 }
Example #22
0
 private void OnDisable()
 {
     RhythmManager.RemoveHandler(rate, instrument.PlayNextNote);
 }
Example #23
0
	// Use this for initialization
	void Start () {
		_RManager = Object.FindObjectOfType<RhythmManager>();
		IsRManager = isManager ();
		BaseSize = transform.localScale;
	}
Example #24
0
 private void OnDestroy()
 {
     _instance = null;
 }