Exemplo n.º 1
0
        private void Awake()
        {
            s_Instance                   = this;
            m_MinimpaRenderTex           = new RenderTexture(320, 320, 8, RenderTextureFormat.ARGB32);
            m_MinimpaRenderTex.name      = "MinimapRT";
            m_MinimpaRenderTex.hideFlags = HideFlags.DontSave;
            Camera component = m_MapCamera.GetComponent <Camera>();

            component.targetTexture = m_MinimpaRenderTex;
            component.rect          = new Rect(0f, 0f, 1f, 1f);
            m_actionColorHex        = "[" + NGUITools.EncodeColor(m_actionColor) + "]";
            ReadOnlyCollection <BaseObject> objects = LegacyLogic.Instance.WorldManager.Objects;

            foreach (BaseObject p_baseObj in objects)
            {
                CreateSymbolView(p_baseObj);
            }
            OnSpiritBeaconUpdate(null, null);
            OnOptionsChanged(null, null);
            if (!LegacyLogic.Instance.MapLoader.IsLoading && LegacyLogic.Instance.MapLoader.Grid != null)
            {
                OnFinishLoadScene(null, null);
            }
            LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.SPAWN_BASEOBJECT, new EventHandler(OnSpawnBaseObject));
            LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.DESTROY_BASEOBJECT, new EventHandler(OnDestroyBaseObject));
            LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.FINISH_SCENE_LOAD, new EventHandler(OnFinishLoadScene));
            LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.START_SCENE_LOAD, new EventHandler(OnStartSceneLoad));
            LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.SPIRIT_BEACON_UPDATE, new EventHandler(OnSpiritBeaconUpdate));
            LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.OPTIONS_CHANGED, new EventHandler(OnOptionsChanged));
        }
Exemplo n.º 2
0
 private void OnTooltip(Boolean show)
 {
     if (show && MapNote != null)
     {
         TooltipManager.Instance.Show(IngameController.Instance.MapController, (!ConfigManager.Instance.Options.HideMinimapTooltips) ? MinimapView.GetLocalizedSymbolTooltipText(MapNote.Position) : null, MapNote.Note, GUIMainCamera.Instance.camera.ScreenToWorldPoint(Input.mousePosition), new Vector3(5f, 0f, 0f));
     }
     else
     {
         TooltipManager.Instance.Hide(IngameController.Instance.MapController);
     }
 }