private bool ReadyToDetonate = true; //Используем этот ключ метод detonate выполнялся только один раз #endregion Fields #region Methods void Awake() { debugmanager = GameObject.Find("DebugManager").GetComponent<DebugManager>(); rb = GetComponent<Rigidbody2D>(); col_comp = GetComponent<BoxCollider2D>(); c_tr = transform; anim = GetComponent<Animator>(); }
public void OnLevelWasLoaded(int level) { if (level != 3) { //Destroy Instance = null; } }
// Use this for initialization void Awake() { if (_instance == null) { _instance = this; _instance.Init(); } else if (_instance != this) { Debug.LogWarning("Second DebugManager created, deleting this script!"); Destroy(this); } }
void Awake() { if(instance == null) { instance = this; rect = new Rect(0, 360, 100, 100); DontDestroyOnLoad(gameObject); } else Destroy(gameObject); }
protected void EnemyType_Awake() { //Debug.Log("enemy type awake"); _transform = transform; _camera = GameObject.Find("Main Camera").GetComponent<Camera>(); enemymanager = _camera.GetComponent<EnemyManager>(); debugmanager = GameObject.Find("DebugManager").GetComponent<DebugManager>(); eventmanager = _camera.GetComponent<EventManager>(); //resourceManager = _camera.GetComponent<ResourceManager>(); navigation = _camera.GetComponent<Navigation>(); //Получаем доступ к классу myLayerMask = enemymanager.myLayerMask; }
public void LoadXmlDataLocal(string xmlFileName) { _xmlFilePath = xmlFileName; try { //TODO use BackgroundWorker //var bw = new BackgroundWorker(); //bw.DoWork += OnBackgroundWorkerDoWork; //bw.RunWorkerCompleted += OnRunWorkerCompleted; //bw.RunWorkerAsync(stream); var xmlDoc = XDocument.Load(xmlFileName); OnGetXmlDataCompleted(new LoadXmlDataCompletedEventArgs(xmlDoc)); } catch (Exception ex) { var error = new Exception("XmlDataProvider Failed to open: " + _xmlFilePath + " file due to error: \n", ex); DebugManager.LogError(error); OnGetXmlDataCompleted(new LoadXmlDataCompletedEventArgs(error)); } }
private void UpdateRange(XamZoombar target, XamZoombar source) { if (Target == null || DontRecurse) { return; } DontRecurse = true; try { target.Range.Minimum = source.Range.Minimum; target.Range.Maximum = source.Range.Maximum; DebugManager.LogData("ZoombarEx-Changed: " + this.Range.Minimum + ", " + this.Range.Maximum); } catch (Exception ex) { DebugManager.Log(ex); } DontRecurse = false; }
private void OnSendMsg(int ie, bool pressed) { if (pressed) { return; } if (Input != null) { //byte[] utf8Bytes = Encoding.UTF8.GetBytes(Input.value); if (Input.value == "debug") { DebugManager.Switch(); } else { CGLCtrl_GameLogic.Instance.EmsgToss_eMsgToGSToCSFromGC_GMCmd(Input.value); } Input.value = ""; } }
/// <summary> /// Unregisters a new area portal to the area manager. Only the scenes of registered portals can be loaded/unloaded additively. /// </summary> public void UnRegisterAreaPortal(UnityScene subScene) { if (!GetIsActive || subScene == null || String.IsNullOrWhiteSpace(subScene.SceneName)) { return; } for (int i = 0; i < subScenes.Count; i++) { if (subScenes[i] == null || String.IsNullOrWhiteSpace(subScenes[i].SceneName)) { continue; } if (subScenes[i].SceneName == subScene.SceneName) { subScenes.RemoveAt(i); DebugManager.LogFormat(nameof(AreaManager), nameof(UnRegisterAreaPortal), subScene.SceneName); //DEBUG } } }
public static void Initialize(Game g) { _debugManager = new DebugManager(g); g.Components.Add(_debugManager); _debugCommandUI = new DebugCommandUI(g); _debugCommandUI.DrawOrder = int.MaxValue; g.Components.Add(_debugCommandUI); _fpsCounter = new FpsCounter(g); g.Components.Add(_fpsCounter); _memTracker = new MemoryTracker(g); g.Components.Add(_memTracker); _currentRuler = new TimeRuler(g); g.Components.Add(_currentRuler); _timeHistory = new TimeHistory(g, _currentRuler); g.Components.Add(_timeHistory); }
// ============================ START ANCHORS ==================================== // ------------------------------------------------------------------------------- // GetArchetypeStartPositionAnchorName // ------------------------------------------------------------------------------- public string GetArchetypeStartPositionAnchorName(GameObject player) { PlayerComponent pc = player.GetComponent <PlayerComponent>(); startAnchors.Shuffle(); foreach (StartAnchorEntry anchor in startAnchors) { foreach (ArchetypeTemplate template in anchor.archeTypes) { if (template == pc.archeType) { DebugManager.LogFormat(nameof(AnchorManager), nameof(GetArchetypeStartPositionAnchorName), anchor.name); //DEBUG return(anchor.name); } } } DebugManager.LogFormat(nameof(AnchorManager), nameof(GetArchetypeStartPositionAnchorName), "NOT FOUND"); //DEBUG return(""); }
public void UpdateFilteredData() { DebugManager.Time("StockInfoViewModel.UpdateFilteredData"); if (_data == null) { _filteredData = _data; } if (_rangeFilter == 0) { _filteredData = _data; } else { _filteredData = GetFilteredData(); _filteredActualData = GetFilteredData(); } DebugManager.Time("StockInfoViewModel.UpdateFilteredData"); OnPropertyChanged("FilteredData"); RangeIntervalX = FindRangeInterval(); }
//в авейке все это работает плохо protected void Start() { //Debug.Log("WeaponSelector Start"); debugmanager = GameObject.Find("DebugManager").GetComponent<DebugManager>(); uimanager = GameObject.Find("UIManager").GetComponent<UIManager>(); uimanager.OnCall_WSelector += MoveandAppeare; uimanager.OnCloseGUI += Disappeare; uimanager.OnPress_WButton += ShowRadius; uimanager.OnCloseGUI += HideRadius; _transform = transform; _gameObject = gameObject; _gameObject.SetActive(false); _weaponmanager = _camera.GetComponent<WeaponManager>(); _resourceManager = _camera.GetComponent<ResourceManager>(); radiusGM = GameObject.Find("Radius"); radiusT = radiusGM.transform; foreach (Transform t in _transform) { if (t.name.Contains("WButton")) { SelectorButton button = t.GetComponent<SelectorButton>(); WeaponType weapondata = _weaponmanager.GetPrimaryWeaponData(button.id); //Debug.Log("but " + id); if (weapondata != null) { button.SetWButtonState(weapondata); } else { button.SetButtonLock(LockSprite); } } } }
protected void onFetch(string error, JSONObject result) { if (!string.IsNullOrEmpty(error)) { DebugManager.Log(error); } else { _pages = new Dictionary <int, MagicUIPage>(); _pagesByName = new Dictionary <string, int>(); _pageStack = new Stack <int>(); JSONObject pages = result["pages"]; string firstPage = result["firstPage"].str; for (int i = 0; i < pages.list.Count; i++) { MagicUIPage page = MagicUIPage.CreateFromMarkup(pages.keys[i], pages.list[i]); if (page != null) { _pages.Add(page.ID, page); _pagesByName.Add(page.name, page.ID); if (page.name == firstPage) { _homePage = page.ID; page.IsVisible = true; _pageStack.Push(_homePage); } else { page.IsVisible = false; } } } setupBackground(); } }
protected IEnumerator loadProject(string projectId, string auth, MagicUIManager.GenericCallback <JSONObject> callback) { Hashtable headers = new Hashtable(); headers["Cookie"] = auth; headers["Content-Type"] = "application/json"; JSONObject json = new JSONObject(JSONObject.Type.OBJECT); json.AddField("projectId", projectId); json.AddField("sharedPagesOnly", true); string postText = json.ToString(); byte[] postData = Encoding.UTF8.GetBytes(postText); WWW request = new WWW(_kGetProjectDataURL, postData, headers); DebugManager.Log("Fetch {0}", _kGetProjectDataURL); yield return(request); JSONObject response = null; if (!string.IsNullOrEmpty(request.error)) { Debug.LogWarning(request.error); } else { string unescaped = unescape(request.text); response = new JSONObject(unescaped); if (!response.IsObject) { callback("PROJECT PARSE FAILED", null); } else { callback(null, response); } } }
protected void AddGeoMapLayer(GeoMapDataLayer mapLayer) { //mapLayer.PropertyChanged += OnMapLayerChanged; //mapLayer.SetSeriesName(); mapLayer.InitializeMap(this.Map); mapLayer.InitializeSeries(); DebugManager.LogTrace("MapViewModel.AddGeoMapLayer[" + mapLayer.SeriesIndex + "]: " + mapLayer.SeriesName); // MapLayer with type of GeoDataViewSource ); if (mapLayer.SeriesType == GeoSeriesType.GeographicShapeSeries) { AddGeoMapLayer(mapLayer as GeoShapeMapLayer); } else if (mapLayer.SeriesType == GeoSeriesType.GeographicProportionalSymbolSeries) { AddGeoMapLayer(mapLayer as GeoSymbolProportionalMapLayer); } else if (mapLayer.SeriesType == GeoSeriesType.GeographicSymbolSeries) { AddGeoMapLayer(mapLayer as GeoSymbolMapLayer); } else if (mapLayer.SeriesType == GeoSeriesType.GeographicTileImagerySeries) { AddGeoMapLayer(mapLayer as GeoTileImageryMapLayer); } else if (mapLayer.SeriesType == GeoSeriesType.GeographicHighDensityScatterSeries) { AddGeoMapLayer(mapLayer as GeoHighDensityScatterMapLayer); } else if (mapLayer.SeriesType == GeoSeriesType.GeographicScatterAreaSeries) { AddGeoMapLayer(mapLayer as GeoScatterAreaMapLayer); } else if (mapLayer.SeriesType == GeoSeriesType.GeographicMotionSymbolSeries) { AddGeoMapLayer(mapLayer as GeoMotionMapLayer); } UpdateDataSourceTrademarks(); }
private void UpdateEarthQuakes(bool forceUpdate = false) { if (HasNewEarthQuakes || ForceEarthQuakeUpdate || forceUpdate) { HasNewEarthQuakes = false; ForceEarthQuakeUpdate = false; ProcessStartTime = DateTime.Now; DebugManager.LogTrace("EarthQuakeService->Updating earthquakes... "); var matchEarthQuakes = EarthQuakeDataCache.Values.Where(IsFilterMatch).ToList(); if (Debugger.IsAttached) { var otherEarthQuakes = new List <EarthQuakeData>(); foreach (var value in EarthQuakeDataCache.Values) { if (!matchEarthQuakes.Contains(value)) { otherEarthQuakes.Add(value); } } } if (matchEarthQuakes.Count > 0) { // order from older to newer matchEarthQuakes.Sort((x, y) => + (Comparer <DateTime> .Default.Compare(x.Updated, y.Updated))); LatestEarthQuake = matchEarthQuakes.Last(); } DebugManager.LogTrace("EarthQuakeService->Updating earthquakes: " + EarthQuakes.Count + "->" + matchEarthQuakes.Count); EarthQuakes = matchEarthQuakes; OnEarthQuakesChanged(this, new EarthQuakesChangedEventArgs(matchEarthQuakes)); LastUpdated = DateTime.UtcNow; ProcessStopTime = DateTime.Now; var time = String.Format("{0} seconds", ProcessStopTime.Subtract(ProcessStartTime).TotalSeconds); DebugManager.LogTrace("EarthQuakeService->Updating earthquakes completed in " + time); } }
// xsd: // xsd: http://1.234.11.116/proof_xml/user_interface.xsd public static void Parse(string filename, Action <GameObject> callback) { if (callback == null) { DebugManager.Log("Callback Function is null!!"); return; } XmlParser xmlParser = new XmlParser(); bool bOpened = xmlParser.OpenXml(filename); if (bOpened == false) { DebugManager.Log("Open Failed - [path:{0}]", filename); return; } XmlNode res = xmlParser.GetNode("GameResource"); if (res == null) { DebugManager.Log("Invalid XML!!"); return; } foreach (XmlNode nodes in res.ChildNodes) { string curVersion = _GetVersion(nodes); switch (nodes.Name) { case "UserInterface": _UserInterfaceParse(curVersion, nodes, (obj) => callback(obj)); break; case "": break; } } }
public override void Update(AIAgent agent) { // Start the building timer { if ((MoveToPoint.HasCompleted(agent) || StopDistanceAsSpawnDist) && !AttemptBuild) { CurrentBuildTime = Time.time + BuildCompletionTime; AttemptBuild = CanAffordBuilding; MoveToPoint.Exit(agent); } } // Build the building { if (BuildingPrefab && Time.time >= CurrentBuildTime && AttemptBuild) { // Destroy the TempIndicator across the server if (TempIndicator) { NetworkHandler.ClientInstance.ServDestroyObject(TempIndicator); } // Instantiate Building then spawn it across the server Building = GameObject.Instantiate(BuildingPrefab, MoveToPoint.CurrentTarget, Quaternion.identity); NetworkHandler.ClientInstance.ServSpawnObject(Building); // Tell the Building who its owner is NetworkHandler.ClientInstance.RpcSetAgentOwner(Building, agent.AgentOwner.gameObject); AttemptBuild = false; } else if (!BuildingPrefab) { DebugManager.WarningMessage($"Attempting to build a null building from agent: {agent.gameObject.name}"); } } MoveToPoint.Update(agent); }
/// <summary> /// 更新行 /// </summary> /// <param name="rowIndex"></param> public void UpdateRow(int rowIndex) { if (useLoopItems) { _startIndex = Mathf.Max(0, Mathf.Min(_startIndex / ConstraintCount, DataUnitCount - _viewItemCount - CacheUnitCount)) * ConstraintCount; } else { _startIndex = 0; } var index = _startIndex + (rowIndex - 1); if (index < 0 || index >= m_items.Count) { DebugManager.LogWarning("TableView UpdateRow Warning:无效的行."); } else { m_pTableCellWithShowedDelegate(m_items[index], index, false); } }
/// <summary> /// Gets the stock next outline from <seealso cref="StockOutlines"/> collection /// </summary> /// <returns></returns> public Brush GetStockNextOutlineBrush() { Brush brush = new SolidColorBrush(Colors.White); if (_stockOutlines == null) { DebugManager.LogWarning("StockViewModel could not find any StockOutlines and will default to White outline brush."); } // If we have more stocks than outlines, lets find the next outline brush to use if (_stockOutlines != null) { int brushIndex = _stocks.Count(); while (brushIndex > _stockOutlines.Count - 1) { brushIndex = brushIndex - _stockOutlines.Count; } brush = brushIndex < _stockOutlines.Count ? _stockOutlines[brushIndex] : null; } return(brush); }
public void API_SendData(string gate_alias, byte[] data) { if (data == null) { return; } /* 送信先ゲート取得 */ var gates = GateManager.FindGateObjectFromWildcardAlias(gate_alias); if (gates == null) { return; } /* 送信実行 */ DebugManager.MessageOut(DebugMessageSender.User, DebugMessageType.SendEvent, "API_SendData"); foreach (var obj in gates) { obj.SendRequest(data); } }
public static bool MatrixDecompose(ref Matrix4x4 Matrix, out Vector3 Scale, out Quaternion Rotation, out Vector3 Translation) { MatrixDecompose(ref Matrix, out Scale, out Translation); Rotation = Quaternion.identity; if (IsZero(Scale.x) || IsZero(Scale.y) || IsZero(Scale.z)) { return(false); } Matrix4x4 RotationMatrix = Matrix4x4.zero; RotationMatrix[0, 0] = Matrix[0, 0] / Scale.x; RotationMatrix[0, 1] = Matrix[0, 1] / Scale.x; RotationMatrix[0, 2] = Matrix[0, 2] / Scale.x; RotationMatrix[1, 0] = Matrix[1, 0] / Scale.y; RotationMatrix[1, 1] = Matrix[1, 1] / Scale.y; RotationMatrix[1, 2] = Matrix[1, 2] / Scale.y; RotationMatrix[2, 0] = Matrix[2, 0] / Scale.z; RotationMatrix[2, 1] = Matrix[2, 1] / Scale.z; RotationMatrix[2, 2] = Matrix[2, 2] / Scale.z; RotationMatrix[3, 3] = 1f; try{ //Matrices in Unity are column major; i.e. the position of a transformation matrix is in the last column, and the first three columns contain x, y, and z-axes. Data is accessed as: row + (column*4) //sharpDX uses row_major matrixes RotationMatrix = RotationMatrix.transpose; Rotation = RotationMatrix.rotation; } catch (Exception e) { DebugManager.Log(e.Message, 5); } return(true); }
// analyticsController analyticsControl; /* --------------------------------------------------------------------------------------------------------- */ // defind all the things need to be done first void Start() { debugConsole = GameObject.Find("Debug").GetComponent <DebugManager>(); InitStyles(); ImageHolder.SetActive(false); screenCap = new Texture2D(Screen.width, Screen.height, TextureFormat.RGBA32, false); // 1 // analyticsControl = GameObject.FindObjectOfType<analyticsController> (); /* * // only display the coaching once * if (PlayerPrefs2.GetBool("messagesAlreadyShown")) * { * noUI (); * } * else * { * PlayerPrefs2.SetBool("messagesAlreadyShown", true); * SetupUI (); * } */ }
private PluginProperty LoadConfigPart_PluginProperty(XmlElement xml_node, Guid class_id) { if (xml_node == null) { return(null); } /* クラスIDからプロパティを取得 */ var plgp = PluginManager.CreatePluginPropery(class_id); if (plgp == null) { /* 該当IDのプラグインがインストールされていない場合は無視 */ DebugManager.MessageOut(DebugMessageSender.Application, DebugMessageType.ConfigEvent, string.Format("LoadPluginProperty Error: {0}", class_id.ToString("D"))); return(null); } /* プロパティ読み込み */ plgp.LoadConfigData(xml_node); return(plgp); }
protected override void Initialize() { IsMouseVisible = true; IsFixedTimeStep = true; TargetElapsedTime = TimeSpan.FromMilliseconds(1000.0f / 60f); Engine.TargetFrameTime = (float)TargetElapsedTime.Milliseconds; var renderer = new Renderer(); renderer.Device = m_graphicsDeviceManager.GraphicsDevice; Engine.AddComponent(renderer); Engine.Renderer = renderer; var debug = new DebugManager(); Engine.AddComponent(debug); Engine.Debug = debug; var audio = new AudioManager(); Engine.AddComponent(audio); Engine.Audio = audio; var music = new MusicManager(); Engine.AddComponent(music); Engine.MusicManager = music; var audioStreamManager = new AudioStreamManager(); Engine.AddComponent(audioStreamManager); Engine.AudioStreamManager = audioStreamManager; Window.AllowUserResizing = false; base.Initialize(); }
protected virtual void RegisterGamePlayed(GameCompleteReason reason) { // статический вызов окончания обработки игры !!! if (_mgParameters.sceneParams != null) { if (_mgParameters.sceneParams.onGameEnded != null) { _mgParameters.sceneParams.onGameEnded.Invoke((int)reason); } } DebugManager.Log($"Game Complete: " + $"{GetType()} (ID: {_mgParameters.miniGameData.gameID})" + $"\nResult: {reason}" + $"\nComplexity: {_mgParameters.miniGameData.complexityLevel}\n\n" + GetGameDebugResult()); _viewController.MiniGameController.RegisterGamePlayed(_mgParameters.miniGameData, _mgParameters.miniGameData.complexityLevel, (int)reason, GetTimeSpend(), _mgParameters.miniGameData.complexityLevel); TrackGamePlayed(reason); }
// Update is called once per frame void Update() { if (downLoadModel != null) { handleMessage.text = downLoadModel.taskMessage; if (downLoadModel.taskState != TaskState.None) { handleSize.x = parentSize.x * downLoadModel.Schedule; handle.sizeDelta = handleSize; } if (downLoadModel.taskState == TaskState.TaskOk) { DebugManager.LogWarning("ab 下载完成!卸载ab下载器!"); AssetBundleDownloadManager.Instance.ExitUpdateAssetBundle(); Invoke("LoadMainGame", 2f); downLoadModel = null; } } }
//將對CoverPhoto點讚的人轉成好友名單 public static HashSet <String> findFriendsInCoverPhotoLikes(string URL) { HashSet <String> result = new HashSet <String>(); do { MemoryStream ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(getFB(URL))); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.Load(ms, Encoding.UTF8); //XPath for (int i = 1; i < 10; i++) { try { string link = doc.DocumentNode.SelectSingleNode(".//*[@id='root']/table/tbody/tr/td/ul/li[" + i + "]/table/tbody/tr/td/table/tbody/tr/td[2]/div/h3[1]/a").GetAttributeValue("href", "null"); string name = doc.DocumentNode.SelectSingleNode(".//*[@id='root']/table/tbody/tr/td/ul/li[" + i + "]/table/tbody/tr/td/table/tbody/tr/td[2]/div/h3[1]/a").InnerText; if (link != "null") { string uid = link.Replace("/", "").Replace("profile.php?id=", "").Replace("&fref=fr_tab\"", "").Replace("?fref=fr_tab\"", "").Replace("&", "").Replace("?fref=pb", "").Replace("fref=pb", "").Replace("refid=17", "").Replace("&v=timeline", "").Replace("v=timeline", "").Replace("\\", "").Replace("\"", ""); FBCache.addUser(new fbUser(uid, name)); DebugManager.add(DEBUG_LEVEL.DEBUG, "findFriendsInCoverPhotoLikes save to Cache UID:" + uid + " Name:" + name); result.Add(uid); } } catch (Exception) { continue; } } try { URL = doc.DocumentNode.SelectSingleNode(".//*[@id='root']/table/tbody/tr/td/div/a").GetAttributeValue("href", ""); } catch (Exception) { URL = ""; } }while (URL.Length > 0); DebugManager.add(DEBUG_LEVEL.DEBUG, "findFriendsInCoverPhotoLikes result: " + result.Count); return(result); }
protected override void OnDisconnectStart() { DebugManager.MessageOut(DebugMessageSender.Device, DebugMessageType.ControlEvent, "Serial Port - Disconnect Start"); #if ASYNC_MODE /* タスク停止イベント */ NativeMethods.ResetEvent(exit_event_); NativeMethods.SetEvent(exit_event_); /* 送信/受信タスク停止 */ while ((device_task_ar_ != null) && (!device_task_ar_.IsCompleted)) { Thread.Sleep(1); } /* イベント破棄 */ NativeMethods.CloseHandle(exit_event_); exit_event_ = IntPtr.Zero; NativeMethods.CloseHandle(comm_event_end_); comm_event_end_ = IntPtr.Zero; NativeMethods.CloseHandle(send_event_req_); send_event_req_ = IntPtr.Zero; NativeMethods.CloseHandle(send_event_end_); send_event_end_ = IntPtr.Zero; NativeMethods.CloseHandle(recv_event_end_); recv_event_end_ = IntPtr.Zero; #else /* シリアルポート停止 */ port_.Purge(); /* タスク停止要求 */ exit_request_event_.Set(); #endif DebugManager.MessageOut(DebugMessageSender.Device, DebugMessageType.ControlEvent, "Serial Port - Disconnect Start - End"); }
private void UpdateEarthQuakeCache(EarthQuakeData earthquake) { var key = earthquake.Code; // earthquake.Updated + earthquake.Code; if (EarthQuakeDataCache.ContainsKey(key)) { if (EarthQuakeDataCache[key].Updated < earthquake.Updated) { //EarthQuakesList.Add(earthquake); DebugManager.LogData("EarthQuakeService->Updating earthquake: " + earthquake.ToString()); EarthQuakeDataCache[key] = earthquake; HasNewEarthQuakes = true; } } else { EarthQuakeDataCache.Add(key, earthquake); HasNewEarthQuakes = true; //EarthQuakesList.Add(earthquake); //DebugManager.LogData("EarthQuakeService->Adding earthquake: " + earthquake.ToString()); } }
/// <summary> /// Callback to draw gizmos that are pickable and always drawn. /// </summary> void OnDrawGizmos() { DrawSize(); // QuadTree.Draw(quadTree); if (!DebugManager.Check(colorDebugMessage)) { return; } List <Vector2Int> pointsToRender = new List <Vector2Int>(); cam = Camera.main; Vector2 camPos = cam.transform.position; float height = cam.orthographicSize; float width = cam.aspect * height; Vector2 camSize = new Vector2(width, height); if (vectors.Length != 0) { for (int i = 0; i < vectors.GetLength(0); i++) { for (int j = 0; j < vectors.GetLength(1); j++) { if (CheckBoundary((Vector2)vectors[i, j], camPos, camSize)) { pointsToRender.Add(new Vector2Int(i, j)); } } } } print(HighestWeight); foreach (var point in pointsToRender) { float colorval = 1 - (float)Weights[point.x, point.y] / (float)HighestWeight; // colorval = Mathf.Sin(colorval * 100); Gizmos.color = new Color(colorval, colorval, colorval); Gizmos.DrawCube(vectors[point.x, point.y], Vector3.one * 0.03f); } }
// ------------------------------------------------------------------------------- // SpawnSubZones // ------------------------------------------------------------------------------- public void SpawnSubZones() { DebugManager.Log(">>>>spawn subzones"); if (!GetIsMainZone || !GetCanSwitchZone || spawnedSubZones) { return; } InvokeRepeating(nameof(SaveZone), 0, zoneConfig.zoneSaveInterval); for (int i = 0; i < zoneConfig.subZones.Count; i++) { if (zoneConfig.subZones[i] != currentZone) { SpawnSubZone(i); } } spawnedSubZones = true; debug.LogFormat(this.name, nameof(SpawnSubZones), zoneConfig.subZones.Count.ToString()); //DEBUG }
public void OnPlayerConnected(Client player) { DebugManager.DebugMessage("[LoginM] " + player.SocialClubName + " has connected to the server [NOT LOGGED IN]. (IP: " + player.Address + ")"); LogManager.Log(LogManager.LogTypes.Connection, player.SocialClubName + " has connected to the server [NOT LOGGED IN]. (IP: " + player.Address + ")"); Account account = player.GetAccount(); API.SetEntitySharedData(player, "REG_DIMENSION", 1000); NAPI.Entity.SetEntityDimension(player, 1000); if (account.is_registered()) { NAPI.Chat.SendChatMessageToPlayer(player, "This account is already registered. Use /login [password] to continue to character selection."); } else { NAPI.Chat.SendChatMessageToPlayer(player, "This account is unregistered! Use /register [password] to register it."); } NAPI.Chat.SendChatMessageToPlayer(player, "Press ~g~F12~w~ to disable CEF and login manually."); NAPI.ClientEvent.TriggerClientEvent(player, "onPlayerConnectedEx", account.is_registered()); }
public async Task LoadRomsAndEmulatorsAsync(bool showError = true) { if (CheckRomAndEmulatorDirectories() && CheckCanDoWork()) { // Use a Task.Run() here to get these methods off the UI thread as they're slow and it will lock up responsiveness. await Task.Run(() => { IsLoading = true; LoadingText = "Loading emulator information from disk..."; EmulatorModels = IOHelper.GetEmulatorInformationFromDisk(EmuManagerModel.EmulatorDirectory); LoadingText = "Loading rom information from disk..."; RomModels = IOHelper.GetRomInformationFromDisk(EmuManagerModel.RomDirectory); LoadingText = string.Empty; IsLoading = false; }); if (EmulatorModels == null || RomModels == null) { DebugManager.ShowErrorDialog("No roms, or no emulators were able to be loaded. Please check your directories layout.", null); return; } EmuManagerModel.RomsLoadedCount = RomModels.Length.ToString(); EmuManagerModel.EmulatorsLoadedCount = EmulatorModels.Length.ToString(); EmuManagerModel.ConsolesWithRomsCount = RomModels.GroupBy(x => x.Console).ToList().Count.ToString(); } else { // Since this could conceivably be autoloaded we don't want to show an error unless it's a distinct user interaction that calls this method if (showError) { DebugManager.ShowErrorDialog("You must load your ROMs and emulators first.", null); } } }
public override string Activate(string[] args) { // If args given if (args.Length > 0) { // If index given if (TryParseInt(args[0], out int saveSlot)) { // If positive number if (saveSlot >= 0) { // Create filename for save state file DateTime timestamp = DateTime.Now; string date = timestamp.ToString("MM-dd-yy"); string time = timestamp.ToString("HH-mm"); string fileName = "state-" + saveSlot + "_" + date + "_" + time + ".state"; // Delete any existing save states for this slot string filePath = FileManager.GetFileNameFromText(FileManager.GetModDirectoryPath() + "/savestates/", "state-" + saveSlot); if (!string.IsNullOrEmpty(filePath)) { FileManager.DeleteFile(filePath); } // Save data SaveTempData(); // Copy save file to mod directory/savestates directory FileManager.CopyFile(VarHelper.CurrentSaveFilePath, FileManager.GetModDirectoryPath() + "/savestates/" + fileName, true); return("<color=green>Saved state to slot " + saveSlot + "</color>"); } } } // If no index given return(DebugManager.LogToConsole("No <out>(int)</out> index was given. Use <out>help savestate/loadstate</out> for more info.", DebugManager.MessageType.Error)); }
/// <summary> /// Initialize singleton /// </summary> void Awake() { if (use != null) Destroy(use.gameObject); use = this; }
void Awake() { //Debug.Log("navigation awake"); // awake чтобы инициализировать траектории были готовы к моменту старта Player LevelData = GameObject.Find("Level").GetComponent<ILevel>(); //Получаем доступ к классу debugmanager = GameObject.Find("DebugManager").GetComponent<DebugManager>(); PathList = LevelData.GetPathList("land"); TP_Array= LevelData.Get_tp_Array("land"); PathList_air = LevelData.GetPathList("air"); TP_Array_air = LevelData.Get_tp_Array("air"); }
void Start() { //Debug.Log("Start"); c_transform = transform; uimanager = GameObject.Find("UIManager").GetComponent<UIManager>(); debugmanager = GameObject.Find("DebugManager").GetComponent<DebugManager>(); foreach (Transform t in transform) { if (t.name == turret_pr_name) { turret = t; } else if (t.name == turret_base_pr_name) { turret_base = t; } } turret.position = c_transform.position; turret.rotation = Quaternion.AngleAxis(Base_angle - 90, new Vector3(0, 0, 1)); // -90 чтобы ствол всегда смотерл в направлении противоположном крпелению базы turret_base.position = c_transform.position; turret_base.rotation = Quaternion.AngleAxis(Base_angle, new Vector3(0, 0, 1)); // 0 0 1 это ось по которой идет вращение , то есть z MinTurnAngle = Base_angle - 180; MaxTurnAngle = Base_angle; RCScanner_pos = (Vector2)turret.position + new Vector2(Missile_pos_dist * Mathf.Cos((Base_angle - 90) * Mathf.Deg2Rad), Missile_pos_dist * Mathf.Sin((Base_angle - 90) * Mathf.Deg2Rad)); targetHeading = 0f; StartCoroutine(ScanArea()); isReused = true; //Тут мы запускаем ScanArea при старте , когда спауним башню в первый раз. А в методе Onspawn будем запускать эту корутину только если она используется повторно }
public static void InitializeWithGame(Game g) { // Initialize debug manager and add it to components. _debugManager = new DebugManager(g); g.Components.Add(_debugManager); // Initialize debug command UI and add it to compoents. _debugCommandUI = new DebugCommandUI(g); // Change DrawOrder for render debug command UI on top of other compoents. _debugCommandUI.DrawOrder = int.MaxValue; g.Components.Add(_debugCommandUI); // Initialize FPS counter and add it to compoentns. _fpsCounter = new FpsCounter(g); g.Components.Add(_fpsCounter); // Initialize TimeRuler and add it to compoentns. _currentRuler = new TimeRuler(g); g.Components.Add(_currentRuler); }
private void InitStaticObjects() { if(!objectsInitialized) { DontDestroyOnLoad(gameObject); //Double check for every static variable if (debugMng == null) { Debug.Log("Storing Debug Manager"); debugMng = debugManager; } if (eventMng == null) { Debug.Log("Storing Event Manager"); eventMng = eventManager; } if (enemyMng == null) { Debug.Log("Storing Enemy Manager"); enemyMng = enemyManager; } if (poolMng == null) { Debug.Log("Storing Pool Manager"); poolMng = poolManager; } if (colorMng == null) { Debug.Log("Storing Color Manager"); colorMng = colorManager; } if (coloredObjectsMng == null) { Debug.Log("Storing Colored Objects Manager"); coloredObjectsMng = coloredObjectsManager; } if (gameMng == null) { Debug.Log("Storing Game Manager"); gameMng = gameManager; } if (gameInfo == null) { gameInfo = new GameInfo(); gameInfo.player1 = GameObject.Instantiate<GameObject>(player1prefab); gameInfo.player1.name = "Player1"; DontDestroyOnLoad(gameInfo.player1); gameInfo.player1Controller = gameInfo.player1.GetComponent<PlayerController>(); gameInfo.player2 = GameObject.Instantiate<GameObject>(player2prefab); gameInfo.player2.name = "Player2"; DontDestroyOnLoad(gameInfo.player2); gameInfo.player2Controller = gameInfo.player2.GetComponent<PlayerController>(); gameInfo.gameCameraOffset = gameCameraOffset; gameInfo.gameCameraRotation = gameCameraRotation.rotation; } objectsInitialized = true; } }
// Use this for initialization void Start () { Instance = this; GetComponent<RectTransform>().anchoredPosition = new Vector3(450, -7, 0); }