兄弟位置対応
This commit is contained in:
parent
e87a7f5aa5
commit
c47ccf1e4f
File diff suppressed because it is too large
Load Diff
|
|
@ -14,14 +14,19 @@ public class BrotherConversation : MonoBehaviour
|
||||||
[SerializeField] private Animator backgroundAnimator;
|
[SerializeField] private Animator backgroundAnimator;
|
||||||
[SerializeField] private Animator brotherBlueAnimator;
|
[SerializeField] private Animator brotherBlueAnimator;
|
||||||
[SerializeField] private Animator brotherPinkAnimator;
|
[SerializeField] private Animator brotherPinkAnimator;
|
||||||
|
[SerializeField] private Transform brotherBlueTarget;
|
||||||
|
[SerializeField] private Transform brotherPinkTarget;
|
||||||
|
[SerializeField] private Transform brotherBlueBothTarget;
|
||||||
|
[SerializeField] private Transform brotherPinkBothTarget;
|
||||||
[SerializeField] private GameObject blueNameObject;
|
[SerializeField] private GameObject blueNameObject;
|
||||||
[SerializeField] private GameObject pinkNameObject;
|
[SerializeField] private GameObject pinkNameObject;
|
||||||
|
[SerializeField] private GameObject bothNameObject;
|
||||||
[SerializeField] private Text brotherText;
|
[SerializeField] private Text brotherText;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
// レベルからスクリプト読み込み
|
// レベルからスクリプト読み込み
|
||||||
var level = 5;
|
var level = 2;
|
||||||
var scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.ScriptDataSheet);
|
var scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.ScriptDataSheet);
|
||||||
var targetScriptList = scriptList.Where(data => data.id == level).ToList();
|
var targetScriptList = scriptList.Where(data => data.id == level).ToList();
|
||||||
|
|
||||||
|
|
@ -55,25 +60,35 @@ public class BrotherConversation : MonoBehaviour
|
||||||
|
|
||||||
private void SetData(BrotherScriptData scriptData)
|
private void SetData(BrotherScriptData scriptData)
|
||||||
{
|
{
|
||||||
Debug.Log($"{scriptData.BlueFace.ToString()}, {scriptData.PinkFace.ToString()}");
|
|
||||||
brotherBlueAnimator.SetTrigger(scriptData.BlueFace.ToString());
|
brotherBlueAnimator.SetTrigger(scriptData.BlueFace.ToString());
|
||||||
brotherPinkAnimator.SetTrigger(scriptData.PinkFace.ToString());
|
brotherPinkAnimator.SetTrigger(scriptData.PinkFace.ToString());
|
||||||
brotherText.text = scriptData.text;
|
brotherText.text = scriptData.text;
|
||||||
switch (scriptData.Brother)
|
switch (scriptData.Brother)
|
||||||
{
|
{
|
||||||
case BrotherType.Blue:
|
case BrotherType.Blue:
|
||||||
|
brotherBlueAnimator.transform.localPosition = brotherBlueTarget.localPosition;
|
||||||
brotherBlueAnimator.transform.SetLocalScale(1f);
|
brotherBlueAnimator.transform.SetLocalScale(1f);
|
||||||
brotherPinkAnimator.transform.SetLocalScale(0f);
|
brotherPinkAnimator.transform.SetLocalScale(0f);
|
||||||
blueNameObject.SetActive(true);
|
blueNameObject.SetActive(true);
|
||||||
pinkNameObject.SetActive(false);
|
pinkNameObject.SetActive(false);
|
||||||
|
bothNameObject.SetActive(false);
|
||||||
break;
|
break;
|
||||||
case BrotherType.Pink:
|
case BrotherType.Pink:
|
||||||
|
brotherPinkAnimator.transform.localPosition = brotherPinkTarget.localPosition;
|
||||||
brotherBlueAnimator.transform.SetLocalScale(0f);
|
brotherBlueAnimator.transform.SetLocalScale(0f);
|
||||||
brotherPinkAnimator.transform.SetLocalScale(1f);
|
brotherPinkAnimator.transform.SetLocalScale(1f);
|
||||||
blueNameObject.SetActive(false);
|
blueNameObject.SetActive(false);
|
||||||
pinkNameObject.SetActive(true);
|
pinkNameObject.SetActive(true);
|
||||||
|
bothNameObject.SetActive(false);
|
||||||
break;
|
break;
|
||||||
case BrotherType.Both:
|
case BrotherType.Both:
|
||||||
|
brotherBlueAnimator.transform.localPosition = brotherBlueBothTarget.localPosition;
|
||||||
|
brotherPinkAnimator.transform.localPosition = brotherPinkBothTarget.localPosition;
|
||||||
|
brotherBlueAnimator.transform.SetLocalScale(1f);
|
||||||
|
brotherPinkAnimator.transform.SetLocalScale(1f);
|
||||||
|
blueNameObject.SetActive(false);
|
||||||
|
pinkNameObject.SetActive(false);
|
||||||
|
bothNameObject.SetActive(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue