1
This commit is contained in:
@@ -4,9 +4,9 @@ using UnityEngine;
|
||||
|
||||
public class GrabItem : MonoBehaviour
|
||||
{
|
||||
public bool restIsBack = false; //<2F>ſ<EFBFBD><C5BF><EFBFBD><EFBFBD>Ƿ<C7B7>ԭλ<D4AD><CEBB>
|
||||
public bool isUseRigidbody = false; //<2F>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
private Vector3 startPosition = Vector3.zero; //<2F><>ʼλ<CABC><CEBB>
|
||||
public bool restIsBack = false; //<2F>ſ<EFBFBD><C5BF><EFBFBD><EFBFBD>Ƿ<C7B7>ԭλ<D4AD><CEBB>
|
||||
public bool isUseRigidbody = false; //<2F>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
private Vector3 startPosition = Vector3.zero; //<2F><>ʼλ<CABC><CEBB>
|
||||
public bool startIsUseRigid = true;
|
||||
private Rigidbody m_rig;
|
||||
public Transform m_originParent;
|
||||
@@ -19,12 +19,12 @@ public class GrabItem : MonoBehaviour
|
||||
|
||||
public EffectHideAndShowCtr effectHideAndShowCtr;
|
||||
|
||||
//<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
||||
//<2F><>ʱ<EFBFBD><CAB1><EFBFBD>
|
||||
bool isRun = false;
|
||||
float waitTime = 2f;
|
||||
float runTime = 0;
|
||||
|
||||
//<2F><>ʱ<EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ֵĶ<D6B5><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>
|
||||
//<2F><>ʱ<EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ֵĶ<D6B5><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>
|
||||
bool isRun2 = false;
|
||||
float waitTime2 = 1f;
|
||||
float runTime2 = 0;
|
||||
@@ -47,7 +47,7 @@ public class GrabItem : MonoBehaviour
|
||||
runTime += Time.deltaTime;
|
||||
if (runTime >= waitTime)
|
||||
{
|
||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
||||
isRun = false;
|
||||
runTime = 0;
|
||||
HideObj();
|
||||
@@ -108,12 +108,13 @@ public class GrabItem : MonoBehaviour
|
||||
{
|
||||
if (other.gameObject.CompareTag("RightHand"))
|
||||
{
|
||||
//Debug.Log("Ent<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"+other.gameObject.name);
|
||||
//Debug.Log("Ent<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"+other.gameObject.name);
|
||||
SetTriggerParameter("DisTrigger");
|
||||
SceneMgr.Instance.isTrigger=true;
|
||||
//if (m_catch == null)
|
||||
m_catch = other.GetComponent<CatchManager>();
|
||||
SetTriggerParameter("DisTrigger");
|
||||
if (m_catch == null) return;
|
||||
// Debug.Log("111<31>Ƿ<EFBFBD><EFBFBD><EFBFBD>ʼ:"+ m_catch.Start);
|
||||
// Debug.Log("111<31>Ƿ<EFBFBD>ʼ:"+ m_catch.Start);
|
||||
if (m_catch.Start)
|
||||
{
|
||||
isRun = false;
|
||||
@@ -128,17 +129,24 @@ public class GrabItem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.gameObject.CompareTag("RightHand"))
|
||||
{
|
||||
|
||||
SceneMgr.Instance.isTrigger = false;
|
||||
|
||||
}
|
||||
}
|
||||
private void OnTriggerStay(Collider other)
|
||||
{
|
||||
if (other.gameObject.CompareTag("RightHand"))
|
||||
{
|
||||
//Debug.Log("Stay<61><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"+ other.gameObject.name);
|
||||
//if (m_catch == null)
|
||||
m_catch = other.GetComponent<CatchManager>();
|
||||
//Debug.Log("Stay<61><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"+ other.gameObject.name);
|
||||
m_catch = other.GetComponent<CatchManager>();
|
||||
|
||||
if (m_catch == null) return;
|
||||
//Debug.Log("222<32>Ƿ<EFBFBD><EFBFBD><EFBFBD>ʼ:" + m_catch.Start);
|
||||
//Debug.Log("222<32>Ƿ<EFBFBD>ʼ:" + m_catch.Start);
|
||||
if (m_catch.Start)
|
||||
{
|
||||
isRun = false;
|
||||
@@ -171,18 +179,19 @@ 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;
|
||||
}
|
||||
}
|
||||
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
[SerializeField] private GameObject childAnimator; // ֱ<><D6B1><EFBFBD>϶<EFBFBD><CFB6><EFBFBD><EFBFBD><EFBFBD>
|
||||
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
[SerializeField] private GameObject childAnimator; // ֱ<><D6B1><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>
|
||||
|
||||
public void SetTriggerParameter(string parameterName)
|
||||
{
|
||||
if (childAnimator != null)
|
||||
{
|
||||
Destroy(childAnimator);
|
||||
childAnimator = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,11 +100,11 @@ public class LeavePlayAreaControll : MonoBehaviour
|
||||
|
||||
private void GameDataManage_EventCheckBoxCollider(int index)
|
||||
{
|
||||
Debug.Log("自动检测位置:" + index);
|
||||
//Debug.Log("自动检测位置:" + index);
|
||||
//if (this.gameObject.active && index == myId)
|
||||
if (index == myId)
|
||||
{
|
||||
Debug.Log("进来了.....");
|
||||
//Debug.Log("进来了.....");
|
||||
isCheck = true;
|
||||
StartCoroutine(CheckIsEnter(index));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PlayJiaGuAnimator : MonoBehaviour
|
||||
public AudioSource audio_HuiDa;
|
||||
public GameObject audio_Wen;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾʱ<CABE><CAB1>
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾʱ<CABE><CAB1>
|
||||
bool oneIsRun = false;
|
||||
float oneWaitTime = 26f;
|
||||
float oneRunTime = 0;
|
||||
@@ -40,7 +40,7 @@ public class PlayJiaGuAnimator : MonoBehaviour
|
||||
{
|
||||
oneIsRun = false;
|
||||
oneRunTime = 0;
|
||||
if (font != null) //<2F><>ʾ<EFBFBD><CABE>
|
||||
if (font != null) //<2F><>ʾ<EFBFBD><CABE>
|
||||
font.PlayShowJGWFont();
|
||||
if (animatorJiaGu != null)
|
||||
animatorJiaGu.SetActive(false);
|
||||
@@ -49,14 +49,15 @@ public class PlayJiaGuAnimator : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
[SerializeField] private List<GameObject> childAnimator; // ֱ<><D6B1><EFBFBD>϶<EFBFBD><CFB6><EFBFBD><EFBFBD><EFBFBD>
|
||||
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
[SerializeField] private List<GameObject> childAnimator; // ֱ<><D6B1><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>
|
||||
|
||||
public void SetTriggerParameter(string parameterName)
|
||||
{
|
||||
for (int i = 0; i < childAnimator.Count; i++)
|
||||
{
|
||||
Destroy(childAnimator[i]);
|
||||
childAnimator[i] = null;
|
||||
}
|
||||
}
|
||||
private void OnTriggerEnter(Collider other)
|
||||
@@ -66,6 +67,7 @@ public class PlayJiaGuAnimator : MonoBehaviour
|
||||
if (listAnimator != null)
|
||||
{
|
||||
SetTriggerParameter("DisTrigger");
|
||||
SceneMgr.Instance.isTrigger=true;
|
||||
for (int i = 0; i < listAnimator.Count; i++)
|
||||
{
|
||||
if (HandType == 1)
|
||||
@@ -80,7 +82,7 @@ public class PlayJiaGuAnimator : MonoBehaviour
|
||||
}
|
||||
}
|
||||
oneIsRun = true;
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventHideTuchJiaGu); //ֻ<><D6BB><EFBFBD><EFBFBD>һ<EFBFBD>Σ<EFBFBD><CEA3>ر<EFBFBD><D8B1><EFBFBD><EFBFBD>еĿɴ<C4BF><C9B4><EFBFBD><EFBFBD><EFBFBD><D7B9><EFBFBD>ײ
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventHideTuchJiaGu); //ֻ<><D6BB><EFBFBD><EFBFBD>һ<EFBFBD>Σ<EFBFBD><CEA3>ر<EFBFBD><D8B1><EFBFBD><EFBFBD>еĿɴ<C4BF><C9B4><EFBFBD><EFBFBD><EFBFBD><D7B9><EFBFBD>ײ
|
||||
if (audio_HuiDa != null)
|
||||
{
|
||||
audio_HuiDa.Play();
|
||||
|
||||
@@ -8,14 +8,14 @@ public class TouchPlayAnimatior : MonoBehaviour
|
||||
public GrabItem grabItem;
|
||||
Animator animator;
|
||||
AudioSource audioSource;
|
||||
//clips<70><73><EFBFBD><EFBFBD>
|
||||
//clips<70><73><EFBFBD><EFBFBD>
|
||||
public AudioClip[] audioClips;
|
||||
//<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
||||
//<2F><>ʱ<EFBFBD><CAB1><EFBFBD>
|
||||
bool isRun = false;
|
||||
float waitTime = 4f;
|
||||
float runTime = 0;
|
||||
|
||||
float showGrabItem = 1.5f; //<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ͭ<EFBFBD>ߵ<EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
float showGrabItem = 1.5f; //<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ͭ<EFBFBD>ߵ<EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@@ -40,7 +40,7 @@ public class TouchPlayAnimatior : MonoBehaviour
|
||||
// grabItem.gameObject.SetActive(true);
|
||||
this.gameObject.SetActive(false);
|
||||
}
|
||||
if (runTime >= showGrabItem) //<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͭ<EFBFBD><EFBFBD>
|
||||
if (runTime >= showGrabItem) //<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ͭ<EFBFBD><CDAD>
|
||||
{
|
||||
if (grabItem != null && grabItem.gameObject.activeSelf == false)
|
||||
{
|
||||
@@ -64,14 +64,24 @@ public class TouchPlayAnimatior : MonoBehaviour
|
||||
PlayAudioByIndex(0);
|
||||
}
|
||||
}
|
||||
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
[SerializeField] private Animator childAnimator; // ֱ<><D6B1><EFBFBD>϶<EFBFBD><CFB6><EFBFBD><EFBFBD><EFBFBD>
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.gameObject.name == "PalmBox_L" || other.gameObject.name == "PalmBox_R")
|
||||
{
|
||||
|
||||
SceneMgr.Instance.isTrigger = false;
|
||||
|
||||
}
|
||||
}
|
||||
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
[SerializeField] private Object childAnimator; // ֱ<><D6B1><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>
|
||||
|
||||
public void SetTriggerParameter(string parameterName)
|
||||
{
|
||||
if (childAnimator != null)
|
||||
{
|
||||
childAnimator.SetTrigger(parameterName);
|
||||
Destroy(childAnimator);
|
||||
childAnimator = null;
|
||||
}
|
||||
}
|
||||
void ShowFont()
|
||||
@@ -91,7 +101,7 @@ public class TouchPlayAnimatior : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("<22><>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>");
|
||||
Debug.LogWarning("<22><>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user