Commit 26968b95 authored by Haobo38's avatar Haobo38
Browse files

update

parent 150800df
Pipeline #97258 failed with stage
in 58 seconds
......@@ -178,6 +178,10 @@ PrefabInstance:
propertyPath: m_Name
value: XR Device Simulator
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187037, guid: 9f5a24a380916d14db9775daab4fe333, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9f5a24a380916d14db9775daab4fe333, type: 3}
--- !u!1 &263875636
......@@ -1934,7 +1938,7 @@ Rigidbody:
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
......@@ -2197,7 +2201,7 @@ MonoBehaviour:
m_Calls: []
m_AttachTransform: {fileID: 0}
m_AttachEaseInTime: 0.15
m_MovementType: 2
m_MovementType: 1
m_VelocityDamping: 1
m_VelocityScale: 1
m_AngularVelocityDamping: 1
......@@ -2399,34 +2403,10 @@ MonoBehaviour:
m_Calls: []
m_SelectEntered:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1045741030}
m_TargetAssemblyTypeName: ImportModels, Assembly-CSharp
m_MethodName: OnSelectEnter
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
m_SelectExited:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1045741030}
m_TargetAssemblyTypeName: ImportModels, Assembly-CSharp
m_MethodName: OnSelectExit
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
m_Activated:
m_PersistentCalls:
m_Calls: []
......@@ -2530,7 +2510,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1045741029}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 4.36, y: 1.09, z: 1.218}
m_LocalPosition: {x: 0.34, y: 1.09, z: -2.486}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
......@@ -3254,8 +3234,8 @@ GameObject:
- component: {fileID: 2345132780432104080}
- component: {fileID: 3747804897657925615}
- component: {fileID: 4417138778209173397}
- component: {fileID: 2931203751676750979}
- component: {fileID: 2919172171029197547}
- component: {fileID: 165052809370277382}
m_Layer: 5
m_Name: Telescope
m_TagString: Untagged
......@@ -3263,6 +3243,19 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &165052809370277382
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 165052809370277381}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f35fcef2cd3dfb4691d9836d5187b37, type: 3}
m_Name:
m_EditorClassIdentifier:
rightHandController: {fileID: 932740382}
--- !u!114 &411040361164753076
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -3410,18 +3403,6 @@ BoxCollider:
serializedVersion: 2
m_Size: {x: 100, y: 100, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &2931203751676750979
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 165052809370277381}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e0e5ed11d3107c04899c13a325faaadf, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!222 &3747804897657925615
CanvasRenderer:
m_ObjectHideFlags: 0
......@@ -3430,18 +3411,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 165052809370277381}
m_CullTransparentMesh: 1
--- !u!114 &3810230262830049182
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4283870120007089596}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e0e5ed11d3107c04899c13a325faaadf, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &4283870118789497828
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -4276,8 +4245,9 @@ GameObject:
- component: {fileID: 4283870120007089599}
- component: {fileID: 4283870120007089593}
- component: {fileID: 4283870120007089598}
- component: {fileID: 3810230262830049182}
- component: {fileID: 2618598991865865046}
- component: {fileID: 4283870120007089597}
- component: {fileID: 4283870120007089600}
m_Layer: 5
m_Name: Astronaut
m_TagString: Untagged
......@@ -4285,6 +4255,19 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &4283870120007089597
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4283870120007089596}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f35fcef2cd3dfb4691d9836d5187b37, type: 3}
m_Name:
m_EditorClassIdentifier:
rightHandController: {fileID: 932740382}
--- !u!114 &4283870120007089598
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -4334,6 +4317,84 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &4283870120007089600
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4283870120007089596}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8a35f6cfbfba9b548aaa00d52cfe8a50, type: 3}
m_Name:
m_EditorClassIdentifier:
m_InteractionManager: {fileID: 1948982936}
m_Colliders: []
m_InteractionLayerMask:
serializedVersion: 2
m_Bits: 4294967295
m_InteractionLayers:
m_Bits: 1
m_SelectMode: 0
m_CustomReticle: {fileID: 0}
m_FirstHoverEntered:
m_PersistentCalls:
m_Calls: []
m_LastHoverExited:
m_PersistentCalls:
m_Calls: []
m_HoverEntered:
m_PersistentCalls:
m_Calls: []
m_HoverExited:
m_PersistentCalls:
m_Calls: []
m_FirstSelectEntered:
m_PersistentCalls:
m_Calls: []
m_LastSelectExited:
m_PersistentCalls:
m_Calls: []
m_SelectEntered:
m_PersistentCalls:
m_Calls: []
m_SelectExited:
m_PersistentCalls:
m_Calls: []
m_Activated:
m_PersistentCalls:
m_Calls: []
m_Deactivated:
m_PersistentCalls:
m_Calls: []
m_OnFirstHoverEntered:
m_PersistentCalls:
m_Calls: []
m_OnLastHoverExited:
m_PersistentCalls:
m_Calls: []
m_OnHoverEntered:
m_PersistentCalls:
m_Calls: []
m_OnHoverExited:
m_PersistentCalls:
m_Calls: []
m_OnSelectEntered:
m_PersistentCalls:
m_Calls: []
m_OnSelectExited:
m_PersistentCalls:
m_Calls: []
m_OnSelectCanceled:
m_PersistentCalls:
m_Calls: []
m_OnActivate:
m_PersistentCalls:
m_Calls: []
m_OnDeactivate:
m_PersistentCalls:
m_Calls: []
--- !u!224 &4283870120030875282
RectTransform:
m_ObjectHideFlags: 0
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.XR.Interaction.Toolkit;
using Dummiesman;
using System.IO;
using UnityEngine.UI;
public class ImportModels : MonoBehaviour
{
[SerializeField] XRBaseController rightHandController = null;
private XRSimpleInteractable m_XRSimpleInteractable = null;
private GameObject loadedObject;
private string m_GOName = null;
private string m_ObjPath = null;
......@@ -25,6 +22,11 @@ public class ImportModels : MonoBehaviour
private void Awake()
{
m_XRSimpleInteractable = GetComponent<XRSimpleInteractable>();
// m_XRSimpleInteractable.selectEntered.AddListener(OnSelectEnter);
m_XRSimpleInteractable.selectEntered.AddListener(delegate { OnSelectEnter(); });
m_XRSimpleInteractable.selectExited.AddListener(delegate { OnSelectExit(); });
m_Joint = rightHandController.transform.GetComponent<FixedJoint>();
m_GOName = transform.name;
......@@ -62,15 +64,14 @@ public class ImportModels : MonoBehaviour
// Setup the model's position right before the righthandcontroller while deciding the position to drop it
loadedObject.transform.GetChild(0).gameObject.AddComponent<Rigidbody>();
loadedObject.transform.position = rightHandController.transform.position + 2*rightHandController.transform.forward;
loadedObject.AddComponent<Rigidbody>();
Rigidbody targetBody = loadedObject.GetComponent<Rigidbody>();
m_Joint.connectedBody = targetBody;
// loadedObject.AddComponent<Rigidbody>();
loadedObject.transform.localScale = new Vector3(1, 1, 1);
loadedObject.transform.GetChild(0).gameObject.AddComponent<zoom>();
loadedObject.transform.GetChild(0).gameObject.GetComponent<zoom>().enabled = false;
// loadedObject.transform.GetChild(0).gameObject.AddComponent<zoom>();
//loadedObject.transform.GetChild(0).gameObject.GetComponent<zoom>().enabled = false;
loadedObject.transform.GetChild(0).gameObject.AddComponent<GOPhysical>();
//loadedObject.transform.GetChild(0).gameObject.tag = "Interactable";
......@@ -85,6 +86,8 @@ public class ImportModels : MonoBehaviour
loadedObject.transform.GetChild(0).gameObject.GetComponent<Rigidbody>().useGravity = false;
Rigidbody targetBody = loadedObject.transform.GetChild(0).GetComponent<Rigidbody>();
m_Joint.connectedBody = targetBody;
loadedObject.transform.GetChild(0).gameObject.GetComponent<MeshCollider>().convex = true;
//loadedObject.transform.localScale = new Vector3(0.05f, 0.05f, 0.05f);
......@@ -112,6 +115,8 @@ public class ImportModels : MonoBehaviour
BoundingBox = (GameObject)Resources.Load("Prefabs/Bounds", typeof(GameObject));
Instantiate(GOAxis, loadedObject.transform);
Instantiate(BoundingBox, loadedObject.transform);
print("select entered");
// GetComponent<Image>().color = new Color32(255, 255, 255, 255);
}
......@@ -123,8 +128,8 @@ public class ImportModels : MonoBehaviour
Rigidbody targetBody = loadedObject.GetComponent<Rigidbody>();
m_Joint.connectedBody = null;
// GetComponent<Image>().color = new Color32(255, 255, 255, 100);
// GetComponent<Image>().color = new Color32(255, 255, 255, 100);
print("select exited");
}
......
......@@ -26,9 +26,10 @@ public class GOPhysical : MonoBehaviour,IPointerDownHandler
}
// Update is called once per frame
void Update()
void FixedUpdate()
{
GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0);
GetComponent<Rigidbody>().angularVelocity = new Vector3(0, 0, 0);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment