ゲーム状態でフライパンを止める処理を追加/ポジションリセット追加
This commit is contained in:
parent
fda7226d6c
commit
7a797f1c07
|
|
@ -18,13 +18,17 @@ public class PanController : MonoBehaviour, IDragHandler, IBeginDragHandler
|
|||
private Vector2 delta;
|
||||
public Vector2 Delta => delta;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
void Awake()
|
||||
{
|
||||
firstPos = target.position;
|
||||
prevPos = firstPos;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
delta = Vector2.zero;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
|
@ -58,4 +62,9 @@ public class PanController : MonoBehaviour, IDragHandler, IBeginDragHandler
|
|||
offset = targetPos - Camera.main.ScreenToWorldPoint(new Vector3(eventData.position.x, eventData.position.y,
|
||||
targetPos.z));
|
||||
}
|
||||
|
||||
public void ResetTargetPosition()
|
||||
{
|
||||
target.position = firstPos;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,15 +93,18 @@ public class ThermalControl : MonoBehaviour
|
|||
temperature = 0f;
|
||||
temperatureSpeed = 0f;
|
||||
thermoMeter.SetScale(coldValue, hotValue);
|
||||
panController.ResetTargetPosition();
|
||||
}
|
||||
|
||||
public void StartMeter()
|
||||
{
|
||||
isMove = true;
|
||||
panController.enabled = true;
|
||||
}
|
||||
|
||||
public void StopMeter()
|
||||
{
|
||||
isMove = false;
|
||||
panController.enabled = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue