バイト君Scale対応
This commit is contained in:
parent
c948397190
commit
8ccbe52a18
|
|
@ -8,23 +8,30 @@ namespace MyGame.Scenes.marketing.Scripts
|
||||||
[SerializeField] private Transform frontPos;
|
[SerializeField] private Transform frontPos;
|
||||||
[SerializeField] private Transform shopPos;
|
[SerializeField] private Transform shopPos;
|
||||||
private bool isPartTimer;
|
private bool isPartTimer;
|
||||||
|
private float orgScale;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
orgScale = partTimerAnimator.transform.localScale.x;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetActive(bool active)
|
public void SetActive(bool active)
|
||||||
{
|
{
|
||||||
partTimerAnimator.speed = active ? 1f : 0f;
|
partTimerAnimator.speed = active ? 1f : 0f;
|
||||||
partTimerAnimator.transform.SetLocalScale(active ? 1f : 0f);
|
partTimerAnimator.transform.SetLocalScale(active ? orgScale : 0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartAnimation(bool isPartTimerMode)
|
public void StartAnimation(bool isPartTimerMode)
|
||||||
{
|
{
|
||||||
isPartTimer = isPartTimerMode;
|
isPartTimer = isPartTimerMode;
|
||||||
|
var animatorTransform = partTimerAnimator.transform;
|
||||||
|
animatorTransform.SetParent(isPartTimerMode ? shopPos : frontPos);
|
||||||
|
animatorTransform.localPosition = Vector3.zero;
|
||||||
if (isPartTimerMode)
|
if (isPartTimerMode)
|
||||||
{
|
{
|
||||||
partTimerAnimator.transform.SetParent(shopPos, false);
|
|
||||||
partTimerAnimator.Play("customer_Employment_stay_front");
|
partTimerAnimator.Play("customer_Employment_stay_front");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
partTimerAnimator.transform.SetParent(frontPos, false);
|
|
||||||
partTimerAnimator.Play("customer_Employment_stay_front_Flyer");
|
partTimerAnimator.Play("customer_Employment_stay_front_Flyer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue