Example #1
0
    public void onPlayerHit()
    {
        //desSound.Play();
        Debug.Log("Destroy" + SongTiming.getSongPositionInBeats());
        player.speed += 100;

        /*
         * while (desSound.isPlaying)
         * {
         *  yield return null;
         * }
         */
//        gameObject.SetActive(false);
        Destroy(gameObject);
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        float   songPosInBeats = SongTiming.getSongPositionInBeats();
        Vector3 despawnPoint   = new Vector3(endpoint.position.x, (endpoint.position.y - spawnpoint.position.y), endpoint.position.z);;

        transform.position = Vector3.Lerp(
            spawnpoint.position,
            despawnPoint,
            ((SongTiming.BeatsShownInAdvance - (beatOfThisNote - songPosInBeats)) / SongTiming.BeatsShownInAdvance) / 2
            );
        if (transform.position == despawnPoint)
        {
            onDespawn();
        }
    }