예제 #1
0
        public void Awake()
        {
            try
            {
                if (_esc == null)
                {
                    _esc = GameObject.Find("Esc").GetComponent <UIButton>();
                    ModProperties.Instance.ControlPanelDefaultPositionX = _esc.absolutePosition.x - 336f;
                    ModProperties.Instance.ControlPanelDefaultPositionY = _esc.absolutePosition.y;

                    ModProperties.Instance.InfoPanelDefaultPositionX = ModProperties.Instance.ControlPanelDefaultPositionX + 70f;
                    ModProperties.Instance.InfoPanelDefaultPositionY = ModProperties.Instance.ControlPanelDefaultPositionY;
                }

                if (_measureTool == null)
                {
                    _measureTool = MeasureTool.Instance;
                }

                if (_netTool == null)
                {
                    _netTool = FindObjectOfType <NetTool>();
                }
            }
            catch (Exception e)
            {
                Debug.Log("[Measure It!] ModManager:Awake -> Exception: " + e.Message);
            }
        }
예제 #2
0
        public void Initialize(MeasureTool measureTool, NetTool netTool)
        {
            try
            {
                _terrainManager = Singleton <TerrainManager> .instance;

                _measureTool = measureTool;
                _netTool     = netTool;

                _controlPointCountField = netTool.GetType().GetField("m_controlPointCount", BindingFlags.NonPublic | BindingFlags.Instance);
                _controlPointsField     = netTool.GetType().GetField("m_controlPoints", BindingFlags.NonPublic | BindingFlags.Instance);
            }
            catch (Exception e)
            {
                Debug.Log("[Measure It!] MeasureInfo:Initialize -> Exception: " + e.Message);
            }
        }