private void CreatePlaceableObject() { if (_tray != null) { _activeObject = Instantiate(Prefab, _tray, false); _activeObject.Initialize(_guideLinePrefab); } }
// object placer public void PlaceObjectWithParams(GameObject prefab, Vector3 clickPoint, Quaternion rot) { Vector3 position = grid.GetNearestPointOnGrid(clickPoint); GameObject go = GameObject.Instantiate(prefab); PlaceableObject bld = go.GetComponent <PlaceableObject>(); bld.gameData = gameData; bld.Initialize(); go.name = bld.name; go.transform.position = position; }