예제 #1
0
    // Use this for initialization
    void Start()
    {
        // Register a listener for any key to start the game
        anyKeyListener = InputEvent.AddListenerAnyKey(PushStart, null);

        // "game" related: Make the sphere wait to be woken (click, touch or key)
        sphere.GetComponent <Rigidbody>().Sleep();

        // create a bouncy physics material
        PhysicMaterial pm = new PhysicMaterial("Bouncy");

        pm.bounceCombine   = PhysicMaterialCombine.Maximum;
        pm.bounciness      = 0.8f;
        pm.staticFriction  = 0.4f;
        pm.dynamicFriction = 0.4f;
        sphere.GetComponent <Collider>().material = pm;
    }