void Start()
    {
        #region RewindVariables
        pointsInTime = new List <PointsInTime> ();
        rb2d         = GetComponent <Rigidbody2D> ();
        #endregion

        scoreScore = 0;
        recordTime = 4f;

        //Coordinates of player-for..
        player = GameObject.Find("Player").GetComponent <Transform> ();

        //Instance of AudioProcessor and reference
        BeatDetectorFinal processor = FindObjectOfType <BeatDetectorFinal> ();

        //processor = beatDetector;

        processor.onBeat.AddListener(onOnbeatDetected);
        //Animator reference
        anim = GetComponent <Animator> ();

        //2D character shadows
        GetComponent <Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
        GetComponent <Renderer>().receiveShadows    = true;
    }
示例#2
0
    //public BeatDetectionFinal procesor;

    void Start()
    {
        //Instance of AudioProcessor and reference
        BeatDetectorFinal processor = FindObjectOfType <BeatDetectorFinal> ();

        //processor = FindObjectOfType<BeatDetectorFinal> ();
        //processor = beatDetector;
        processor.onBeat.AddListener(onOnbeatDetected);
    }