//List<int> healthBars = new List<int> { 100, 250, 450 }; //100%,50%,25% corresponds with 2 levels of health // Start is called before the first frame update void Start() { herdController = GameObject.Find("HerdController").GetComponent <HerdController>(); fieldList = new List <Field>(); unsproutedList = new List <Field>(); buildController = GameObject.Find("BuildController").GetComponent <BuildController>(); }
private void buttonSellItem_Click(object sender, EventArgs e) { var selectedRow = dataGridItemDatabase.SelectedRows[0]; if (selectedRow == null) { return; } var itemId = Convert.ToInt32(selectedRow.Cells[0].Value.ToString()); var buildItem = BuildController.AddItem(itemId, true); if (buildItem == null) { return; } var node = new Node(buildItem.Id.ToString()); node.Editable = false; node.DragDropEnabled = false; var iconCell = new Cell(); iconCell.Images.Image = (Bitmap)Properties.Resources.ResourceManager.GetObject("_" + buildItem.Id); node.Cells.Add(iconCell); node.Cells.Add(new Cell("" + buildItem.Name)); node.Cells.Add(new Cell("" + buildItem.TotalCost)); node.Cells.Add(new Cell("" + buildItem.UpgradeCost)); node.Cells.Add(new Cell(buildItem.Sell ? "Yes" : "No")); node.Nodes.AddRange(GetSubNodes(buildItem)); buildTree.Nodes.Add(node); }
private void Start() { turnText = GameObject.Find("Turn").GetComponent <Text>(); score = GameObject.Find("Score").GetComponent <ScoreMain>(); manager = GameObject.FindGameObjectsWithTag("RiskManager")[0].GetComponent <RiskManager>(); deliverys = GameObject.Find("Deliverys").GetComponent <Deliverys>(); storeController = GameObject.Find("StoreController").GetComponent <StoreController>(); teamController = GameObject.Find("TeamController").GetComponent <TeamController>(); teamControllerStore = GameObject.Find("TeamControllerStore").GetComponent <TeamControllerStore>(); buildController = GameObject.Find("BuildController").GetComponent <BuildController>(); wether = GameObject.Find("Wether").GetComponent <Image>(); score.ChangeScore(-10000000); mounths = new string[12]; mounths[0] = "Июнь"; mounths[1] = "Июль"; mounths[2] = "Август"; mounths[3] = "Сентябрь"; mounths[4] = "Октябрь"; mounths[5] = "Ноябрь"; mounths[6] = "Декабрь"; mounths[7] = "Янаврь"; mounths[8] = "Февраль"; mounths[9] = "Март"; mounths[10] = "Апрель"; mounths[11] = "Май"; }
public async Task UserGetBuilds_Success() { var uc = GetController(); var bc = new BuildController(_serviceProvider.GetRequiredService <ILogger>(), _serviceProvider.GetRequiredService <IPartitionedKeyValueDictionary>(), _serviceProvider.GetRequiredService <IAppBlobStorage>(), _serviceProvider.GetRequiredService <IUserAuthenticator>(), _serviceProvider.GetRequiredService <IAppSearchService>() ); bc.ControllerContext.HttpContext = new DefaultHttpContext(); TestHelper.SetupUser(uc); TestHelper.SetupUser(bc); var build = await bc.CreateBuild(); Assert.True(bc.HttpContext.Response.StatusCode == 200); var user = _serviceProvider.GetRequiredService <IUserAuthenticator>().AuthenticateUser(bc); var bl = await uc.UserBuilds(user.UserId); Assert.True(uc.HttpContext.Response.StatusCode == 200); Assert.True(bl.Contains(build.Id)); await bc.DeleteBuild(build.Id); Assert.True(uc.HttpContext.Response.StatusCode == 200); var bl2 = await uc.UserBuilds(user.UserId); Assert.True(uc.HttpContext.Response.StatusCode == 200); Assert.True(!bl2.Contains(build.Id)); }
public void GivenEmptyProjectName_WhenCallingBuildsByDefinition_ShouldThrowException() { // arrange const string result = "result"; const string status = "status"; const int definitionId = 11; const string buildNumber = "1.2.3.4"; const string definitionName = "The Hill's CI"; IBuildsFactory fakeBuildsFactory = new FakeBuildsFactory(1, new List <Build> { new Build(status, result, buildNumber, DateTime.Today, new Definition(definitionId, definitionName), new RequestedFor("Hank Hill", "http://image.shack.usa/hankhill")) }); IPrivateer privateer = new Privateer(); BuildController controller = privateer.Object <BuildController>(fakeBuildsFactory, new MemoryCache(new MemoryCacheOptions())); // act BadRequestResult badRequestResult = (BadRequestResult)controller.BuildsByDefinition(string.Empty, new List <int> { definitionId }); // assert badRequestResult.Should().BeOfType <BadRequestResult>(); }
public override void Construct(BuildController build) { if (build != this._build) { controller.state = new GoToInteract(controller, CharacterController.Interact.CONSTRUCT, build); } }
private void BuildTower(GameObject towerToBuild) { Instantiate(towerToBuild, _activeBuilder.transform.position, Quaternion.identity); Destroy(_activeBuilder.gameObject); _activeBuilder = null; gameObject.SetActive(false); }
protected virtual void Awake() { blockLayer = 1 << LayerMask.NameToLayer("Block"); buildController = FindObjectOfType<BuildController>(); buildController.InputModeSelected += (sender, args) => { currentBuildMode = args.buildMode; }; cursor = GetComponent<Cursor>(); }
private void Initialize() { CurrentState = State.Idle; _avatarCtrl = AvatarController.GetInstance(); _avatar = _avatarCtrl.Avatar; _avatar.OnSuccsefulEating += () => { Score += 1; }; _avatar.OnDeath += DeathHandler; _buildCtrl = BuildController.GetInstance(); _buildCtrl.SetMeteorController(); _taskCtrl = TaskController.GetInstance(); _taskCtrl.Avatar = _avatar; _taskCtrl.TaskCompleted += (ITask x) => Debug.Log(x); DuringDistanceTask.Avatar = _avatar.transform; _pursuitCtrl = PursuitController.GetInstance(); _pursuitCtrl.AvatarTf = _avatar.transform; _pursuitCtrl.Catched += CatchedHandler; _idGen = new IDGenerator(); _stuff = new SortedDictionary <int, GameObject>(); _mainProvider = new MultiGeneratorProvider(_stuff, _pursuitCtrl, _idGen); _mainProvider.SetIDGenerator(_idGen); _firstCarPos = new Vector2(0, 1); _firstCarDesc = new CarDescriptor(_firstCarPos, 0, 1); _playStats = new PlayStatistics(); _globStats = GlobalStatistics.GetInstance(); // Vehicle.Avatar = _avatar; ProjectileGun.SetAvatar(_avatar); _isInitialized = true; }
// Use this for initialization void Start() { // Update PlayerName, to reflect actual value for players that just joined OnPlayerNameChanged(PlayerName); //Get buildController buildController = GetComponent <BuildController>(); //etc cameraModeToggle = FindObjectOfType <CameraModeToggle>(); cameraController = FindObjectOfType <CameraController>(); guiFacade = GameObject.Find("GUI_Interface").GetComponent <GUIFacade>(); lineRenderer = GetComponent <LineRenderer>(); audioManager = FindObjectOfType <AudioManager>(); //Stop Atmospheric Noise cameraController.ShakeScreen(0.0f, 1.0f, true); //Set max AngularV GetComponent <Rigidbody>().maxAngularVelocity = 1.0f; //Update buildmode accross the board UpdateBuildMode(); //todo setting random name (needed for picking up parts) PlayerName = "Player" + Mathf.RoundToInt(Random.value * 1000000); // All other players if (isLocalPlayer) { return; } Destroy(GetComponent <BuildController>()); // Set the reference for Ship Ship = GetComponent <Ship>(); }
static void BuildAllAssetBundles() { BuildTarget platform = BuildTarget.StandaloneWindows; BuildAssetsBundle(platform); BuildController.LaunchBuild(platform); }
public DestroyState(CharacterController controller, BuildController build) : base(controller) { this.build = build; controller.stateInfo = "Destruct"; controller.IA.isStopped = true; }
private void DrawBuildControls() { EditorGUILayout.LabelField("Build:", _configurationsHeaderStyle); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("All")) { _frameAction += () => BuildController.BuildAll(_buildInfoController, _buildVariantsController, _projectSettingsController); } if (GUILayout.Button("Selected collection")) { _frameAction += () => BuildController.BuildColleciton(_buildInfoController, _buildVariantsController, _projectSettingsController, _buildInfoController.BuildInfo.ActiveVariantCollectionName); } if (GUILayout.Button("Selected variant")) { _frameAction += () => BuildController.BuildVariant(_buildInfoController, _buildVariantsController, _projectSettingsController, _buildInfoController.BuildInfo.SelectedVariantGuid); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); }
private void Awake() { playerBuildingController = GetComponent <PlayerBuildingController>(); buildController = system.GetComponent <BuildController>(); playerBuildingDialog = FindObjectOfType <PlayerBuildingDialog>(); playerBuildingButtons = new List <PlayerBuildingButton>(GetComponentsInChildren <PlayerBuildingButton>()); }
private void reassignGameObjs() { playerControllerObj = GameObject.Find("PlayerController"); playerController = playerControllerObj.GetComponent <PlayerController>(); fleetCombatInfoObj = GameObject.Find("FleetCombatInfo"); fleetCombatInfo = fleetCombatInfoObj.GetComponent <FleetCombatInfo>(); shipChildrenCollect = playerController.GetComponent <ShipChildrenCollect>(); combatCalc = playerController.GetComponent <CombatCalc>(); buildController = buildControllerObj.GetComponent <BuildController>(); // Load in SaveLoad Utility if (slu == null) { sluObj = GameObject.Find("Persistent_SaveLoad_Obj_Menu"); slu = sluObj.GetComponent <SaveLoadUtility>(); if (slu == null) { Debug.Log("[SaveLoadMenu] Start(): Warning! SaveLoadUtility not assigned!"); } } }
void Awake() { Screen.showCursor = false; material = cursor.GetComponentInChildren<Renderer>().material; buildController = GetComponent<BuildController>(); buildController.InputModeSelected += (sender, args) => { currentBuildMode = args.buildMode; if (currentBuildMode == BuildMode.Blast) { material.color = blastColor; } else { material.color = buildColor; } }; buildController.BrushSizeChanged += (sender, args) => { currentBrushSize = args.brushSize; if (currentBrushSize == BrushSize.Normal) { cursor.localScale = Vector3.one; cursor.localPosition = Vector3.zero; } else { cursor.localScale = Vector3.one * 3; cursor.localPosition = Vector3.forward; } }; }
public void closeStockMenu() { if (BuildController.displayingStockMenu()) { BuildController.closeStockMenu(); } }
public override void Collide(BuildController build) { if (build == this._build) { Exit(); } }
private void Start() { buildControllerObj = GameObject.Find("BuildController"); buildController = buildControllerObj.GetComponent <BuildController>(); playerControllerObj = GameObject.Find("PlayerController"); playerController = playerControllerObj.GetComponent <PlayerController>(); }
void Start() { EnemySpawnPoint = FindObjectOfType <StartBlock>().transform; Waypoints = FindObjectsOfType <WaypointNumber>(); _gameController = FindObjectOfType <GameController>(); _buildController = FindObjectOfType <BuildController>(); _soundBarMovement = FindObjectOfType <SoundBarMovement>(); }
private void Start() { LoadMappings(); Instance = this; gameObject.AddComponent <BuildController>(); BuildController = GetComponent <BuildController>(); }
public static BuildController GetInstance() { if (_instance == null) { _instance = new BuildController(); } return(_instance); }
public void SetBuildController(BuildController b) { if (b == null) { Debug.Log("Null BC"); } this.bc = b; }
public void stockMenu() { if (!BuildController.displayingStockMenu()) { BuildController.setID(id); BuildController.displayStockMenu(); } }
void Awake() { if (instance != null) { return; } instance = this; }
private void Awake() { _materials = new List <MaterialGestor>(); _lights = new List <Light>(); LoadMaterialGestor(this.gameObject); _build = GetComponent <BuildController>(); Debug.Log("load Material"); }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(ProfileSavePath)) { return; } BuildController.SaveBuildToFile(ProfileSavePath); }
public void PreviewStatDisplay() { CarComponent component = BuildController.GetComponent(_selectedBlock); CarStats previewStats = UpdateCarStats(component, carStats, true); float accelerationDif = previewStats.acceleration - carStats.acceleration; string acceleration = accelerationDif.ToString(); if (accelerationDif > 0f) { acceleration = acceleration.Insert(0, "+"); } if (acceleration.Length > previewStatDisplayLength) { acceleration = acceleration.Substring(0, previewStatDisplayLength); } PaccelerationText.SetText(acceleration); float speedDif = previewStats.maxSpeed - carStats.maxSpeed; string speed = speedDif.ToString(); if (speedDif > 0f) { speed = speed.Insert(0, "+"); } if (speed.Length > previewStatDisplayLength) { speed = speed.Substring(0, previewStatDisplayLength); } PspeedText.SetText(speed); float breakSpeedDif = previewStats.breakSpeed - carStats.breakSpeed; string breakSpeed = breakSpeedDif.ToString(); if (breakSpeedDif > 0f) { breakSpeed = breakSpeed.Insert(0, "+"); } if (breakSpeed.Length > previewStatDisplayLength) { breakSpeed = breakSpeed.Substring(0, previewStatDisplayLength); } PbreakSpeedText.SetText(breakSpeed); float steeringDif = previewStats.steerSpeed - carStats.steerSpeed; string steering = steeringDif.ToString(); if (steeringDif > 0f) { steering = steering.Insert(0, "+"); } if (steering.Length > previewStatDisplayLength) { steering = steering.Substring(0, previewStatDisplayLength); } PsteeringText.SetText(steering); }
void Awake() { if (InstanceBuildController != null) { Debug.LogError("More than once BuildController in scene!"); } InstanceBuildController = this; }
private void Awake() { if (instance != null) { Debug.LogError("Multiple BuildControllers"); return; } instance = this; }
public ConfigGridControl(IConfigController configController, IExporter[] allExporters, ILocalController localController, BuildController buildController) { _allExporters = allExporters; _localController = localController; _configController = configController; _buildController = buildController; InitializeComponent(); InitializeGrid(); }
// Start is called before the first frame update void Awake() { if (instance != null) { Destroy(this.gameObject); return; } instance = this; }
public void CreateUnit( UnitViewPresenter unitViewPresenter, BaseUnit.UnitCharacteristics unitCharacteristics, Faction faction, BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate ) { unitViewPresenter.faction = faction; unitViewPresenter.GetPlayer( player ); BaseUnitController unitController; if ( unitViewPresenter.unitType == BaseUnit.UnitType.hero ) { unitController = new HeroUnitController( SelectUnit, (HeroViewPresentor)unitViewPresenter, unitCharacteristics, GetUnitTarget, faction, DestroyUnit, _HeroResurrect, setUpdeteCharacteristicsDelegate ); buildController = new BuildController( SelectUnit, buildViewPresenter, unitCharacteristics, GetUnitTarget, faction, DestroyUnit, setUpdeteCharacteristicsDelegate ); } else { unitController = new BaseUnitController( SelectUnit, unitViewPresenter, unitCharacteristics, GetUnitTarget, faction, DestroyUnit, setUpdeteCharacteristicsDelegate ); } if ( faction == Faction.Blue ) { unitsControllersBlue.Add( unitController ); } else { unitsControllersRed.Add( unitController ); } }
void Start() { buildController = GameObject.Find ("BuildController").GetComponent<BuildController> (); }