/// <summary> /// Does all the initialization that cannot be done when the instance is being created. /// (Controllers may need Game to be initialized already which needs instances of players) /// </summary> public void Init(PlacementController placerNetwork, MoveController moveController, KillController killController, FlyingController flyingController) { this.placerNetwork = placerNetwork; this.moveController = moveController; this.killController = killController; this.flyingController = flyingController; }
public void InstantiateObject(int objectIndex) { PlacementObject obj1 = Instantiate(objects[objectIndex], PlacementController.RayCastToWorld().position + Vector3.one, Quaternion.identity); ButtonController button1 = Instantiate(buttonController); button1.transform.parent = controlPanel.transform; button1.obj = obj1; }
private void Start() { mainCam = Camera.main.transform; PC = GetComponent <PlacementController>(); Cross = GameObject.Find("Cross"); Cross.SetActive(false); WinText.SetActive(false); }
private void Awake() { pc = GetComponent <PlacementController>(); spotlightButton.onClick.AddListener(delegate { BuildSpotlight(); }); mirrorButton.onClick.AddListener(delegate { BuildMirror(); }); generatorButton.onClick.AddListener(delegate { BUildGenerator(); }); }
/// <summary> /// Set the angle of the product. /// </summary> /// <param name="angle">Value must be between 0 and 360.</param> public void SetAngle(int angle) { int fallbackAngle = CurrentAngle; angle = angle % 360; CurrentAngle = angle; PlacementController.placement_rotatePoints(this, fallbackAngle); PlacementController.placement_rotateImg(this); }
void Awake() { store = GetComponent <ObjectStore>(); placement = GetComponent <PlacementController>(); possessed = dummyObject; lookingAt = startingPossession; Possess(); }
public IEnumerator Move(bool value) { yield return(new WaitForSeconds(0.2f)); if (value) { PlacementController.HandleObject(gameObject); } yield break; }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } }
//When the game starts, get connections to both systems private void Start() { BuildingScriptSystem = gameObject.GetComponent <BuildingSystem>(); PlacementScriptSystem = GameObject.Find("PlaceablesPlacementController").GetComponent <PlacementController>(); BuildModeButton = GameObject.Find("ButtonSystemSwitcherBuilding"); PlaceableModeButton = GameObject.Find("ButtonSystemSwitcherPlacing"); SwitchToBuildMode(true); }
// Start is called before the first frame update void Start() { _cityPlaceable = GetComponent <CityPlaceable>(); GameHandler gameHandler = FindObjectOfType <GameHandler>(); _placementController = (PlacementController)gameHandler.PlacementController; _buildingManager = (BuildingManager)gameHandler.BuildingManager; _streetData = Resources.Load <BuildingData>(Util.PathTo("Street")); generationRoutine = StartCoroutine(GenerateCity(seed, maxCityProgress, _streetLengthMinMax, buildingProbability)); }
public ProductAdding(MainFrame hoofdscherm) { this.hoofdscherm = hoofdscherm; InitializeComponent(); Invalidate(); //Needs to be after initializeComponents to prevent NULL errors controller = new PlacementController(hoofdscherm, this); //Invalidate(); }
/// <summary> /// Method called on application start /// </summary> private void Awake() { ARCanvas._actualARCanvas = this; this._placementController = PlacementControllerGO.GetComponent <PlacementController>(); this._dialogWindow = this.GetComponentInChildren <DialogWindow>(true); this._circleController = this.GetComponentInChildren <CircleController>(true); this._precisePoistioningComponent = this.GetComponentInChildren <PrecisePositioningComponent>(true); var waitingForSurfaceLabelGO = this.transform.Find("WaitingForSurfaceLabel").gameObject; var backButtonGO = this.transform.Find("BackButton").gameObject; var pickUpButtonGO = this.transform.Find("PickUpModelButton").gameObject; var showDoorsButtonGO = this.transform.Find("ShowDoorsButton").gameObject; var hideDoorButtonGO = this.transform.Find("HideDoorsButton").gameObject; var showCoversButtonGO = this.transform.Find("ShowCoversButton").gameObject; var hideCoversButtonGO = this.transform.Find("HideCoversButton").gameObject; var showPrecisePositioningButtonGO = this.transform.Find("ShowPreciseButton").gameObject; var hidePrecisePositioningButtonGO = this.transform.Find("HidePreciseButton").gameObject; var loadingPageGO = this.transform.Find("LoadingPage").gameObject; this._scaleLabelGO = this.transform.Find("ScaleLabel").gameObject; var scaleLabelTextGO = _scaleLabelGO.transform.Find("Label").gameObject; this._waitingForSurfaceLabel = waitingForSurfaceLabelGO.GetComponent <TextMeshProUGUI>(); this._goBackButton = backButtonGO.GetComponent <ClickableImage>(); this._pickUpModelButton = pickUpButtonGO.GetComponent <ClickableImage>(); this._showDoorsButton = showDoorsButtonGO.GetComponent <ClickableImage>(); this._hideDoorsButton = hideDoorButtonGO.GetComponent <ClickableImage>(); this._showCoversButton = showCoversButtonGO.GetComponent <ClickableImage>(); this._hideCoversButton = hideCoversButtonGO.GetComponent <ClickableImage>(); this._showPrecisePositioningButton = showPrecisePositioningButtonGO.GetComponent <ClickableImage>(); this._hidePrecisePositioningButton = hidePrecisePositioningButtonGO.GetComponent <ClickableImage>(); this._loadingPage = loadingPageGO.GetComponent <LoadingPage>(); this._waitingForSurfaceLabel.text = Translator.GetTranslation("WaitingForSurfaceLabel.ContentText"); this._scaleLabelText = scaleLabelTextGO.GetComponent <TextMeshProUGUI>(); this._scaleLabelText.text = _getScaleLabelTranslationText(); //Disable screen dimming Screen.sleepTimeout = SleepTimeout.NeverSleep; }
void Awake() { hostile = GetComponent <HostileController>(); store = GetComponent <ObjectStore>(); placement = GetComponent <PlacementController>(); possession = GetComponent <PossessionHandler>(); office = GameObject.Find("LeMinotaure").GetComponent <OfficeController>(); foreach (PulseController pC in startingControllers) { pulseControllers.Add(pC); } screenCentreH = Screen.height / 2; screenCentreW = Screen.width / 2; }
/// <summary> /// Turns the product a set amount of degrees. /// </summary> /// <param name="value">Amount of added degrees</param> public void AddAngle(int value) { int fallbackAngle = CurrentAngle; CurrentAngle += value; while (CurrentAngle > 359) { CurrentAngle -= 360; } while (CurrentAngle < 0) { CurrentAngle += 360; } PlacementController.placement_rotatePoints(this, fallbackAngle); PlacementController.placement_rotateImg(this); }
void Awake() { #if !UNITY_EDITOR fingerID = 0; #endif instance = this; if (PlayerPrefs.HasKey("numOfPlacableObjects")) { // we had a previous session numOfPlacableObjects = PlayerPrefs.GetInt("numOfPlacableObjects", 5); } else { SavePrefs(); } }
void Start() { ContextProvider context; playerObjectPool = new PlayerObjectPool(); BuildChoiceUpdater buildChoiceUpdater = new BuildChoiceUpdater(); placementController = new PlacementController(playerObjectPool, buildChoiceUpdater); UnitBuildChoiceProvider unitBuildChoiceProvider = new UnitBuildChoiceProvider(placementController); InfantryManager infantryManager = new InfantryManager(unitBuildChoiceProvider); context = new ContextProvider(this, playerObjectPool, buildChoiceUpdater, infantryManager); selectionController = new SelectionController(context); selectedGroupController = new SelectedGroupController(context); IBuildingManager playerBaseManager = new PlayerBaseManager(context); placementController.RegisterBuildingManager(playerBaseManager); playerObjectPool.RegisterSelectableObjectContainer(playerBaseManager); unitBuildChoiceProvider.RegisterBloodBuildable(playerBaseManager); IBuildingManager barracksManager = new BarracksManager(context); placementController.RegisterBuildingManager(barracksManager); playerObjectPool.RegisterSelectableObjectContainer(barracksManager); unitBuildChoiceProvider.RegisterBloodBuildable(barracksManager); playerObjectPool.RegisterSelectableObjectContainer(infantryManager); Camera.main.gameObject.AddComponent <PCCameraController>(); GameObject hud = SetupHUD(); PlayerResources.GetInstance().RegisterListener(hud.GetComponent <BloodCounterHUD>()); PlayerResources.GetInstance().RegisterListener(buildChoiceUpdater); buildChoiceUpdater.RegisterBuildChoiceChangeListener(hud.GetComponent <ActionsMenuHUD>()); }
/// <summary> /// Resets the images, in the case that the products are updated /// </summary> public void ResetImage() { DefaultBitMap = new Bitmap(Product.Width, Product.Length); Graphics gfx = Graphics.FromImage(DefaultBitMap); // check if this product is an subcategory and get the color Color color = PlacementController.GetMainCategoryColorIfNeeded(Product.ProductCategory.CatId); SolidBrush brush = new SolidBrush(color); gfx.FillRectangle(brush, 0, 0, Product.Width, Product.Length); DefaultBitMap = new Bitmap(PlacementController.ResizeImage(DefaultBitMap, Product.Width, Product.Length)); //MessageBox.Show(String.Format("Name: {0} -- Width: {1} -- Length: {2}", product.Name, product.Width, product.Length)); try { RotatedMap.Dispose(); } catch { } RotatedMap = new Bitmap(DefaultBitMap, DefaultBitMap.Width, DefaultBitMap.Height); //MessageBox.Show(String.Format("Name: {0} -- Width: {1} -- Length: {2}", "Rotated Map", product.Width, product.Length)); SetAngle(CurrentAngle); }
/// <summary> /// Awake is being used to initialize all the reference the class needs, /// and to bring it to an initial state. /// </summary> private void Awake() { //Get controllers _placementController = GetComponent <PlacementController>(); _selectionController = GetComponent <SelectionController>(); _waveSpawner = GetComponent <WaveSpawner>(); _uiController = GetComponent <UIController>(); // initial game state gameState = GameState.Running; gameMode = (GameMode)PlayerPrefs.GetInt("GameMode"); _inputMode = InputMode.Play; _currentPlacingTower = -1; _currentlySelectedObject = null; moneyCount = initialMoneyCount; // initial UI Elements _uiController.SetLifeCountText(ownBase.health.ToString()); _uiController.SetWaveCountText(_countdownWave.ToString()); _uiController.SetMoneyCountText(moneyCount.ToString()); }
public void knowYourController(PlacementController pc) { placementController = pc; }
void Awake() { main = this; }
private void Start() { curHealth = totalHealth; placementController = transform.parent.parent.GetComponent <PlacementController>(); }
public override IBuildAction GetBuildAction(PlacementController placementController) { return(new BuildBuildingAction(placementController, this)); }
public BuildBuildingAction(PlacementController placementController, IBuildingManager buildingManager) { this.placementController = placementController; this.buildingManager = buildingManager; }
void Start() { instance = this; }
// Start is called before the first frame update void Start() { meshRenderers = GetComponentsInChildren <MeshRenderer>(); ChangeColor(); placementController = FindObjectOfType <PlacementController>(); }
public abstract IBuildAction GetBuildAction(PlacementController placementController);
// Start is called before the first frame update void Start() { Screen.orientation = ScreenOrientation.Portrait; placementController = placementBase.GetComponent <PlacementController>(); LoadingPage_Panel.SetActive(true); HomePage_Panel.SetActive(false); StartCoroutine(StartLoading()); DescriptionCamera.SetActive(true); PlaneTrackingCamera.SetActive(false); ImageTracking_1_Camera.SetActive(false); ImageTracking_2_Camera.SetActive(false); Item_1_Refrigerator.SetActive(false); Item_2_TV_TableTop.SetActive(false); Item_3_Sofa.SetActive(false); Item_4_Table.SetActive(false); Item_5_TV_WallMount.SetActive(false); Item_6_Watch.SetActive(false); Item_7_Statue.SetActive(false); DescriptionPage_Item_1.SetActive(false); DescriptionPage_Item_2.SetActive(false); DescriptionPage_Item_3.SetActive(false); DescriptionPage_Item_4.SetActive(false); DescriptionPage_Item_5.SetActive(false); DescriptionPage_Item_6.SetActive(false); DescriptionPage_Item_7.SetActive(false); TryARPage_Item_1.SetActive(false); TryARPage_Item_2.SetActive(false); TryARPage_Item_3.SetActive(false); TryARPage_Item_4.SetActive(false); TryARPage_Item_5.SetActive(false); TryARPage_Item_6.SetActive(false); TryARPage_Item_7.SetActive(false); PlaneTrackingLoading_Panel.SetActive(false); Item_1_Refrigerator.GetComponent <LeanTwistRotateAxis>().enabled = false; Item_2_TV_TableTop.GetComponent <LeanTwistRotateAxis>().enabled = false; Item_3_Sofa.GetComponent <LeanTwistRotateAxis>().enabled = false; Item_4_Table.GetComponent <LeanTwistRotateAxis>().enabled = false; Item_5_TV_WallMount.GetComponent <LeanTwistRotateAxis>().enabled = false; Item_6_Watch.GetComponent <LeanTwistRotateAxis>().enabled = false; Item_7_Statue.GetComponent <LeanTwistRotateAxis>().enabled = false; Item_1_Refrigerator.GetComponent <LeanDragTranslate>().enabled = false; Item_2_TV_TableTop.GetComponent <LeanDragTranslate>().enabled = false; Item_3_Sofa.GetComponent <LeanDragTranslate>().enabled = false; Item_4_Table.GetComponent <LeanDragTranslate>().enabled = false; Item_5_TV_WallMount.GetComponent <LeanDragTranslate>().enabled = false; Item_6_Watch.GetComponent <LeanDragTranslate>().enabled = false; Item_7_Statue.GetComponent <LeanDragTranslate>().enabled = false; Item_1_Refrigerator_Transform = Item_1_Refrigerator.transform; Item_2_TV_TableTop_Transform = Item_2_TV_TableTop.transform; Item_3_Sofa_Transform = Item_3_Sofa.transform; Item_4_Table_Transform = Item_4_Table.transform; Item_5_TV_WallMount_Transform = Item_5_TV_WallMount.transform; Item_6_Watch_Transform = Item_6_Watch.transform; Item_7_Statue_Transform = Item_7_Statue.transform; }
public UnitBuildChoiceProvider(PlacementController placementController) { bloodBuildables = new List <IBuildableByBlood>(); this.placementController = placementController; }
public void Move(bool xAxis) { PlacementController.placement_Move(this, xAxis); }