feat(): 美术配合上拉杆 按钮 控制台 压力板
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -9,7 +10,14 @@ namespace Script.Gameplay.Facility
|
||||
public class ButtonInteractController : BaseFacilityController
|
||||
{
|
||||
[SerializeField] private float signalDuration = 1.0f; // 信号持续时间(秒)
|
||||
[SerializeField] private GameObject buttonPressPoint;
|
||||
private bool isPressing = false;
|
||||
private Vector3 buttonInitialPosition;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
buttonInitialPosition = buttonPressPoint.transform.position;
|
||||
}
|
||||
|
||||
public override string GetInteractPrompt()
|
||||
{
|
||||
@@ -27,14 +35,15 @@ namespace Script.Gameplay.Facility
|
||||
{
|
||||
SendSignal(true, this.gameObject);
|
||||
isPressing = true;
|
||||
// 按钮压下的动画或效果可以在这里添加
|
||||
transform.localScale = new Vector3(0.3f, 0.3f, 0.1f);
|
||||
// 按钮按下的动画或效果可以在这里添加
|
||||
buttonPressPoint.transform.position = new Vector3(0, 0, 0);
|
||||
|
||||
yield return new WaitForSeconds(signalDuration);
|
||||
SendSignal(false, this.gameObject);
|
||||
isPressing = false;
|
||||
// 按钮弹起的动画或效果可以在这里添加
|
||||
transform.localScale = new Vector3(0.3f, 0.3f, 0.15f);
|
||||
buttonPressPoint.transform.position = buttonInitialPosition;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user