protected void CreateMiniMap() { MiniMap = new MiniMap { anchored = true, maxWidth = 200, maxHeight = 100, visible = false }; Add(MiniMap); }
protected override void OnInitialized() { base.OnInitialized(); UpdateLabel(); Add(new IMGUIContainer(UpdateLabel)); MiniMap miniMap = new MiniMap(); miniMap.SetPosition(new Rect(10, 10, 200, 200)); Add(miniMap); miniMap.MarkDirtyRepaint(); ToolbarToggle tglMiniMap = new ToolbarToggle() { text = "MiniMap" }; tglMiniMap.RegisterValueChangedCallback(e => { miniMap.visible = e.newValue; }); tglMiniMap.value = true; GraphWindow.Toolbar.AddToggleToLeft(tglMiniMap, 80); // 添加模拟节点 // 模拟节点所有的世界状态 }
public IEnumerator MiniMapElementCanBeDragged() { Vector2 worldNodePos = graphView.contentViewContainer.LocalToWorld(k_MinimapRect.position); Vector2 start = worldNodePos + k_SelectionOffset; Vector2 offset = new Vector2(10, 10); // Move the minimap element. helpers.MouseDownEvent(start); yield return(null); Vector2 end = start + offset; helpers.MouseDragEvent(start, end); yield return(null); helpers.MouseUpEvent(end); yield return(null); MiniMap minimap = graphView.Q <MiniMap>(); Assert.AreEqual(k_MinimapRect.x + offset.x, minimap.layout.x); Assert.AreEqual(k_MinimapRect.y + offset.y, minimap.layout.y); yield return(null); }
// Start is called before the first frame update void Start() { // Input GameObject _inControl = Instantiate(inControl); // Set up the cameras GameObject _mainCamera = Instantiate(mainCamera); CinemachineVirtualCamera _cinemachineVCam = Instantiate(cinemachineVCam).GetComponent <CinemachineVirtualCamera>(); _cinemachineVCam.m_Follow = this.transform; _cinemachineVCam.m_LookAt = this.gameObject.GetComponentInChildren <CameraTarget>().transform; GameObject _miniMapCamera = Instantiate(miniMapCamera); MiniMap _miniMap = _miniMapCamera.GetComponent <MiniMap>(); _miniMap.player = this.gameObject.transform; // Set up the player UI GameObject _playerUI = Instantiate(playerUI); // Reference the player UI in the quest manager if (GameObject.FindObjectOfType <QuestController>()) { GameObject.FindObjectOfType <QuestController>().playerUIManager = _playerUI.GetComponent <PlayerUIManager>(); } // Instantiate post processing GameObject _pp = Instantiate(postProcessing); }
protected internal virtual void UpdateMiniMap(SCMap map) { var miniMap = new MiniMap() { EnableScrolling = false, EnableZooming = false, SetMapCenterOnClick = false }; if (Alignment > 0) { miniMap.Alignment = (DevExpress.XtraMap.MiniMapAlignment)Alignment; } if (Width.HasValue) { miniMap.Width = Width.Value; } if (Height.HasValue) { miniMap.Height = Height.Value; } if (ZoomLevel != 1.0 || CenterPoint != null) { var behavior = new FixedMiniMapBehavior(); if (CenterPoint != null) { if (CenterPoint.Length != 2) { throw new Exception("CenterPoint shall be a double array with 2 elements."); } behavior.CenterPoint = map.CreateCoordPoint(CenterPoint[0], CenterPoint[1]); } if (ZoomLevel != 1.0) { behavior.ZoomLevel = ZoomLevel; } miniMap.Behavior = behavior; } var backColor = Utils.ColorFromString(BackColor); if (backColor != Color.Empty) { miniMap.ViewportStyle.Fill = backColor; } var strokeColor = Utils.ColorFromString(StrokeColor); if (strokeColor != Color.Empty) { miniMap.ViewportStyle.Stroke = strokeColor; } map.Map.MiniMap = miniMap; map.Map.PrintOptions.PrintMiniMap = true; }
// Use this for initialization public void Init(string system, string planetName, int radius, MiniMap minimap) { this.outline = this.gameObject.GetComponent <Outline>(); this.myCollider = this.gameObject.GetComponent <Collider>(); this.myRenderer = this.gameObject.GetComponent <Renderer>(); this.radius = radius; this.angle = Mathf.Asin(this.gameObject.transform.position.x / radius); this.speed = (2 * Mathf.PI) / Random.Range(radius * 2, radius * 5); if (PlayerPrefs.HasKey(system + "." + planetName)) { this.isMined = PlayerPrefs.GetInt(system + "." + planetName, 0) == 1; } else { PlayerPrefs.SetInt(system + "." + planetName, 0); } if (this.isMined) { this.myCollider.enabled = false; this.outline.color = 2; this.myRenderer.sharedMaterial = disabledState; } this.planetName = planetName; this.minimapObj = minimap.InitPlanet(this.gameObject, this.isMined); this.minimap = minimap; }
public void CreateSteps(MiniMap miniMap, GameObject[] steps, int mapsize) { Point p = new Point(); Point p_s = new Point(); Point p_result = new Point(); int result = 0; int tmp = 0; for (int i = 0; i < mapsize; i++) { for (int j = 0; j < mapsize; j++) { if (miniMap[i, j] != null) { if (miniMap[i, j].isSource == true) { p_s.x = i; p_s.y = j; } } } } for (int i = 0; i < mapsize; i++) { for (int j = 0; j < mapsize; j++) { if (miniMap[i, j] != null) { p.x = i; p.y = j; tmp = Math.Abs(p_s.x - p.x) + Math.Abs(p_s.y - p.y); if (result < tmp) { result = tmp; p_result.x = p.x; p_result.y = p.y; } } } } miniMap[p_result.x, p_result.y].isStep = true; int point = 0; for (int i = 0; i < mapsize; i++) { for (int j = 0; j < mapsize; j++) { if (miniMap[i, j] != null) { if (miniMap[i, j].isStep == true) { steps[point].SetActive(true); } } point++; } } }
private static MiniMap GetOrCreateMiniMap(string mapID) { var go = GameObject.Find("MiniMap"); if (go == null) { go = new GameObject(); go.name = "MiniMap"; } MiniMap miniMap = go.GetComponent <MiniMap> (); if (miniMap == null) { miniMap = go.AddComponent <MiniMap> (); miniMap.mapId = mapID; } if (EXPORT_DIR == null) { string exportDir = Application.dataPath + "/Res/MiniMap/"; if (!Directory.Exists(exportDir)) { Directory.CreateDirectory(exportDir); } EXPORT_DIR = exportDir; } return(miniMap); }
public static void NewGame() { Objects = new List <GameObject> (); Map = new Tile[MAP_WIDTH, MAP_HEIGHT]; Log = new List <Message>(); abilityGUI = new AbilityGUI(); statusGUI = new StatusGUI(); equipmentGUI = new EquipmentGUI(5); inventoryGUI = new InventoryGUI(); Map = MapMaker.MakeTunnelMap(false); miniMap = new MiniMap(30, 20, Map); PlayerObject = new GameObject(StartPosition.x, StartPosition.y, "hero", 120, 200, (int)(0.05 * Game1.WIDTH - 124.21), (int)(0.61 * Game1.HEIGHT - 670)); PlayerObject.Player = new Player(10); PlayerObject.Player.Owner = PlayerObject; PlayerObject.Fighter = new Fighter(2, 5, 0, 0); PlayerObject.Fighter.Owner = PlayerObject; Objects.Add(PlayerObject); DeathScreen.OnStart(); Started = true; ToRemove = new List <GameObject>(); GoToPlaying(); //Console.Out.WriteLine(PlayerObject.x.ToString() + ";" + PlayerObject.y.ToString()); //Console.Out.WriteLine("Position : " + PlayerObject.Position.x.ToString() + ";" + PlayerObject.Position.y.ToString()); //Console.Out.WriteLine("InventoryWidth:" + InventoryWidth.ToString()); }
private void Awake() { Camera.main.orthographicSize = 5; player = GameObject.Find("Player"); miniMap = GameObject.Find("MiniMap").GetComponent <MiniMap>(); }
/// <summary> /// Prepares the window elements. /// </summary> private void InitializeGraphView() { // Set the root elements flex direction rootVisualElement.style.flexDirection = FlexDirection.Column; // Create the window elements rootVisualElement.Add(GenerateToolbar()); _graphView = GenerateGraphView(); rootVisualElement.Add(_graphView); _miniMap = GenerateMiniMap(); _graphView.Add(_miniMap); blackboardProvider = new BlackboardProvider(_graphView); _graphView.Add(blackboardProvider.Blackboard); // Get the data utility so we can save and load. dialogueGraphDataUtility = new DialogueGraphDataUtility(_graphView); if (dialogueContainer != null) { dialogueGraphDataUtility.LoadGraph(dialogueContainer, blackboardProvider); } }
public IEnumerator MiniMapElementCanBeDragged() { MarkGraphViewStateDirty(); yield return(null); MiniMap minimap = graphView.SafeQ <MiniMap>(); Vector2 start = minimap.worldBound.center; Vector2 offset = new Vector2(10, 10); // Move the minimap element. helpers.MouseDownEvent(start); yield return(null); Vector2 end = start + offset; helpers.MouseDragEvent(start, end); yield return(null); helpers.MouseUpEvent(end); yield return(null); Assert.AreEqual(k_MinimapRect.x + offset.x, minimap.layout.x); Assert.AreEqual(k_MinimapRect.y + offset.y, minimap.layout.y); yield return(null); }
public override void SetUp() { base.SetUp(); m_Node1 = new Node(); m_Node1.SetPosition(new Rect(0, 0, 200, 200)); m_Node1.style.width = 200; m_Node1.style.height = 200; m_Node1.title = "Node 1"; graphView.AddElement(m_Node1); var outputPort = m_Node1.InstantiatePort(Orientation.Horizontal, Direction.Output, Port.Capacity.Multi, typeof(float)); m_Node1.outputContainer.Add(outputPort); m_Node1.RefreshPorts(); m_Node2 = new Node(); m_Node2.SetPosition(new Rect(300, 300, 200, 200)); m_Node2.style.width = 200; m_Node2.style.height = 200; m_Node2.title = "Node 2"; graphView.AddElement(m_Node2); var inputPort = m_Node2.InstantiatePort(Orientation.Horizontal, Direction.Input, Port.Capacity.Single, typeof(float)); m_Node2.inputContainer.Add(inputPort); m_Node2.RefreshPorts(); // Add the minimap. var miniMap = new MiniMap(); miniMap.SetPosition(new Rect(10, 100, 100, 100)); miniMap.maxWidth = 100; miniMap.maxHeight = 100; graphView.Add(miniMap); }
// Use this for initialization void Start() { map = GetComponentInParent <MiniMap>(); myRectTransform = GetComponent <RectTransform>(); //omponent().anchoredPosition; // player = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>(); }
//!Definiuję minimapę grafu. private void createMinimap() { MiniMap minimap = new MiniMap(); minimap.anchored = true; minimap.SetPosition(new Rect(10, 30, 200, 150)); view.Add(minimap); }
private void GenerateMiniMap() { var miniMap = new MiniMap(); miniMap.anchored = true; miniMap.SetPosition(new Rect(10, 30, 200, 140)); _graphView.Add(miniMap); }
void Awake() { stage = 1; mapsize = 0; fscore = 10000; miniMap = minimapGenerator.Generate(stage); mapsize = minimapGenerator.Mapsize(stage); }
public override void Draw(double frameTime) { AEntity player = WorldModel.Entities.GetPlayerEntity(); Position3D center = player.Position; if ((player as Mobile).IsAlive) { AEntityView.s_Technique = Techniques.Default; m_ShowingDeathEffect = false; if (m_YouAreDead != null) { m_YouAreDead.Dispose(); m_YouAreDead = null; } } else { if (!m_ShowingDeathEffect) { m_ShowingDeathEffect = true; m_DeathEffectTime = 0; m_LightingGlobal = Isometric.Lighting.OverallLightning; m_LightingPersonal = Isometric.Lighting.PersonalLightning; m_UI.AddControl(m_YouAreDead = new YouAreDeadGump(), 0, 0); } double msFade = 2000d; double msHold = 1000d; if (m_DeathEffectTime < msFade) { AEntityView.s_Technique = Techniques.Default; Isometric.Lighting.OverallLightning = (int)(m_LightingGlobal + (0x1f - m_LightingGlobal) * ((m_DeathEffectTime / msFade))); Isometric.Lighting.PersonalLightning = (int)(m_LightingPersonal * (1d - (m_DeathEffectTime / msFade))); } else if (m_DeathEffectTime < msFade + msHold) { Isometric.Lighting.OverallLightning = 0x1f; Isometric.Lighting.PersonalLightning = 0x00; } else { AEntityView.s_Technique = Techniques.Grayscale; Isometric.Lighting.OverallLightning = (int)m_LightingGlobal; Isometric.Lighting.PersonalLightning = (int)m_LightingPersonal; if (m_YouAreDead != null) { m_YouAreDead.Dispose(); m_YouAreDead = null; } } m_DeathEffectTime += frameTime; } Isometric.Update(Model.Map, center, Model.Input.MousePick); MiniMap.Update(Model.Map, center); }
void xd(MiniMap miniMap) { if (tileMap.GetTile(tileMap.WorldToCell(miniMap.newTrans)) == null) { print("XD"); tileMap.SetTile(miniMap.cellPos, miniMap.currentTile); SaveMap(miniMap.currentTile, miniMap.cellPos); } }
private void TeleportToWaypoint() { if (!m_isWaypointPlaced) { return; } Player.Instance.Teleport(MiniMap.MapPosToWorldPos(m_waypointMapPos)); }
private void Dispose(bool disposing) { if (disposing) { Map.Dispose(); MiniMap.Dispose(); PageMiniMap.Dispose(); } }
public UniversalToolbarView(BaseGraphView graphView, MiniMap miniMap, BaseGraph baseGraph) : base(graphView) { m_MiniMap = miniMap; //默认隐藏小地图,防止Graph内容过多而卡顿 m_MiniMap.visible = false; m_BaseGraph = baseGraph; m_BaseGraphView = graphView; }
public Engine(MapWindow mapWindow) { MapWindow = mapWindow; Generator = mapWindow.Generator; Player = new World.Player(this); KeyboardInput = new KeyboardInput(this); Camera = new Camera(this); MiniMap = new MiniMap(new Vector(200, 200), this); }
/// <summary> /// Creates a default mini map. /// </summary> /// <returns>Returns a default mini map to add to the DialogueGraphView.</returns> private MiniMap GenerateMiniMap() { var miniMap = new MiniMap { visible = _miniMapEnabled }; Vector2 coords = _graphView.contentViewContainer.WorldToLocal(new Vector2(this.maxSize.x - 10, 30)); miniMap.SetPosition(new Rect(coords.x, coords.y, 200, 140)); return(miniMap); }
// TODO Doesnt work atm :)) private void GenerateMiniMap() { MiniMap minimap = new MiniMap { anchored = true }; Vector2 coords = _graphView.contentViewContainer.WorldToLocal(new Vector2(this.maxSize.x - 10, 30)); minimap.SetPosition(new Rect(coords.x, coords.y, 200, 140)); _graphView.Add(minimap); }
//private void GenerateToolbar() //{ // var toolbar = new Toolbar(); // toolbar.Add(new ToolbarButton(() => Save()) { text = "Save" }); // rootVisualElement.Add(toolbar); //} private void GenerateMiniMap() { var miniMap = new MiniMap { anchored = true }; var cords = graphView.contentViewContainer.WorldToLocal(new Vector2(this.position.width - 210, this.position.height - 150)); miniMap.SetPosition(new Rect(cords.x, cords.y, 200, 140)); graphView.Add(miniMap); }
void Awake() { if(instance == null){ instance = this; isDraw = false; draw2D = new UtilDraw2D(); }else{ Destroy( this ); } }
private void GenerateMiniMap() { var miniMap = new MiniMap { anchored = true }; var coords = m_dialogueGraphView.contentViewContainer.WorldToLocal(new Vector2(maxSize.x - 10, 30)); miniMap.SetPosition(new Rect(coords.x, coords.y, 200, 140)); m_dialogueGraphView.Add(miniMap); }
protected void InitializeHUD() { _hud = (HUD)GetNode("HUD"); _miniMap = (MiniMap)_hud.GetNode("controlGame/MiniMap"); _popUpMessage = (PopUpMessage)_hud.GetNode("PopUpMessage"); _miniMap.Iniitialize(CapaturableBaseManager); _postProcess = (PostProcess)GetNode("PostProcess"); }
// ----------------------------------------------------------------------------------------- /// <summary> /// used to create the floating 'in Gapgh' minimap for easy naviagtion when there are lots of nodes. /// </summary> private void GenerateMiniMap() { var miniMap = new MiniMap { anchored = false }; var cords = _TranzmitGraphView.contentViewContainer.WorldToLocal(new Vector2(this.maxSize.x - 10, 32)); miniMap.SetPosition(new Rect(cords.x, cords.y, 200, 140)); _TranzmitGraphView.Add(miniMap); }
public static void ExportBundle() { var go = Selection.activeObject as GameObject; MiniMap miniMap = go.GetComponent <MiniMap> (); string filename = "minimap_" + miniMap.mapId; string prefabPath = "Assets/Res/MiniMap/" + filename + ".prefab"; BuildBundle(prefabPath); }
void Start() { map = player.GetComponentInChildren<MiniMap> (); pc = player.GetComponent<PlayerCollider> (); switch (mapId) { case 1: map.InitializeMap (MapDatas.map1); break; case 2: map.InitializeMap (MapDatas.map2); break; } }
// Use this for initialization void Start() { button = new GUIStyle(skin.button); button.fontSize = 25; box = new GUIStyle(skin.box); label = new GUIStyle(skin.label); PauseMenu.setSkinTextures(button, box); miniMap = GetComponent<MiniMap>(); pauseMenu = GetComponent<PauseMenu>(); int GUIStart = Screen.width/2 - 400; float TextureArea = 665; float spaceBetween = TextureArea/(mapEditor.PlaceableItems.Length+1); int textureDisplaySize = 50; buttonBounds = new Rect[4]; for(int currItem = 0; currItem < mapEditor.PlaceableItems.Length; ++currItem) { buttonBounds[currItem] = new Rect(GUIStart + spaceBetween * (currItem + 1) - textureDisplaySize/2, Screen.height - GUISize/2 - textureDisplaySize/2, textureDisplaySize, textureDisplaySize); } }
public StandardMelee(InputHandler handler) { _mousePosition = new Vector2f(500, 500); CurrentStatus = StatusState.WaitingForPlayers; uiState = UIStateTypes.Normal; currentHotkey = null; currentHotkeySheet = null; standardHotkeys = Settings.GetSheet("standard_game_mode_controls"); InputHandler = handler; myId = 0; map = new TileMap(); allowMinimapCameraMove = true; selectedUnits = null; controlGroups = new Dictionary<Keyboard.Key, List<EntityBase>>(); for (int i = 27; i <= 35; i++) { controlGroups.Add((Keyboard.Key) i, new List<EntityBase>()); } controlBoxP1 = new Vector2f(0, 0); controlBoxP2 = new Vector2f(0, 0); selectedAttackMove = false; releaseSelect = false; CameraPosition = new Vector2f(0, 0); miniMap = new MiniMap(map, Fog, entities); //Load Sprites bottomHUDGUI = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/BottomGUI.png")); alertHUDAlert = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_Alert.png")); alertHUDUnitCreated = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_UnitCreated.png")); alertHUDBuildingCreated = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_BuildingFinished.png")); avatarWorker = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_AVATAR_WORKER.png")); hudBoxUnit = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Unit.png")); hudBoxBuilding = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Building.png")); hudControlBox = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/ControlGroupBox.png")); hudControlBox.Origin = new Vector2f(hudControlBox.TextureRect.Width/2, 0); viewBounds = new Sprite(ExternalResources.GTexture("Resources/Sprites/Hud/ViewBounds.png")); //Load Sounds moveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/MoveCommand/0.wav")); attackMoveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/AttackCommand/0.wav")); backgroundMusic = new Music("Resources/Audio/Music/In Game/mario.wav"); backgroundMusic.Loop = true; backgroundMusic.Volume = Settings.MUSICVOLUME; backgroundMusic.Play(); }
void Start() { _dropIntervalTimer = 0f; _startCell = transform.root.gameObject.GetComponent<MazeInstance>().represents; _miniMap = FindObjectOfType<MiniMap>(); }
private void MinimapHeader( Listing_Standard listing, MiniMap.MiniMap minimap ) { var str = minimap.LabelCap; listing.Label( str ); listing.Gap( 6 ); listing.Indent(); }
void Awake() { _instance = this; playerIcon = transform.Find("PlayerIcon"); }
// Use this for initialization void Awake() { //设置单例 if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } map = GetComponent<Map>(); miniMap = GetComponent<MiniMap>(); Init(); }
void Start() { Shrines = transform.parent.GetComponentsInChildren<Activatable>(); //print(Shrines.Length); _miniMap = GameObject.FindGameObjectWithTag("MiniMap").GetComponent<MiniMap>(); _attachedToIsland = transform.root.gameObject.GetComponent<MazeInstance>().represents; if (_attachedToIsland == null) { Debug.LogError("SpawnGroup couldn't find MazeInstance on root GameObject"); } }
public void SetMiniMap(MiniMap map) { _miniMap = map; }
public void renewMiniMap() { CurrentMiniMap = new MiniMap(); }
private void OverlayHeader( Listing_Standard listing, MiniMap.MiniMapOverlay overlay ) { var str = overlay.LabelCap; listing.Label( str ); listing.Gap( 6 ); listing.Indent(); }
public void renewMiniMap(DungeonInformation dginfo, TileEntity[] tiles) { CurrentMiniMap = new MiniMap(dginfo, tiles); }
public void Start() { gridScript = GameObject.Find("UGrid").GetComponent<UGrid>(); groupM = GameObject.Find("Faction Manager").GetComponent<GroupManager>(); placement = gameObject.GetComponent<BuildingPlacement>(); if(placement) placement.SetGroup(group); GUIManager manager = gameObject.GetComponent<GUIManager>(); if(manager) manager.group = groupM.groupList[group].GetComponent<Group>(); guiManager = gameObject.GetComponent<GUIManager>(); GameObject obj = GameObject.Find("MiniMap"); if(obj) map = obj.GetComponent<MiniMap>(); test = Camera.main.GetComponent<GUILayer>(); }
public static void ClearMinimapLink() { s_pMinimap = null; }
void Start() { Instance = this; }
// Use this for initialization void Start() { map = GetComponentInChildren<MiniMap> (); isOpenMap=false; }
public Cursor(Code2015 game, Game parent, GameScene scene, GameState gamelogic, Picker picker, CitySelectInfo citySelectInfo, ObjectSelectInfo objSelectInfo, RBallTypeSelect sendBallSelect, MiniMap map, SelectionMarker marker, RankInfo rankInfo) { this.parent = parent; this.logic = gamelogic; this.player = gamelogic.LocalHumanPlayer; this.rankInfo = rankInfo; this.game = game; this.renderSys = game.RenderSystem; this.scene = scene; this.picker = picker; this.selectionMarker = marker; this.citySelectInfo = citySelectInfo; this.objSelectInfo = objSelectInfo; this.sendBallSelect = sendBallSelect; this.miniMap = map; FileLocation fl = FileSystem.Instance.Locate("cursor.tex", GameFileLocs.GUI); cursor = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_u.tex", GameFileLocs.GUI); cursor_up = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_l.tex", GameFileLocs.GUI); cursor_left = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_d.tex", GameFileLocs.GUI); cursor_down = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_r.tex", GameFileLocs.GUI); cursor_right = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_lu.tex", GameFileLocs.GUI); cursor_ul = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_ru.tex", GameFileLocs.GUI); cursor_ur = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_ld.tex", GameFileLocs.GUI); cursor_dl = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_rd.tex", GameFileLocs.GUI); cursor_dr = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_move.tex", GameFileLocs.GUI); cursor_move = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_stop.tex", GameFileLocs.GUI); cursor_stop = UITextureManager.Instance.CreateInstance(fl); fl = FileSystem.Instance.Locate("cursor_toofar.tex", GameFileLocs.GUI); cursor_toofar = UITextureManager.Instance.CreateInstance(fl); cursor_sel = new Texture[11]; for (int i = 0; i < cursor_sel.Length; i++) { fl = FileSystem.Instance.Locate("selcursor" + (i + 13).ToString("D2") + ".tex", GameFileLocs.GUI); cursor_sel[i] = UITextureManager.Instance.CreateInstance(fl); } cursor_attack = new Texture[11]; for (int i = 0; i < cursor_attack.Length; i++) { fl = FileSystem.Instance.Locate("selcursor" + (i + 1).ToString("D2") + ".tex", GameFileLocs.GUI); cursor_attack[i] = UITextureManager.Instance.CreateInstance(fl); } cursorState = MouseCursor.Normal; }
// Use this for initialization void Awake () { cur = this; }
void Start() { if (s_pMinimap == null) s_pMinimap = GameObject.FindObjectOfType<MiniMap>(); m_tRectTransform = GetComponent<RectTransform>(); m_tRawImage = GetComponent<RawImage>(); Vector3 tCurrentScale = m_tRectTransform.localScale; m_tRectTransform.localScale = new Vector3(tCurrentScale.x * s_pMinimap.m_fZoom, tCurrentScale.y * s_pMinimap.m_fZoom, 1.0f); UpdateForward(); }
// Use this for initialization void Awake() { fog = new Texture2D(width, length, TextureFormat.ARGB32, false); fogColor = new Color32[width*length]; for(int x = 0; x < width; x++){ for(int y = 0; y < length; y++){ fog.SetPixel(x, y, hidden); fogColor[x+y*width] = hidden; } } fog.Apply(); if(map == null){ GameObject obj = GameObject.Find("MiniMap"); if(obj) map = obj.GetComponent<MiniMap>(); } if(map){ map.fogTexture = fog; } terrainMat.SetTexture("_FOWTex", fog); fogState = new int[width*length]; fogHeight = new float[width*length]; for(int x = 0; x < width; x++){ for(int y = 0; y < length; y++){ RaycastHit hit = new RaycastHit(); Physics.Raycast(new Vector3(x*disp, 1000, y*disp), Vector3.down, out hit, 10000, terrainLayer); fogHeight[x+y*width] = hit.point.y; } } }
public MiniMapData(MiniMap minimap) { System.Collections.Generic.List<Vector2> list = new System.Collections.Generic.List<Vector2>(); for (int x = 0; x < minimap.TileDetectionTable.GetLength(0); x++) { for (int y = 0; y < minimap.TileDetectionTable.GetLength(1); y++) { if (minimap.TileDetectionTable[x, y]) list.Add(new Vector2(x,y)); //if(minimap.TileDetectionTable[x, y]) Debug.LogFormat("B:[{0},{1}]:{2}",x,y,minimap.TileDetectionTable[x,y]); } } TileDetectedTable = list.ToArray(); }
void Start(){ map = GetComponentInParent<MiniMap>(); myRectTransform = GetComponent<RectTransform> (); }
// Use this for initialization void Start() { button = new GUIStyle(skin.button); button.fontSize = 25; box = new GUIStyle(skin.box); label = new GUIStyle(skin.label); PauseMenu.setSkinTextures(button, box); miniMap = GetComponent<MiniMap>(); pauseMenu = GetComponent<PauseMenu>(); }
private void Initialize() { zoom = 1.0f; maxZoom = 5.0f; smoothZoom = 1.0f; Map = new MiniMap(); }