| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System;
- namespace ShotSimulator.Train.Info
- {
- [Serializable]
- public enum TrainType
- {
- Cognition, //认知
- Reaction, //反应
- Perceive, //觉察
- Accuracy, //精准度
- Speed, //速度
- Track, //追踪
- Customize, //自定义
- }
- public enum TrainTaskFinishType
- {
- /// <summary>
- /// 时间
- /// </summary>
- Time,
- /// <summary>
- /// 子弹数
- /// </summary>
- BulletNums,
- /// <summary>
- /// 次数
- /// </summary>
- Number,
- /// <summary>
- /// 自定义
- /// </summary>
- Customize
- }
- [Serializable]
- public class TrainTaskDetail
- {
- public string nameID;
- public string detailID;
- public string iconAssetPath;
- public Sprite showTexAssetPath;
- }
- public class BaseTrainInfo : ScriptableObject
- {
- public TrainType trainType;
- public TrainTaskType trainTaskType;
- public TrainTaskDetail detail;
- public string trainHandleClassName;
- public TrainTaskFinishType finishType;
- public int maxNumber;
- public TrainFirearmConfig m_TrainFirearmConfig;
- public int duration;
- public string environmentScene;
- public bool bgm;
- public CursorType cursorType;
- public List<MetricsInfo> metrics = new List<MetricsInfo>();
- [SerializeReference]
- public List<BaseDifficultyData> difficultyDatas = new List<BaseDifficultyData>();
- [SerializeReference]
- public List<BaseScoreData> scoreDatas = new List<BaseScoreData>();
- public virtual void ConfigDifficultyData()
- {
- difficultyDatas.Clear();
- }
- public virtual void ConfigScoreData()
- {
- scoreDatas.Clear();
- }
- protected void AddDifficultyData<T>() where T : BaseDifficultyData, new()
- {
- difficultyDatas.Add(new T() { difficultyType = DifficultyType.Standard });
- difficultyDatas.Add(new T() { difficultyType = DifficultyType.Advance });
- difficultyDatas.Add(new T() { difficultyType = DifficultyType.Professional });
- }
- protected void AddScoreData<T>() where T : BaseScoreData, new()
- {
- scoreDatas.Add(new T() { difficultyType = DifficultyType.Standard });
- scoreDatas.Add(new T() { difficultyType = DifficultyType.Advance });
- scoreDatas.Add(new T() { difficultyType = DifficultyType.Professional });
- }
- public T GetDifficultyData<T>(DifficultyType type) where T : BaseDifficultyData
- {
- T data = null;
- for(int i = 0; i < difficultyDatas.Count; i++)
- {
- if (difficultyDatas[i].difficultyType == type)
- {
- data = difficultyDatas[i] as T;
- }
- }
- return data;
- }
- public T GetScoreData<T>(DifficultyType type) where T : BaseScoreData
- {
- T data = null;
- for (int i = 0; i < scoreDatas.Count; i++)
- {
- if (scoreDatas[i].difficultyType == type)
- {
- data = scoreDatas[i] as T;
- }
- }
- return data;
- }
- }
- }
|