134 lines
4.5 KiB
C#
134 lines
4.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
[System.Serializable]
|
|
[CreateAssetMenu(fileName = "DebugRecordList", menuName = "ScriptableObjects/DebugRecordList", order = 1)]
|
|
public class DebugRecordList : ScriptableObject
|
|
{
|
|
public List<DebugRecord> records;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class DebugRecord
|
|
{
|
|
public string name;
|
|
public int cost;
|
|
public DebugMultiArea area;
|
|
public int value;
|
|
}
|
|
|
|
public enum DebugMultiArea
|
|
{
|
|
OverallBuff,
|
|
SunBuildingBuff,
|
|
SpecialBuff,
|
|
AddArea,
|
|
ClickMulti,
|
|
ClickTimeMulti,
|
|
ClickAddArea,
|
|
TechOnly,
|
|
}
|
|
|
|
public class DebugTech : MonoBehaviour
|
|
{
|
|
public Buildings Wood, Sun;
|
|
public TMP_Text NeedFaith;
|
|
public TMP_Text TechName;
|
|
|
|
public DebugRecordList TechList;
|
|
public int CurrentTechIndex = 0;
|
|
|
|
private void Start()
|
|
{
|
|
TechName.text = TechList.records[CurrentTechIndex].name;
|
|
NeedFaith.text = TechList.records[CurrentTechIndex].cost.ToString();
|
|
}
|
|
|
|
public void UnlockCurrentTech()
|
|
{
|
|
List<DebugRecord> records = TechList.records;
|
|
if (CurrentTechIndex < records.Count)
|
|
{
|
|
DebugRecord dma = records[CurrentTechIndex];
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
CurrentTechIndex++;
|
|
TechName.text = records[CurrentTechIndex].name;
|
|
NeedFaith.text = records[CurrentTechIndex].cost.ToString();
|
|
}
|
|
|
|
|
|
switch (dma.area)
|
|
{
|
|
case DebugMultiArea.OverallBuff:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;/*
|
|
Sun.GlobalBuff_Auto += dma.value;
|
|
Sun.GlobalBuff_Click += dma.value;
|
|
Wood.GlobalBuff_Auto += dma.value;*/
|
|
}
|
|
break;
|
|
case DebugMultiArea.SunBuildingBuff:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;
|
|
Sun.LocalBuff_Auto += dma.value;
|
|
}
|
|
break;
|
|
case DebugMultiArea.SpecialBuff:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;
|
|
Sun.SpecalBuffMuti_efficiency_Auto += dma.value;
|
|
}
|
|
break;
|
|
case DebugMultiArea.AddArea:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;
|
|
Sun.SpecalBuffAdd_efficiency_Auto += dma.value;
|
|
}
|
|
break;
|
|
case DebugMultiArea.ClickMulti:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;/*
|
|
Sun.Click_efficiency += dma.value;
|
|
Wood.Click_efficiency += dma.value;*/
|
|
}
|
|
break;
|
|
case DebugMultiArea.ClickTimeMulti:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;/*
|
|
Sun.LocalBuff_Click += dma.value;
|
|
Wood.LocalBuff_Click += dma.value;*/
|
|
}
|
|
break;
|
|
case DebugMultiArea.ClickAddArea:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;/*
|
|
Sun.SpecalBuffAdd_efficiency_Click += dma.value;
|
|
Wood.SpecalBuffAdd_efficiency_Click += dma.value;*/
|
|
}
|
|
break;
|
|
case DebugMultiArea.TechOnly:
|
|
if (GameProcedureManager.Instance.FaithCount >= dma.cost)
|
|
{
|
|
GameProcedureManager.Instance.FaithCount -= dma.cost;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|