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