Ejemplo n.º 1
0
        public static ReportButton Create()
        {
            GameObject   go     = new GameObject("TrafficReportButton");
            ReportButton report = go.AddComponent <ReportButton>();

            UIView.GetAView().AttachUIComponent(go);

            return(report);
        }
Ejemplo n.º 2
0
        protected override void Awake()
        {
            Log.debug("Create Button");
            toggleButton = ReportButton.Create();
            toggleButton.eventClick += OnButtonToggled;

            Log.debug("Create UI...");
            ui = ReportUI.Create();
            ui.enabled = false;
            ui.absolutePosition = new Vector2(-1000, 0);
            ui.eventHighlightType += (String s) => { SetHighlight(s); };

            Log.debug("Create Analyzer...");
            analyzer = new TrafficAnalyzer();
            analyzer.OnReport += OnGotReport;

            Log.debug("Create Path Controller...");
            paths = new PathController(this);

            Log.info("Load Cursor...");
            m_cursor = CursorInfo.CreateInstance<CursorInfo>();
            m_cursor.m_texture = ResourceLoader.loadTexture("Materials/Cursor.png");
            m_cursor.m_hotspot = new Vector2(0, 0);

            loadingCursor = CursorInfo.CreateInstance<CursorInfo>();
            loadingCursor.m_texture = ResourceLoader.loadTexture("Materials/Hourglass.png");

            Log.info("QueryTool awoken");
            base.Awake();
        }