1
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using BigSpace.Logic;
|
||||
using BigSpace.XRCore.Event;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -25,14 +27,14 @@ public class GrabItem : MonoBehaviour
|
||||
float runTime = 0;
|
||||
|
||||
//<2F><>ʱ<EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ֵĶ<D6B5><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>
|
||||
bool isRun2 = false;
|
||||
bool isRun2 = false;
|
||||
float waitTime2 = 1f;
|
||||
float runTime2 = 0;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
m_rig = GetComponent<Rigidbody>();
|
||||
if(effectHideAndShowCtr == null)
|
||||
if (effectHideAndShowCtr == null)
|
||||
effectHideAndShowCtr = GetComponent<EffectHideAndShowCtr>();
|
||||
m_originParent = transform.parent;
|
||||
startPosition = this.transform.localPosition;
|
||||
@@ -43,7 +45,7 @@ public class GrabItem : MonoBehaviour
|
||||
{
|
||||
if (isRun)
|
||||
{
|
||||
|
||||
|
||||
runTime += Time.deltaTime;
|
||||
if (runTime >= waitTime)
|
||||
{
|
||||
@@ -108,11 +110,14 @@ public class GrabItem : MonoBehaviour
|
||||
{
|
||||
if (other.gameObject.CompareTag("RightHand"))
|
||||
{
|
||||
SceneMgr.Instance.isTrigger = true;
|
||||
//Debug.Log("Ent<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"+other.gameObject.name);
|
||||
//if (m_catch == null)
|
||||
m_catch = other.GetComponent<CatchManager>();
|
||||
m_catch = other.GetComponent<CatchManager>();
|
||||
SetTriggerParameter("DisTrigger");
|
||||
// GlobalEventMgr.Dispatch(GameEvent.EventRayEnd2);
|
||||
if (m_catch == null) return;
|
||||
// Debug.Log("111<31>Ƿ<EFBFBD><C7B7><EFBFBD>ʼ:"+ m_catch.Start);
|
||||
// Debug.Log("111<31>Ƿ<EFBFBD><C7B7><EFBFBD>ʼ:"+ m_catch.Start);
|
||||
if (m_catch.Start)
|
||||
{
|
||||
isRun = false;
|
||||
@@ -127,6 +132,15 @@ public class GrabItem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.gameObject.CompareTag("RightHand"))
|
||||
{
|
||||
SceneMgr.Instance.isTrigger = false;
|
||||
//GlobalEventMgr.Dispatch(GameEvent.EventRayEnd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnTriggerStay(Collider other)
|
||||
{
|
||||
@@ -134,8 +148,7 @@ public class GrabItem : MonoBehaviour
|
||||
{
|
||||
//Debug.Log("Stay<61><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"+ other.gameObject.name);
|
||||
//if (m_catch == null)
|
||||
m_catch = other.GetComponent<CatchManager>();
|
||||
SetTriggerParameter("DisTrigger");
|
||||
m_catch = other.GetComponent<CatchManager>();
|
||||
if (m_catch == null) return;
|
||||
//Debug.Log("222<32>Ƿ<EFBFBD><C7B7><EFBFBD>ʼ:" + m_catch.Start);
|
||||
if (m_catch.Start)
|
||||
@@ -162,7 +175,7 @@ public class GrabItem : MonoBehaviour
|
||||
|
||||
private void SetStartPosition()
|
||||
{
|
||||
this.transform.localRotation = new Quaternion(0,0,0,0);
|
||||
this.transform.localRotation = new Quaternion(0, 0, 0, 0);
|
||||
this.transform.localPosition = startPosition;
|
||||
}
|
||||
|
||||
@@ -170,7 +183,7 @@ public class GrabItem : MonoBehaviour
|
||||
{
|
||||
if (this.GetComponent<UpDownMovement>() != null)
|
||||
{
|
||||
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>:"+isMove);
|
||||
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>:" + isMove);
|
||||
this.GetComponent<UpDownMovement>().isMove = isMove;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user