private void OnMouseExit() { if (!BuildUI.IsReadyToBuild()) { renderer.material.color = startColor; } }
protected override void Awake() { base.Awake(); if (!fireButton) { fireButton = transform.Find("FireButton").gameObject; } if (!gameOverUI) { gameOverUI = transform.Find("GameOverUI").gameObject; } if (!joystick) { joystick = transform.Find("Joystick").gameObject; } if (!pauseUI) { pauseUI = transform.Find("PauseUI").gameObject; } if (!winUI) { winUI = transform.Find("WinGameUI").gameObject; } if (!buildCanvasUI) { buildCanvasUI = FindObjectOfType <BuildUI>(); } if (!plantCanvasUI) { plantCanvasUI = FindObjectOfType <PlantUI>(); } }
private void OnMouseEnter() { if (!BuildUI.IsReadyToBuild()) { renderer.material.color = Color.yellow; } }
public void Construct(UIFactory uiFactory, BuildUI buildUI, BuildSystem buildSystem, PlayerResources playerResources) { this.uiFactory = uiFactory; this.buildUI = buildUI; this.buildSystem = buildSystem; this.playerResources = playerResources; }
private void Awake() { instance = this; Disable(null); foreach (var button in buttons) { button.SetTooltipObject(tooltip); } }
void Start() { if (buildManager != null) { Debug.Log("MULTIPLE BUILD MANAGERS!!!"); return; } buildManager = this; buildUI = buildUIObject.GetComponent <BuildUI>(); }
void Awake() { GameObject globalUis = GameObject.Find(Global.UI_CONTAINER); if (globalUis == null) { throw new System.Exception($"Can't find global UIs Game Object named : {Global.UI_CONTAINER}"); } this.buildUI = globalUis.GetComponentsInChildren <BuildUI>().First(); }
public void Down() { if (MoneyHandler.Money >= tower.GetTowerCost()) { MoneyHandler.RemoveMoney(this.tower.GetTowerCost()); GameObject tower = Instantiate(this.tower.GetTowerPrefab(), towerPlace.position, Quaternion.identity); tower.transform.parent = towerPlace; towerPlace.gameObject.GetComponent <TowerPlace>().TowerIsBuild(); BuildUI.ChangeBuildBool(); BuildUI.DestroyUI(); } }
static void Postfix(BuildUI __instance) { try { // Custom Building foreach (BuildingInfo info in BuildingHelper.buildingsToRegister) { object[] tabs = BuildingHelper.getTabByName(info.tabCategory); BuildUI.inst.AddBuilding((BuildTab)(tabs[0]), (BuildTabVR)(tabs[1]), info.uniqueName, info.preqBuilding, info.buildingButtonSize); } }catch (Exception err) { helper.Log(err.ToString()); } }
private void OnMouseDown() { if (!BuildUI.IsReadyToBuild() && !isClicked && isFree) { BuildUI.CreateTowerBuildUI(this.transform); isClicked = true; BuildUI.ChangeBuildBool(); } else if (BuildUI.IsReadyToBuild() && isClicked && isFree) { BuildUI.DestroyUI(); isClicked = false; BuildUI.ChangeBuildBool(); } }
private bool BuildItemIsPicked <StoreSectionType>(ItemID targetItem, int storeSectionIndex) where StoreSectionType : StoreSection { MenuManager menuManager = GameManager.Instance.m_menuManager; BuildUI buildUI = GameManager.Instance.BuildUI; // Get the store section that manages the placement of the target item StoreSectionType storeSection = buildUI.GetComponentInChildren <StoreSectionType>(true); // Freeze until the menu is in store, the store section is picked and the item selected is the target item if (storeSection.SelectedItem != null) { return(menuManager.IsInStore && buildUI.StoreSectionIndexPicker.FirstValuePicked == storeSectionIndex && storeSection.SelectedItem.ItemID == targetItem); } else { return(false); } }
void Start() { selecter = GameObject.Find("Script Manager").GetComponent <BuildUI>(); index = gameObject.transform.GetSiblingIndex(); }
public static void Main() { BuildUI.Run(); }
static void Main(string[] args) { BuildUI.Run(); }
void StartMarkedUI() { List <string> uiScenePrefabList = new List <string>(); StringBuilder sb = new StringBuilder(); foreach (AssetItem item in m_listEnum) { if (item.IsChecked) { if (m_ChooseUI) { uiScenePrefabList.Add(item.AssetName); } sb.Append(item.AssetName); sb.Append("|"); } } PlayerPrefs.DeleteKey(UIScenePrefs); PlayerPrefs.DeleteKey(UIPrefs); PlayerPrefs.DeleteKey(TexturePrefs); PlayerPrefs.SetString(UIScenePrefs, sb.ToString()); PlayerPrefs.SetInt(UIPrefs, m_ChooseUI ? 1: 0); PlayerPrefs.SetInt(TexturePrefs, m_ChooseTexture ? 1 : 0); List <string> specialList = new List <string>(); List <string> prefabList = new List <string>(); if (m_ChooseTexture) { List <string> uiTxtSrcDirList = new List <string>(); uiTxtSrcDirList.Add(AssetBundlePath.SpecialTexBasicAssetDir); #if !PACKAGE_BASIC uiTxtSrcDirList.Add(AssetBundlePath.SpecialTexAssetDir); #endif foreach (string specialDir in uiTxtSrcDirList) { if (Directory.Exists(specialDir)) { BuildAssetList(specialDir, specialList, AssetBundleType.Texture, m_strTexture); } else { Debug.Log("path is not exist: " + specialDir); } } } List <string> uiPrefabSrcDirList = new List <string>(); uiPrefabSrcDirList.Add(AssetBundlePath.PrefabBasicAssetDir); #if !PACKAGE_BASIC uiPrefabSrcDirList.Add(AssetBundlePath.PrefabAssetDir); #endif foreach (string uiPrefabDir in uiPrefabSrcDirList) { if (Directory.Exists(uiPrefabDir)) { BuildAssetList(uiPrefabDir, prefabList, AssetBundleType.Pre, string.Empty); } else { Debug.Log("path is not exist: " + uiPrefabDir); } } BuildUI.ProcUIScene(specialList, uiScenePrefabList, prefabList); }