Esempio n. 1
0
    void OnCollisionEnter(Collision platform)
    {
        print(previousVy);

        if (rigidbody == null)
        {
            rigidbody = gameObject.GetComponent <Rigidbody> ();
        }


        if (platform.collider.gameObject.layer == 8 && previousVy <= 0)
        {
            height = gameObject.transform.position.y;

            Vector3 newVel = LaunchPlayer();
            platformGenerator.generateNewPlatform(transform, transform.position, newVel, true);
        }
    }