예제 #1
0
    // Use this for initialization
    void Start()
    {
        // Get Reference to Init Script
        //StartCoroutine(BuildUp());
        noteBoard = GameObject.Find("NoteBoard").GetComponent <NoteBoard>();

        tavern = GameObject.Find("Tavern").GetComponent <taverne>();
        tavern.Subscribe(this);

        col = GameObject.Find("Collision").GetComponent <Collision>();
        col.Subscribe(this);

        init = GameObject.Find("Init").GetComponent <Init>();
        init.Subscribe(this);

        // null
        keyPressed = 0;

        notes        = noteBoard.notes;
        mode         = 0;
        jumping      = null;
        usingGuitar  = false;
        handsInit    = false;
        allowPlaying = false;

        steps = new AudioClip[3];

        // Audio from Asset Store -> Universal Sound FX by imphenzia
        walking        = gameObject.AddComponent <AudioSource>();
        steps[0]       = Resources.Load <AudioClip>("Universal Sound FX/HUMAN/Footsteps/Leather_Wood_Hollow_Jog/FOOTSTEP_Leather_Wood_Hollow_Jog_RR3_mono");
        steps[1]       = Resources.Load <AudioClip>("Universal Sound FX/HUMAN/Footsteps/Leather_Wood_Hollow_Jog/FOOTSTEP_Leather_Wood_Hollow_Jog_RR5_mono");
        steps[2]       = Resources.Load <AudioClip>("Universal Sound FX/HUMAN/Footsteps/Leather_Wood_Hollow_Jog/FOOTSTEP_Leather_Wood_Hollow_Jog_RR6_mono");
        walking.volume = 0.40f;
    }
예제 #2
0
파일: Note.cs 프로젝트: jqblz/beatdown
    public void Initialize(RhythmController c, NoteBoard n, double b, NoteType t)
    {
        renderer     = GetComponent <SpriteRenderer>();
        rhythm       = c;
        noteBoard    = n;
        beat         = b;
        type         = t;
        visualOffset = n.visualOffset;

        renderer.sprite    = DoubleIsInteger(beat) ? quarterSprite : eighthSprite;
        renderer.color     = new Color(1, 1, 1, 0.5f); // half transparency
        transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 90 * (int)type));
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        //StartCoroutine(WaitForStage());
        taverne = GameObject.Find("Tavern").GetComponent <taverne>();
        taverne.Subscribe(this);

        init = GameObject.Find("Init").GetComponent <Init>();
        init.Subscribe(this);

        noteBoard = GameObject.Find("NoteBoard").GetComponent <NoteBoard>();
        noteBoard.Subscribe(this);

        control = GameObject.Find("Control").GetComponent <Control>();
        control.Subscribe(this);
    }
예제 #4
0
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("InputHandler Start() was called");
        noteBoard   = GetComponent <NoteBoard>();
        chordBuffer = InputChord.None;
        rhythmController.AddSubBeatCallback(OnSubBeat);
        rhythmController.AddOnPlayCallback(OnPlay);
        inputs = new List <InputChord>();
        notes  = new Queue <NoteData>(rhythmController.GetAllNotes());

        currentNotes     = new List <NoteData>();
        totalTimingGap   = 0;
        singleInputCount = 0;
        command          = new Command();
    }
예제 #5
0
    void Start()
    {
        control = GameObject.Find("Control").GetComponent <Control>();

        tavern = GameObject.Find("Tavern").GetComponent <taverne>();
        tavern.Subscribe(this);

        board = GameObject.Find("NoteBoard").GetComponent <NoteBoard>();

        //StartCoroutine(WaitForTavern());

        // Audio from Asset Store -> Universal Sound FX by imphenzia
        start        = gameObject.AddComponent <AudioSource>();
        start.clip   = Resources.Load <AudioClip>("Universal Sound FX/Voices/Exclamations/EXCLAMATION_Male_B_Horray_01_mono");
        start.volume = 0.2f;

        mode = control.GetMode();
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        NoteBoard = GameObject.Find("NoteBoard").GetComponent <NoteBoard>();
        NoteBoard.Subscribe(this);

        Taverne = GameObject.Find("Tavern").GetComponent <taverne>();
        Taverne.Subscribe(this);

        mpty        = new GameObject();
        empty       = new GameObject[] { mpty };
        tavernReady = false;
        //creating Audience
        //StartCoroutine(WaitForTavern());

        //audio stuff
        prevJam         = 0;
        differentVoices = new AudioClip[4];
        badPlayed       = false;
        goodPlayed      = false;
        greatPlayed     = false;

        // Audio from Asset Store -> Universal Sound FX by imphenzia
        voices = gameObject.AddComponent <AudioSource>();
        // Bad
        differentVoices[0] = Resources.Load <AudioClip>("Universal Sound FX/AUDIENCES/Medieval_Jousting_Tournament/AUDIENCE_Bhoos_01_stereo");
        // Good
        differentVoices[1] = Resources.Load <AudioClip>("Universal Sound FX/AUDIENCES/Medieval_Jousting_Tournament/AUDIENCE_Claps_and_Cheers_02_stereo");
        // Great
        differentVoices[2] = Resources.Load <AudioClip>("Universal Sound FX/AUDIENCES/Medieval_Jousting_Tournament/AUDIENCE_Claps_and_Cheers_05_stereo");
        // Great to Good
        differentVoices[3] = Resources.Load <AudioClip>("Universal Sound FX/AUDIENCES/Medieval_Jousting_Tournament/AUDIENCE_Claps_and_Bhoos_01_stereo");
        voices.volume      = 0.30f;

        //inital grades
        great = 0;
        good  = 0;
        bad   = 0;

        //measure jam after each beat
        //StartCoroutine(WaitForNoteBoard());
    }
예제 #7
0
 // Use this for initialization
 void Start()
 {
     nb = GameObject.Find("NoteBoard").GetComponent <NoteBoard>();
     nb.Subscribe(this);
 }