Esempio n. 1
0
 public override void SetDefaultValue()
 {
     base.SetDefaultValue();
     body = target as TankModuleBody;
     body.leftWheelTop  = GameMathf.Round(moduleBounds.center + new Vector3(-moduleBounds.extents.x, -moduleBounds.extents.y, 0));
     body.rightWheelTop = GameMathf.Round(moduleBounds.center + new Vector3(moduleBounds.extents.x, -moduleBounds.extents.y, 0));
     body.raycastPos    = body.anchors.forward;
     body.forwardUp     = new Vector3(body.anchors.forward.x, body.anchors.up.y, body.anchors.forward.z);
     body.backUp        = new Vector3(body.anchors.back.x, body.anchors.up.y, body.anchors.back.z);
 }
Esempio n. 2
0
 /// <summary>
 /// 设置默认值
 /// </summary>
 virtual public void SetDefaultValue()
 {
     module.anchors.center  = GameMathf.Round(moduleBounds.center);
     module.anchors.forward = GameMathf.Round(moduleBounds.center + new Vector3(0, 0, moduleBounds.extents.z));
     module.anchors.back    = GameMathf.Round(moduleBounds.center + new Vector3(0, 0, -moduleBounds.extents.z));
     module.anchors.left    = GameMathf.Round(moduleBounds.center + new Vector3(-moduleBounds.extents.x, 0, 0));
     module.anchors.right   = GameMathf.Round(moduleBounds.center + new Vector3(moduleBounds.extents.x, 0, 0));
     module.anchors.up      = GameMathf.Round(moduleBounds.center + new Vector3(0, moduleBounds.extents.y, 0));
     module.anchors.down    = GameMathf.Round(moduleBounds.center + new Vector3(0, -moduleBounds.extents.y, 0));
 }