コード例 #1
0
ファイル: VortexZone.cs プロジェクト: letsrefreshus/Ropey
    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);
    }
コード例 #2
0
ファイル: WindZone.cs プロジェクト: letsrefreshus/Ropey
 public override void onTriggerStay(PlayerStats stats, ControllerGame controllerGame)
 {
     controllerGame.applyForceToPlayer(_force);
 }