2022-12-27 15:16:59 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class RequiredSubject
|
|
|
|
|
{
|
|
|
|
|
protected virtual string MODEL_LOCALIZATION => "";
|
|
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
|
public int RequiredAmount;
|
|
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
|
public GameObject RequiredObject;
|
|
|
|
|
|
2023-01-03 22:44:24 +01:00
|
|
|
|
public RequiredSubject(int requiredAmount)
|
|
|
|
|
{
|
|
|
|
|
RequiredAmount = requiredAmount;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-27 15:16:59 +01:00
|
|
|
|
public RequiredSubject(int requiredAmount, GameObject _object)
|
|
|
|
|
{
|
|
|
|
|
RequiredAmount = requiredAmount;
|
|
|
|
|
RequiredObject = _object;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public RequiredSubject(int requiredAmount, string objectName)
|
|
|
|
|
{
|
|
|
|
|
RequiredAmount = requiredAmount;
|
2023-01-03 22:44:24 +01:00
|
|
|
|
RequiredObject = FindObjectInResource(objectName);
|
2022-12-27 15:16:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GameObject FindObjectInResource(string modelName)
|
|
|
|
|
{
|
|
|
|
|
var resource = Resources.Load<GameObject>(MODEL_LOCALIZATION + modelName);
|
|
|
|
|
|
|
|
|
|
if (!resource)
|
2023-01-03 22:44:24 +01:00
|
|
|
|
throw new System.Exception($"required Subject Resource {MODEL_LOCALIZATION + modelName} not found!!");
|
2022-12-27 15:16:59 +01:00
|
|
|
|
|
|
|
|
|
return resource;
|
|
|
|
|
}
|
2023-01-03 22:44:24 +01:00
|
|
|
|
|
2022-12-27 15:16:59 +01:00
|
|
|
|
public virtual bool CheckCondition() { return false; }
|
|
|
|
|
}
|
|
|
|
|
|