继续搞点新机制
This commit is contained in:
@@ -29,8 +29,8 @@ namespace Continentis.MainGame
|
||||
public GameObject intentionCardObject;
|
||||
public GameObject inspectionCardObject;
|
||||
public SerializableDictionary<string, CardViewCollection> cardViewCollections;
|
||||
|
||||
[Header("GeneralUI")]
|
||||
|
||||
[Header("GeneralUI")] public GameObject customImage;
|
||||
public GameObject informationBox;
|
||||
public SerializableDictionary<Fraction, List<Sprite>> fractionFrames;
|
||||
public SerializableDictionary<Rarity, Color> rarityColors;
|
||||
|
||||
35
Assets/Scripts/MainGame/Base/GameElement.cs
Normal file
35
Assets/Scripts/MainGame/Base/GameElement.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.MainGame
|
||||
{
|
||||
public interface IGameElement
|
||||
{
|
||||
public static readonly Dictionary<Guid, IGameElement> Instances = new Dictionary<Guid, IGameElement>();
|
||||
|
||||
public Guid elementID { get; set; }
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
elementID = Guid.NewGuid();
|
||||
|
||||
if (!Instances.ContainsKey(this.elementID))
|
||||
{
|
||||
Instances.Add(this.elementID, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"GameElement with ID {this.elementID} is already registered.");
|
||||
}
|
||||
}
|
||||
|
||||
public void Unregister()
|
||||
{
|
||||
if (Instances.ContainsKey(this.elementID))
|
||||
{
|
||||
Instances.Remove(this.elementID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/MainGame/Base/GameElement.cs.meta
Normal file
2
Assets/Scripts/MainGame/Base/GameElement.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7cc23cb9dea5f94187db2e14ce646af
|
||||
Reference in New Issue
Block a user