protected override void HandleDestroy(SelectableVolume selectableVolume) { if (shouldHideOnDestroy) { gameMode.unitInfoGui.Hide(); } }
public virtual void OnMouseDownSelectableVolume(SelectableVolume selectableVolume) { switch (selectableVolume.type) { case SelectableVolume.Type.Barrack: HandleBarrackSelection(selectableVolume); break; case SelectableVolume.Type.Background: HandleBackgroundSelection(); break; default: break; } }
private void HandleBarrackSelection(SelectableVolume selectableVolume) { SelectedSelectableVolumeGameRule ssvgr = new SelectedSelectableVolumeGameRule(); selectableVolume.RuleManager.overridedGameRule = ssvgr; unitInfoGui.RuleManager.overridedGameRule = new UnitInfoGuiGameRule(ssvgr); unitInfoGui.Display(new UnitInfoGui.UnitInfo(selectableVolume.gameObject.name, selectableVolume.gameObject.GetComponent <SpriteRenderer>())); List <UnitDefinitionGui.UnitDefinition> CreatableUnits = GetCreatableUnitDefinitions(); unitCreationGui.Initialize(CreatableUnits.Count); IReadOnlyList <UnitDefinitionGui> unitDefGuis = unitCreationGui.GetUnitDefinitionGuis(); for (int i = 0; i < CreatableUnits.Count; i++) { unitDefGuis[i].SetUnitDefinition(CreatableUnits[i]); unitDefGuis[i].RuleManager.overridedGameRule = new UnitDefinitionGuiGameRule(i); } freeMover.transform.position = new Vector3(selectableVolume.transform.position.x, selectableVolume.transform.position.y, freeMover.transform.position.z); }
protected virtual void HandleDestroy(SelectableVolume selectableVolume) { return; }
void SelectableVolume.IGameRule.OnDestroy(SelectableVolume selectableVolume) { HandleDestroy(selectableVolume); }
void SelectableVolume.IGameRule.OnMouseDown(SelectableVolume selectableVolume) { gameMode.OnMouseDownSelectableVolume(selectableVolume); }