Game.Prefabs.CompanyNotificationParameterData
Assembly: Assembly-CSharp (may vary by build / modding setup)
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
A simple ECS component that holds references to notification prefabs and threshold values used to trigger company-related notifications (for example, when a company has no inputs or no customers). It is a plain data container (IComponentData) intended to be attached to company prefab entities so game systems can read the configured notification prefabs and the numeric limits that determine when to show notifications.
Fields
-
public Unity.Entities.Entity m_NoInputsNotificationPrefab
Entity reference to the notification prefab that should be spawned/shown when the company has no inputs. This is expected to be an Entity pointing to a converted prefab (set during conversion or from another entity). -
public Unity.Entities.Entity m_NoCustomersNotificationPrefab
Entity reference to the notification prefab used when the company has no customers. -
public float m_NoInputCostLimit
Threshold value used by the system that detects "no inputs" situations. Interpreted by the relevant game logic (typically a cost/expense threshold); units and interpretation are determined by the notifying system. -
public float m_NoCustomersServiceLimit
Threshold used to determine when a lack of customers for service type businesses should trigger the notification. Exact semantics (percentage, absolute count, service score) are defined by the consumer system. -
public float m_NoCustomersHotelLimit
Threshold used specifically for hotel-type businesses to decide when to trigger "no customers" notifications. Semantics are defined by the hotel/customer-checking logic.
Properties
- This type declares no properties. It exposes public fields only.
Constructors
public CompanyNotificationParameterData()
(default)
Structs have a default parameterless constructor that zero-initializes fields. For explicit initialization, create an instance with an object initializer.
Methods
- This type declares no methods. It is a plain data container (IComponentData).
Usage Example
// Example: Adding the component to an entity (EntityManager-based approach)
var companyParams = new CompanyNotificationParameterData
{
m_NoInputsNotificationPrefab = noInputsPrefabEntity,
m_NoCustomersNotificationPrefab = noCustomersPrefabEntity,
m_NoInputCostLimit = 100f,
m_NoCustomersServiceLimit = 0.25f,
m_NoCustomersHotelLimit = 0.10f
};
entityManager.AddComponentData(companyEntity, companyParams);
// Example: Authoring conversion from a MonoBehaviour on a prefab
using Unity.Entities;
using UnityEngine;
public class CompanyNotificationAuthoring : MonoBehaviour, IConvertGameObjectToEntity
{
public GameObject noInputsNotificationPrefabGO;
public GameObject noCustomersNotificationPrefabGO;
public float noInputCostLimit = 100f;
public float noCustomersServiceLimit = 0.25f;
public float noCustomersHotelLimit = 0.10f;
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
var noInputsEntity = conversionSystem.GetPrimaryEntity(noInputsNotificationPrefabGO);
var noCustomersEntity = conversionSystem.GetPrimaryEntity(noCustomersNotificationPrefabGO);
var data = new Game.Prefabs.CompanyNotificationParameterData
{
m_NoInputsNotificationPrefab = noInputsEntity,
m_NoCustomersNotificationPrefab = noCustomersEntity,
m_NoInputCostLimit = noInputCostLimit,
m_NoCustomersServiceLimit = noCustomersServiceLimit,
m_NoCustomersHotelLimit = noCustomersHotelLimit
};
dstManager.AddComponentData(entity, data);
}
}
// Example: Reading the data inside a system
Entities.ForEach((in Game.Prefabs.CompanyNotificationParameterData notif) =>
{
// Use notif.m_NoInputsNotificationPrefab, notif.m_NoInputCostLimit, etc.
});
Notes and tips: - The Entity fields are expected to reference converted prefab entities. Ensure prefabs are converted (via GameObject conversion or runtime conversion) before assigning. - The float limits' precise meaning (absolute value, fraction, or other scale) depends on the game system that consumes this component — consult the system that reads this component if you need exact semantics. - This struct is a plain component data container; all behavior is implemented in systems that read these fields.