private void OnForced(ForceFlow flow) { if (flow.IsNewAdd) { flow.Target.Rigid.velocity = new Vector2(0, 0); } flow.Target.Rigid.AddForce(flow.Direction * flow.Force, ForceMode2D.Impulse); }
private void SyncForceRPC(int targetViewID, float force, Vector2 direction, bool isNewAdd) { var target = PhotonView.Find(targetViewID).gameObject.GetComponent <IOnForced>(); Assert.IsNotNull(target); var flow = new ForceFlow(target, force, direction, isNewAdd); SkillStream.OnNextForce(flow); }
public static void OnNextForce(ForceFlow ForceFlow) { _forceSubject.OnNext(ForceFlow); }