畑の質表示
This commit is contained in:
parent
278e1b927a
commit
47f48ccc06
|
|
@ -256,6 +256,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 1657f65ff2fe42ba87efbe278055bb7d, type: 3}
|
m_Script: {fileID: 11500000, guid: 1657f65ff2fe42ba87efbe278055bb7d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
board: {fileID: 6693492134046962342}
|
||||||
lineName: 0
|
lineName: 0
|
||||||
seedlings:
|
seedlings:
|
||||||
- {fileID: 317074946776237483}
|
- {fileID: 317074946776237483}
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 1657f65ff2fe42ba87efbe278055bb7d, type: 3}
|
m_Script: {fileID: 11500000, guid: 1657f65ff2fe42ba87efbe278055bb7d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
board: {fileID: 6693492134046962342}
|
||||||
lineName: 1
|
lineName: 1
|
||||||
seedlings:
|
seedlings:
|
||||||
- {fileID: 6009788312675045274}
|
- {fileID: 6009788312675045274}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public enum PlantLineType
|
public enum PlantLineType
|
||||||
|
|
@ -9,8 +11,30 @@ public enum PlantLineType
|
||||||
}
|
}
|
||||||
public class PlantLine : MonoBehaviour
|
public class PlantLine : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
[SerializeField] private TextMeshPro board;
|
||||||
[SerializeField] private PlantLineType lineName;
|
[SerializeField] private PlantLineType lineName;
|
||||||
[SerializeField] private List<CornSeedling> seedlings = new List<CornSeedling>();
|
[SerializeField] private List<CornSeedling> seedlings = new List<CornSeedling>();
|
||||||
public PlantLineType LineName => lineName;
|
public PlantLineType LineName => lineName;
|
||||||
public List<CornSeedling> Seedlings => seedlings;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue