feat(): 完成凹槽预制体
This commit is contained in:
@@ -17,7 +17,8 @@ namespace Script.Gameplay.Facility
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (!isOpenInEditor) return;
|
||||
hasObject = Physics.CheckBox(transform.position + plateOffset, plateSize * 0.5f, Quaternion.identity, detectLayer);
|
||||
hasObject = Physics.CheckBox(transform.position + plateOffset, plateSize * 0.5f, Quaternion.identity,
|
||||
detectLayer);
|
||||
if (hasObject != lastState)
|
||||
{
|
||||
SendSignal(hasObject, this.gameObject);
|
||||
@@ -25,17 +26,18 @@ namespace Script.Gameplay.Facility
|
||||
if (hasObject)
|
||||
{
|
||||
// 被压下动画
|
||||
pressTopPrefab.transform.localPosition = new Vector3(0,0,0.1f);
|
||||
if (pressTopPrefab != null)
|
||||
pressTopPrefab.transform.localPosition = new Vector3(0, 0, 0.1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 弹起动画
|
||||
pressTopPrefab.transform.localPosition = new Vector3(0,0,1);
|
||||
|
||||
if (pressTopPrefab != null)
|
||||
pressTopPrefab.transform.localPosition = new Vector3(0, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user