public MockPlaceable(string name, bool allowsXZSnapping, bool allowsYSnapping, float blockThickness, bool isTrigger, bool requiresSomeFoundation, bool canBePlacedAtZeroLevelWithoutFoundation, bool isFullBlock, int maxLengthWithoutSupport, GameObject prefab) : base(name, allowsXZSnapping, allowsYSnapping, prefab, blockThickness, isTrigger, requiresSomeFoundation, canBePlacedAtZeroLevelWithoutFoundation, isFullBlock, maxLengthWithoutSupport) { block = new GameObject(); block.AddComponent <BoxCollider>(); placingAllowedSelector = TimedSelectorWithMaterial.AddTo(block, null, 0f); placingDeniedSelector = TimedSelectorWithMaterial.AddTo(block, null, 0f); }
private void Start() { Get = this; focusHeight = transform.position.z; provinceSelector = TimedSelectorWithMaterial.AddTo(gameObject, LinksManager.Get.ProvinceSelecionMaterial, 0); fogOfWar = TimedSelectorWithMaterial.AddTo(gameObject, LinksManager.Get.FogOfWarMaterial, 0); // //var window = Instantiate(LinksManager.Get.MapOptionsPrefab, LinksManager.Get.CameraLayerCanvas.transform); //window.GetComponent<RectTransform>().anchoredPosition = new Vector2(150f, 150f); tooltip = GetComponent <ToolTipHandler>(); }
public virtual void Show() { if (block == null) // if it's first call to show instantiate block from prefabs { block = UnityEngine.Object.Instantiate(prefab); block.transform.parent = GManager.Get.PlayersHands.transform; placingAllowedSelector = TimedSelectorWithMaterial.AddTo(block, GManager.Get.BuildingAlowedMaterial, 0f); placingDeniedSelector = TimedSelectorWithMaterial.AddTo(block, GManager.Get.BuildingDeniedMaterial, 0f); } block.SetActive(true); EventHandler <EventArgs> handler = Shown; if (handler != null) { handler(this, EventArgs.Empty); } }