/// <Summary> /// Set object references to cache them. /// </Summary> void SetObjRef() { gameController = GameObject.FindGameObjectWithTag("GameController"); mapSettings = gameController.GetComponent <MapShowingSettings>(); mapObj = GameObject.Find("MapBase"); mapRt = mapObj.GetComponent <RectTransform>(); pointerRt = gameObject.GetComponent <RectTransform>(); }
/// <Summary> /// Get settings about map from the MapShowingSettings component. /// </Summary> void GetMapSettings() { if (gameController == null) { gameController = GameObject.FindGameObjectWithTag("GameController"); } if (mapSettings == null) { mapSettings = gameController.GetComponent <MapShowingSettings>(); } this.showLengthHorizontal = mapSettings.showLengthHorizontal; this.showLengthVertical = mapSettings.showLengthVertical; this.drawSmoothness = mapSettings.smoothness; }