void OnStoreUpdated(string storeKey) { if (storeKey == "GameState") { if (uiController.Store[storeKey] == GameState.Over) { currentState = ProductionNodeState.Idle; } } }
void Start() { currentState = ProductionNodeState.Idle; mapRoot = GameObject.Find("MapRoot"); Captured?.Invoke(Team, Team); if (StartCaptured) { capturable.ForceCapture(Team); } else { setMaterialProperties.SetMaterial(0f, TeamColors.Hues[Team], ProductionNodeData.sprite); } }
void OnCaptured(int newTeam) { int oldTeam = Team; Team = newTeam; BuildProgress = 0; currentState = ProductionNodeState.Building; Captured?.Invoke(Team, oldTeam); if (StartCaptured) { capturable.Captured -= OnCaptured; capturable.Disable(); } if (!selectable.gameObject.activeSelf) { selectable.gameObject.SetActive(true); } setMaterialProperties.SetMaterial(1f, TeamColors.Hues[Team], ProductionNodeData.sprite); }