//-Implementation private void Awake() { XUtils.check(ProgressIndicator); XUtils.check(WorkersAssignemntControl); WorkersAssignemntControl.onPressedAssignWorker += () => { CrewMember theCrewMemberToAssign = XUtils.verify(_carCity).getFirstFreeCrewMember(); if (null == theCrewMemberToAssign) { return; } collectConstructionSiteWorkers(ref __arrayRegister); if (__arrayRegister.getSize() >= _constructionSite.getMaxWorkersPossibleToAssign()) { return; } theCrewMemberToAssign.setConstruction(_constructionSite); }; WorkersAssignemntControl.onPressedWithdrawWorker += () => { collectConstructionSiteWorkers(ref __arrayRegister); if (0 == __arrayRegister.getSize()) { return; } __arrayRegister[0].setConstruction(null); }; }
//-Implementation private void Awake() { XUtils.check(_camera); _cameraSettings = XUtils.verify(_initialSettingsHolder).getSettings(); }
public void attach( GameObject inUI, GameObject inGameObject, bool inDestroyUIWithObject = true) { var theAttachPoint = XUtils.verify( inGameObject.GetComponent <WorldObjectAttachPoint>() ); attach(inUI, theAttachPoint, inDestroyUIWithObject); }
public void processConstructionStart( ConstructionSiteObject inConstructionSite) { var theWorldObjectsAttachedUIManager = FindObjectOfType <WorldObjectsAttachedUIManger>(); ConstructionSiteUIObject theConstructionSiteUI = XUtils.createObject(XUtils.verify(_constructionSiteUIPrefab)); theConstructionSiteUI.init(_carCity, inConstructionSite); theWorldObjectsAttachedUIManager.attach( theConstructionSiteUI.gameObject, inConstructionSite.gameObject ); }
//Methods //-API public void init(CarCityObject inCarCity) { _carCity = XUtils.verify(inCarCity); GameObject theCityLevel = inCarCity.getInnerLevel(); gameObject.layer = XUtils.verify(theCityLevel).layer; gameObject.transform.SetParent(theCityLevel.transform, true); Vector3 theLocalPosition = gameObject.transform.localPosition; theLocalPosition.z = 0.0f; gameObject.transform.localPosition = theLocalPosition; }
private HierarchicalGridWayUIElement createWayElementForElement( HierarchicalUIElementObject inElement) { HierarchicalGridWayUIElement theWayElement = inElement.createWayElement(); if (!theWayElement) { GameObject theWayElementGameObject = Instantiate(_defaultWayElementPrefab); theWayElement = XUtils.verify( theWayElementGameObject.GetComponent <HierarchicalGridWayUIElement>() ); } theWayElement._hierarchicalGridUIObject = this; theWayElement._element = inElement; return(theWayElement); }
//--Shoot implementation private void performShootFromPoint(GameObject inShootingPoint) { Vector2 theRocketPosition = new Vector2(); float theRocketRotation = 0.0f; XMath.getFromTransform( ref theRocketPosition, ref theRocketRotation, inShootingPoint ); RocketProjectileObject theRocket = XUtils.createObject(_projectilePrefab); theRocket.init(XUtils.verify(_owner)); theRocket.transform.position = theRocketPosition; Vector3 theRotation = theRocket.transform.rotation.eulerAngles; theRotation.z = theRocketRotation; theRocket.transform.eulerAngles = theRotation; }
//-Implementation void Awake() { //TODO: Remove editor pannels here XUtils.verify(worldUI).initFromGameUI(carCity); XUtils.verify(carCityUI).initFromGameUI(carCity); worldUI.onClickedGoToCarCity += () => { switchToCarCityUI(300.0f); }; carCityUI.onClickedGoToWorld += () => { switchToWorldUI(300.0f); }; _cameraManager = XUtils.verify( FindObjectOfType <CameraManager>() ); _pauseManager = XUtils.verify( FindObjectOfType <PauseManager>() ); XUtils.check(worldCamera); XUtils.check(carCityCamera); switchToWorldUI(); }
//Methods //-API public void init(CarCityObject inCarCity) { _carCity = XUtils.verify(inCarCity); }
private void Awake() { XUtils.verify(_selectBuildingButton).onClick.AddListener(() => { _onSelectBuilding?.Invoke(_buildingScheme); }); }
//Methods //-API public void init(CarCityObject inCarCity, ConstructionSiteObject inConstructionSite) { _carCity = XUtils.verify(inCarCity); _constructionSite = XUtils.verify(inConstructionSite); }
private BuildingScheme getBuildingScheme() { return(XUtils.verify(_buildingScheme)); }
//-Implementation private void refreshUIElements() { XUtils.verify(_selectBuildingButton.GetComponentInChildren <Text>()). text = _buildingScheme.buildingName; }
//-Implementation private void Awake() { _rectTransformForPlacingWayElements = XUtils.verify(GetComponent <RectTransform>()); }
//-Utils private void showElementInGrid(HierarchicalUIElementObject inElement) { _elementShownInGrid = XUtils.verify(inElement); refreshShowingElement(); }
//-Implementation void Start() { XUtils.verify(_goToWorldButton).onClick.AddListener(() => { onClickedGoToWorld?.Invoke(); }); }
public void OnEnable() { XUtils.verify(buildingPlan)._buildingScheme = this; XUtils.verify(constructionSite)._buildingScheme = this; XUtils.verify(building)._buildingScheme = this; }
//-Implementation private void Start() { XUtils.verify(_goToCarCityButton).onClick.AddListener(() => { onClickedGoToCarCity?.Invoke(); }); }
//Methods //-Child API protected void select() { XUtils.check(_element); XUtils.verify(_hierarchicalGridUIObject).goInto(_element); }
//-Child API protected void goInto() { XUtils.verify(_hierarchicalUIobject).goInto(this); }
public static void applyDamage(Component inComponent, Damage inDamage) { applyDamage(XUtils.verify(inComponent).gameObject, inDamage); }