void OnCollisionEnter(Collision collision)
 {
     if (bFrontColliderFlag == true)
     {
         Debug.Log("*** 1 OnCollisionEnter PlayerFrontColliderScript ***");
         hPlayerSidesColliderScript.deactivateSidesCollider(); //dont detect stumbles on death
         hInGameScript.collidedWithObstacle();                 //play the death scene
     }
 }
Пример #2
0
    /*
     *	FUNCTION: Called when player hits an obstacle sideways
     *	CALLED BY: PlayerSidesColliderScript.OnCollisionEnter()
     */
    public void processStumble()
    {
        hCameraController.setCameraShakeImpulseValue(1);
        iLanePosition = iLastLanePosition;              //stop strafe

        if (hEnemyController.processStumble())
        {
            hInGameScript.collidedWithObstacle();            //call death if player stumbled twice in unit time
        }
        else
        {
            aPlayer.PlayQueued("run", QueueMode.CompleteOthers);

            //enable colliders if they were disabled
            hPlayerFrontColliderScript.activateFrontCollider();
            hPlayerSidesColliderScript.activateSidesCollider();
        }
    }