畑の質表示

This commit is contained in:
kimura 2021-08-02 15:40:19 +09:00
parent 278e1b927a
commit 47f48ccc06
3 changed files with 26 additions and 0 deletions

View File

@ -256,6 +256,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1657f65ff2fe42ba87efbe278055bb7d, type: 3}
m_Name:
m_EditorClassIdentifier:
board: {fileID: 6693492134046962342}
lineName: 0
seedlings:
- {fileID: 317074946776237483}

View File

@ -222,6 +222,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1657f65ff2fe42ba87efbe278055bb7d, type: 3}
m_Name:
m_EditorClassIdentifier:
board: {fileID: 6693492134046962342}
lineName: 1
seedlings:
- {fileID: 6009788312675045274}

View File

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public enum PlantLineType
@ -9,8 +11,30 @@ public enum PlantLineType
}
public class PlantLine : MonoBehaviour
{
[SerializeField] private TextMeshPro board;
[SerializeField] private PlantLineType lineName;
[SerializeField] private List<CornSeedling> seedlings = new List<CornSeedling>();
public PlantLineType LineName => lineName;
public List<CornSeedling> Seedlings => seedlings;
public CornFieldRank FieldLevel { get; private set; }
private readonly string boardFormat = "x{0}";
public void SetFieldLevel(CornFieldRank rank)
{
FieldLevel = rank;
switch (rank)
{
case CornFieldRank.Rank1:
board.text = string.Format(boardFormat, 1);
break;
case CornFieldRank.Rank2:
board.text = string.Format(boardFormat, 2);
break;
case CornFieldRank.Rank3:
board.text = string.Format(boardFormat, 3);
break;
default:
throw new ArgumentOutOfRangeException(nameof(rank), rank, null);
}
}
}