// Start is called before the first frame update void Start() { forgeInfo = "Pick a part and a material"; defaultColour = infoText.color; resultFunc = Result.GetComponent <ItemFunction>(); WorldCanvas = GameObject.Find("Canvas"); mainCurrency = WorldCanvas.GetComponent <Currency>(); }
public static void Position(RectTransform item, Vector3 worldPos) { item.anchorMin = item.anchorMax = Vector2.zero; Canvas canvas = _instance.GetComponent <Canvas>(); item.transform.SetParent(canvas.transform, false); item.anchoredPosition = canvas.worldCamera.WorldToScreenPoint(worldPos); }
public void InitalizeStage() { DisplayMap.CompressBounds(); Bounds bounds = Instance.DisplayMap.localBounds; stageBounds = bounds; InputManager.Instance.SetCameraBounds(); WorldCanvas.GetComponent <Canvas>().worldCamera = Camera.main; HighlightMap.gameObject.SetActive(false); BattleManager.Initialize(); }