兄弟位置対応

This commit is contained in:
kimura 2021-10-14 12:42:08 +09:00
parent e87a7f5aa5
commit c47ccf1e4f
2 changed files with 76 additions and 4640 deletions

View File

@ -14,14 +14,19 @@ public class BrotherConversation : MonoBehaviour
[SerializeField] private Animator backgroundAnimator;
[SerializeField] private Animator brotherBlueAnimator;
[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 pinkNameObject;
[SerializeField] private GameObject bothNameObject;
[SerializeField] private Text brotherText;
private void Start()
{
// レベルからスクリプト読み込み
var level = 5;
var level = 2;
var scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.ScriptDataSheet);
var targetScriptList = scriptList.Where(data => data.id == level).ToList();
@ -55,25 +60,35 @@ public class BrotherConversation : MonoBehaviour
private void SetData(BrotherScriptData scriptData)
{
Debug.Log($"{scriptData.BlueFace.ToString()}, {scriptData.PinkFace.ToString()}");
brotherBlueAnimator.SetTrigger(scriptData.BlueFace.ToString());
brotherPinkAnimator.SetTrigger(scriptData.PinkFace.ToString());
brotherText.text = scriptData.text;
switch (scriptData.Brother)
{
case BrotherType.Blue:
brotherBlueAnimator.transform.localPosition = brotherBlueTarget.localPosition;
brotherBlueAnimator.transform.SetLocalScale(1f);
brotherPinkAnimator.transform.SetLocalScale(0f);
blueNameObject.SetActive(true);
pinkNameObject.SetActive(false);
bothNameObject.SetActive(false);
break;
case BrotherType.Pink:
brotherPinkAnimator.transform.localPosition = brotherPinkTarget.localPosition;
brotherBlueAnimator.transform.SetLocalScale(0f);
brotherPinkAnimator.transform.SetLocalScale(1f);
blueNameObject.SetActive(false);
pinkNameObject.SetActive(true);
bothNameObject.SetActive(false);
break;
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;
default:
throw new ArgumentOutOfRangeException();