public void SetPosition(Vector3d pos) { if (_physics == null) { if (Target != null) { Target.transform.Position = pos; } return; } _physics.SetPosition(pos); }
//either transform or physics public void SetPosition(Vector3d p) { MPhysicsObject po = (MPhysicsObject)FindModuleByType(EType.PhysicsObject); if (po != null) { po.SetPosition(p); } else { transform.Position = p; } }
//either transform or physics public void SetPosition(Vector3d p) { //a phyics module may be added at any time, so we need to query for it MPhysicsObject po = GetPhysics(); if (po != null) { po.SetPosition(p); } else { transform.Position = p; } }