Easy Build System
Asset StoreSupportTwitterDiscord
  • Introduction
  • Getting Started
    • Getting Started
    • Common Issues
  • Tutorials
    • Beginners Guides
      • Modular Building Guide
      • Upgrading Guide
    • Advanced Guides
  • Components
    • Building Area
    • Building Group
    • Building Manager
      • Building Collection
      • Building Saver
    • Building Part
      • Building Conditions
    • Building Placer
      • Editor Building Placer
    • Building Socket
    • Building Linkable Surface
  • Integrations
    • Game Creator 2
      • Game Creator 2 - Inventory
    • Game Kit Controller
    • PlayMaker
    • PUN 2
    • Mirror
    • Fish-Net
    • RPG Builder
    • uSurvival
    • Rewired
  • Supports
    • XR Interaction Toolkit Support
  • Addons
    • Advanced Buildings
    • Buggy Constructor
    • Circular Building Menu
    • House Buildings
    • Survival Buildings
  • Annex
    • Compatibility
    • Refund Policy
Powered by GitBook
On this page

Was this helpful?

  1. Components

Building Placer

You can find all the information about Building Placer here.

PreviousBuilding ConditionsNextEditor Building Placer

Last updated 1 year ago

Was this helpful?

Manages all aspects of building modes (Placement, Destruction, Edition).

Include three Build Modes

  • Placement Mode allows you to preview a to place it.

  • Destruction Mode allows you to preview a already placed to destroy it.

  • Edition Mode allows you to preview a already placed to move it elsewhere.

A Input Handler component is required to know which actions to trigger according to user inputs.

By default the system uses the Standalone Input Handler to handle user inputs. It allows you to manage the selection of build modes and of different available in the of the scene. You can change the Action's key for each action directly in the inspector. This works also with the new Unity Input System.

If you want to use the system for Android platforms. You can use the Android Input Handler.

On platforms which require a gamepad. You can use the Gamepad Input Handler. You will need to use the new Unity Input System and import the support .

This component must be attached to a camera with the tag "Main Camera". In the Raycast Settings section, you can choose the type of view according to your game view.

FIRST_PERSON_VIEW Cast a ray from the camera to forward direction.

Expand the image to large view by clicking on it.

THIRD_PERSON_VIEW Cast a ray from the character to forward direction.

TOP_DOWN_VIEW Cast a ray from the camera to world mouse position.


API

You can access this class by including the following namespace:

using EasyBuildSystem.Features.Runtime.Buildings.Placer;

This class inherits from Singleton class and can be called like this:

BuildingPlacer.Instance

Here is a list of all the events and methods of this component that can be called:

Events

/// <summary>
/// Event that is triggered when the build mode is changed.
/// </summary>
BuildingPlacer.Instance.OnChangedBuildModeEvent.AddListener((BuildMode mode) => { });

/// <summary>
/// Event that is triggered when the Building Part selection is changed.
/// </summary>
BuildingPlacer.Instance.OnChangedBuildingPartEvent.AddListener((BuildingPart part) => { });

Methods

/// <summary>
/// Get the target Building Part based on the closest overlap sphere hit.
/// </summary>
/// <returns>The target Building Part if found, null otherwise.</returns>
BuildingPart targetPart = BuildingPlacer.Instance.GetTargetBuildingPart();

/// <summary>
/// Rotate the current preview.
/// </summary>
/// <param name="reverse">Whether to rotate the preview in reverse direction.</param>
BuildingPlacer.Instance.RotatePreview(bool reverse);

/// <summary>
/// Select a specific Building Part.
/// </summary>
/// <param name="part">The Building Part to select.</param>
BuildingPlacer.Instance.SelectBuildingPart(BuildingPart part);

/// <summary>
/// Change the build mode.
/// </summary>
/// <param name="mode">The new build mode.</param>
/// <param name="clearPreview">Whether to clear the current preview or not.</param>
BuildingPlacer.Instance.ChangeBuildMode(BuildMode mode);

All of the methods related to this component can be found in the file "BuildingPlacer.cs". If you have any specific questions about the API, feel free to contact us.

Expand the image to large view by clicking on it.
Expand the image to large view by clicking on it.

Explore fields description in the Inspector by hovering your cursor over them. You can find more information about this here: .

Tooltip Attribute
Building Part
Building Part
Building Part
Building Parts
Building Manager
here