generated from VR-Sexe/Unity3DTemplate
try furniture movement but not working
This commit is contained in:
parent
518e6d2137
commit
002e7278a1
@ -100,13 +100,8 @@ public class Catalog : MonoBehaviour
|
||||
furrnitureBall.transform.localScale *= rescale;
|
||||
furrnitureBall.transform.localPosition = Vector3.down * 0.2f;
|
||||
sphere.SetActive(true);
|
||||
<<<<<<< Updated upstream
|
||||
//hand.GetGrabStarting
|
||||
hand.AttachObject(sphere, GrabTypes.Trigger);
|
||||
=======
|
||||
//hand.GetGrabStarting
|
||||
hand.AttachObject(sphere, GrabTypes.Trigger);
|
||||
>>>>>>> Stashed changes
|
||||
currentSphere = sphere;
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +98,21 @@ public class MovableFurniture : Furniture
|
||||
if (wallMount)
|
||||
{
|
||||
transform.position = position;
|
||||
Bounds objectBounds = GetComponent<Collider>().bounds;
|
||||
// check if object has objectBounds, if not combine the bounds of its children
|
||||
Bounds objectBounds;
|
||||
if (combinedBounds == null)
|
||||
{
|
||||
objectBounds = new Bounds();
|
||||
foreach (Transform child in children)
|
||||
{
|
||||
objectBounds.Encapsulate(child.GetComponent<Renderer>().bounds);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
objectBounds = (Bounds)combinedBounds;
|
||||
}
|
||||
|
||||
Vector3 objectSize = objectBounds.size;
|
||||
offset = new Vector3(objectSize.x / 2, objectSize.y / 2, objectSize.z / 2);
|
||||
Collider[] colliders = Physics.OverlapBox(transform.position + offset, offset, transform.rotation, layerMask);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user