Пример #1
0
    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);
    }
Пример #3
0
    public override void update(GameObject obj)
    {
        phyObj po = obj.GetComponent <phyObj>();

        unityFire.addItemForce(obj, po.getq() * this.E, this.direction);
    }