21 lines
591 B
C#
21 lines
591 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Cysharp.Threading.Tasks;
|
|
namespace BITKit
|
|
{
|
|
public static class PhysicsHelper
|
|
{
|
|
public static async UniTask AddForceAtPositionAsync(this Rigidbody rigidbody, Vector3 force, Vector3 position,ForceMode forceMode=ForceMode.Force)
|
|
{
|
|
await UniTask.DelayFrame(8);
|
|
try
|
|
{
|
|
rigidbody.AddForceAtPosition(force, position,forceMode);
|
|
}
|
|
catch(MissingReferenceException){}
|
|
|
|
}
|
|
}
|
|
} |