示例#1
0
 private void InitDeadArea()
 {
     dead_area_ = MapUtils.CreateBoxCollider(
         "DeadArea", groundsFolder,
         new MapRect(0, mapData.deadHeight - MapConstants.kWallThickness, mapData.rightmost, MapConstants.kWallThickness),
         false /* is_trigger */);
     dead_area_.GetComponent <Collider2D>().isTrigger = true;
     dead_area_.gameObject.layer = LayerMask.NameToLayer(Consts.kDeadAreaLayer);
     dead_area_.gameObject.AddComponent <DeadArea>();
 }
示例#2
0
 private void InitBoundingColliders()
 {
     MapUtils.CreateBoxCollider(
         "WallLeft", groundsFolder,
         new MapRect(-MapConstants.kWallThickness + mapData.leftmost, -MapConstants.kWallHalfHeight, MapConstants.kWallThickness, MapConstants.kWallHalfHeight << 1),
         false /* is_trigger */);
     MapUtils.CreateBoxCollider(
         "WallRight", groundsFolder,
         new MapRect(mapData.rightmost, -MapConstants.kWallHalfHeight, MapConstants.kWallThickness, MapConstants.kWallHalfHeight << 1),
         false /* is_trigger */);
 }