public override void update(GameObject obj) { phyObj po = obj.GetComponent <phyObj>(); Vector3 v = unityFire.getItemVelocity(obj); unityFire.addItemForce(obj, B * po.getq() * v.magnitude, calu.normalVector(this.direction, v).normalized); }
protected override void realUpdate(GameObject obj) { Vector3 pos2 = obj.transform.position; Vector3 dir = pos2 - unityFire.getItemPos(thisObj); double r2 = dir.sqrMagnitude; phyObj po = obj.GetComponent <phyObj>(); double F = (k * thisPo.getq() * po.getq()) / r2; unityFire.addItemForce(obj, (float)F, dir.normalized); }
public override void update(GameObject obj) { phyObj po = obj.GetComponent <phyObj>(); unityFire.addItemForce(obj, po.getq() * this.E, this.direction); }