Esempio n. 1
0
    public override void onTriggerStay(PlayerStats stats, ControllerGame controllerGame)
    {
        Vector3 dPosition = gameObject.transform.localPosition - controllerGame.getPlayerPosition();

        float forceToApply = forceAtCenter * (Mathf.Pow(0.5f, dPosition.magnitude / forceHalflife));
        //Debug.Log("Force to apply : " + forceToApply);

        dPosition.Normalize();
        dPosition *= forceToApply;

        controllerGame.applyForceToPlayer(dPosition);
    }
Esempio n. 2
0
 public override void onTriggerStay(PlayerStats stats, ControllerGame controllerGame)
 {
     controllerGame.applyForceToPlayer(_force);
 }