Closed BattlehubCode closed 2 years ago
You can use another 'box selection method '. For example, LooseFitting - which will work at the bounding box level. It is not perfect, but at the same time it does not require the read/write enabled parameter to be set to true.
using Battlehub.RTEditor;
using Battlehub.RTHandles;
public class ChangeBoxSelectionMethod : SceneComponentExtension
{
protected override void OnSceneActivated(IRuntimeSceneComponent sceneComponent)
{
base.OnSceneActivated(sceneComponent);
sceneComponent.BoxSelection.Method = BoxSelectionMethod.LooseFitting;
}
}
You will need to update BoxSelection.cs as following:
public BoxSelectionMethod Method
{
get { return m_method; }
set { m_method = value; }
}
To select any object, which is imported from an assetbundle, the mesh must be marked as read/write enabled (only then mesh colliders can be added at runtime). But I dont want to enable read/write as it is consuming huge memory and crashing my webGl app. Anyone knows how to select object without read/write enabled?