private void LevelUp() { float previousLv = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("level").n; if (previousLv >= StaticVariables.characterData.GetField("maxLevel").n) { pointsToGain = 0; return; } float previousHp = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("hp").n; float previousMp = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("mp").n; float previousAttack = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("attack").n; float previousDefense = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("defense").n; float previousSpeed = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("speed").n; float previousCD = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("CD").n; StaticVariables.saveData.GetField("characters").list[StaticVariables.characterID].SetField("exp", 0); float currLevel = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("level").n; StaticVariables.saveData.GetField("characters").list[StaticVariables.characterID].SetField("level", currLevel + 1); description.text = "Level = " + previousLv + " → " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("level").n; description.text += "\nHP = " + previousHp + " → " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("hp").n; description.text += "\nMP = " + previousMp + " → " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("mp").n; description.text += "\nAttack = " + previousAttack + " → " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("attack").n; description.text += "\nDefense = " + previousDefense + " → " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("defense").n; description.text += "\nSpeed = " + previousSpeed + " → " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("speed").n; description.text += "\nMP Regen. = " + previousCD + " → " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("CD").n; }
private bool InitPlugin(Plugin plugin, bool debug = false) { try { if (!PluginExists(plugin)) { StaticVariables d = new StaticVariables(); d.iResourceID = plugin.ResourceId; Data.Plugins.Add(plugin, d); SetStaticVariable(plugin, "INIT_TIMESTAMP", UnixTimeStampUTC().ToString()); if (debug) { Puts("[" + plugin.Title + "] added " + plugin.Title + " [Resource ID: " + Data.Plugins[plugin].iResourceID.ToString() + "]."); } return(true); } } catch { if (debug) { Puts("DEBUG: Failed To Call Hook InitPlugin(" + plugin.Title.ToString() + ");"); } } return(false); }
public void AddStaticBasedScope(IVariableInstance variable) { _staticScope.CopyVariable(variable); _objectScope.CopyVariable(variable); StaticVariables.Add(variable.Provider); _parseInfo.TranslateInfo.GetComponent <StaticVariableCollection>().AddVariable(variable); }
private void ExpGrow() { float maxExp = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("maxExpForThisLevel").n; float currExp = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("currentExp").n; float level = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("level").n; float expGrowInUpdate = Mathf.Min(Time.deltaTime * speed, pointsToGain); float expGrow = Mathf.Min(expGrowInUpdate, maxExp - currExp); //Debug.Log("expGrow = " + expGrow); StaticVariables.saveData["characters"].list[StaticVariables.characterID]["exp"].n = expGrow + currExp; pointsToGain -= expGrow; accExp += expGrow; if (expGrow + currExp == maxExp) { LevelUp(); float previousLv = StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("level").n; if (previousLv >= StaticVariables.characterData["maxLevel"].n) { StaticVariables.saveData.GetField("characters").list [StaticVariables.characterID].SetField("exp", 0); pointsToGain = 0; } } //StaticVariables.characterID }
void Start() { audio = GetComponentInChildren <AudioSource>(); resetMap(); StaticVariables.ResetVariables(); skyBoxIdx = StaticVariables.mapID;//PlayerPrefs.GetInt("CourseID"); setCourse(StaticVariables.mapID); //PlayerPrefs.GetInt("PlayerID") + 2 * PlayerPrefs.GetInt("CarID");//TODO - modify this //PlayerPrefs.SetInt("Coins", 0); float hp, mp, atk, skillCD, speed, defense; /***** TODO - For debug *****/ hp = 100; mp = 100; atk = 100; skillCD = 1; speed = 0;//speed = 120; defense = 100; StaticVariables.characterID = 3; /***** TODO - For debug *****/ initCharacter(StaticVariables.mapID, StaticVariables.carID, StaticVariables.characterID, hp, mp, atk, defense, speed, skillCD, 0, true); initCharacter(StaticVariables.mapID, 2, 1, 100, 100, 100, 50, 150, 5, 1, false); initCharacter(StaticVariables.mapID, 3, 0, 100, 100, 100, 50, 150, 5, 2, false); //there are carinitDebug.Length cars; init them in time stop skill users' enemy lists initTimeStopskillUsers(); }
public Assembly BuildAssembly(string sourceCode) { var libraryName = $"{StaticVariables.DynamicAssemblyPath()}\\{Guid.NewGuid():D}.dll"; CodeDomProvider compiler = CodeDomProvider.CreateProvider("CSharp"); CompilerParameters parameters = new CompilerParameters { GenerateExecutable = false, OutputAssembly = libraryName }; var results = compiler.CompileAssemblyFromSource(parameters, sourceCode); if (results.Errors.HasErrors) { var errors = new StringBuilder(); foreach (CompilerError error in results.Errors) { errors.AppendLine($"{error.ErrorNumber} {error.ErrorText}"); } throw new TheiaException($"Assembly was not compiled: {Environment.NewLine} {errors}"); } var assembly = Assembly.LoadFrom(libraryName); return(assembly); }
/// <summary> /// Checks input for a change in target position /// </summary> private void CheckMovementInput() { if (spellCaster.IsCasting() || InGameWrapper.instance.aimWrapper.IsAiming()) { return; } if (deviceInput.MouseButtonHeldDown()) { if (EventSystemReference.instance.EventSystem.IsPointerOverGameObject(deviceInput.GetMousePointerId())) { return; } RaycastHit hit = new RaycastHit(); Ray mouseRay = InGameWrapper.instance.camera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(mouseRay, out hit, 100f, generalPlayerData.groundMask)) { Debug.DrawLine(playerGmj.transform.position, hit.point); var newTargetPos = new Vector3(hit.point.x, playerGmj.transform.position.y, hit.point.z); if (newTargetPos == targetPos) { return; } InGameWrapper.instance.cursorWrapper.SetPosition(newTargetPos); SetTargetPos(new Vector3(hit.point.x, StaticVariables.GetYPos(), hit.point.z)); } } }
// @brief Update is called once per frame // Handles adding players to the game and starting the game private void Update() { if (m_isLoading) { return; } // Add players to the game AddPlayer(); // If there are no players in the list, the game cannot start if (Menus.GetActivatedPlayerAmount() <= 0) { return; } else { // Loop through each controller and check for an input to start the game for (int i = 0; i < Menus.GetActivatedPlayerAmount(); i++) { // Only allow players who have joined the game to start it StaticVariables holder = Menus.GetPlayerInformation(i); XboxController controller = holder.Controller; // Only let the player change hat and ready up if they have not already readied up if (!holder.IsReady) { HatSelection(); ReadyUp(); } else { // Check for the players input if (XCI.GetButtonDown(XboxButton.Start, controller)) { m_PlayerAddMenu.SetActive(false); m_loadingMenu.SetActive(true); for (int j = 0; j < m_listOfUI.Count; j++) { Destroy(m_listOfUI[j]); Destroy(m_readyPlayers[j]); } gameObject.GetComponent<PlayerAdd>().enabled = false; } } } } for (int i = 0; i < Menus.GetActivatedPlayerAmount(); i++) { StaticVariables holder = Menus.GetPlayerInformation(i); ControllerVibrato(holder); } }
private void Teleport() { isDead = true; var player = InGameWrapper.instance.playersWrapper.GetPlayerByOwnerGUID(spell.request.ownerGUID); player.SetCurrentPos(new Vector3(spell.request.spellXPos, StaticVariables.GetYPos(), spell.request.spellZPos)); player.SetTargetPos(new Vector3(spell.request.spellXPos, StaticVariables.GetYPos(), spell.request.spellZPos)); }
Vector3 GetPositionForPlayer(float playerNr, float length) { float fullAngle = 360; float angle = fullAngle * (playerNr / countOfAllPlayers); var v = DegreeToVector2(angle) * length; return(new Vector3(v.x, StaticVariables.GetYPos(), v.y)); }
private GameObject CreateKunai(Vector3 startPosition) { var resultObject = Instantiate(kunaiObject, startPosition, Quaternion.identity); resultObject.name = StaticVariables.GetKunaiName(_kunaiId); resultObject.transform.parent = transform; resultObject.transform.localScale -= new Vector3(_gameScript.gameState.Scale, _gameScript.gameState.Scale, _gameScript.gameState.Scale); _kunaiId++; return(resultObject); }
private void Initialize() { LoadAllStages(); StageHelper = new StageHelperModel(); StageHelper.PropertyChanged += StageHelper_PropertyChanged; StaticVariables.SetStaticVariables(); LoadSettings(); LoadEmokitOptions(); ConnectToEmokitServer(false); DataContext = this; }
public IEnumerator DelayedDisable() { StaticVariables.youWin = 1; StaticVariables.SaveGame(); yield return(new WaitForSeconds(17f)); Instantiate(GameObject.FindGameObjectWithTag("GameController").GetComponent <GameControllerScript>().transitionImage, new Vector3(0f, 0f, 0f), Quaternion.identity); yield return(new WaitForSeconds(1f)); SceneManager.LoadScene("Level", LoadSceneMode.Single); transform.parent.gameObject.SetActive(false); }
// Update is called once per frame void Update() { float currExp = StaticVariables.GetCharacterAttribute(StaticVariables.characterID)["currentExp"].n; float maxExp = StaticVariables.GetCharacterAttribute(StaticVariables.characterID)["maxExpForThisLevel"].n; float width = maxWidth * currExp / maxExp; GetComponent <RectTransform>().sizeDelta = new Vector2(width, GetComponent <RectTransform>().sizeDelta.y); if (pointsToGain > 0) { ExpGrow(); } }
private void ControllerVibrato(StaticVariables a_holder) { //if ((a_holder.TimeToStopVibrato * 30) > 0) //{ // XCI.SetVibration(a_holder.Controller, 1f, 1f); // a_holder.TimeToStopVibrato -= Time.time; //} //else //{ // XCI.StopVibration(a_holder.Controller); //} }
// @brief Adds data to the player list // @param StaticVariable class which holds variables within that class // @param Int value to store what position the data will be stored // @return Returns the variables stored in StaticVariables from a certain player public static void AddToPlayerList(StaticVariables a_staticVariables, int a_postionToAdd) { // Make sure the data being passsed is valid if (a_staticVariables == null) { return; } else { // Will add data to list. Advised to use a for loop outside to ensure that you don't add more than m_maximumNumberOfPlayers instance.m_playerList.Insert(a_postionToAdd, a_staticVariables); } }
private void Awake() { instance = this; // This needs to be re-enabled Player playerClone; for (int i = 0; i < Menus.GetActivatedPlayerAmount(); i++) { // Create the players an attach their controllers playerClone = Instantiate(m_playerToSpawn); m_playerList.Insert(i, playerClone); StaticVariables holder = Menus.GetPlayerInformation(i); playerClone.controller = holder.Controller; // Set the players spawn point playerClone.transform.position = m_spawnPoints[i].transform.position; // Set the players index playerClone.SetPlayerIndex(holder.Player); // Set player details if (holder.HatID != e_Hats.NONE) { playerClone.PlayerHat = m_hats[(int)holder.HatID]; playerClone.HatID = holder.HatID; // Creates player hat playerClone.PlayerHat = Instantiate(Timer.Hat[(int)playerClone.HatID]); playerClone.PlayerHat.transform.SetParent(playerClone.HatattachPoint.transform); playerClone.PlayerHat.transform.ResetTransform(); Material newMat = Instantiate(holder.HatMaterial); newMat.SetColor(holder.HatMaterial.name, holder.HatMaterial.color); GameObject m = playerClone.PlayerHat.GetComponent <Reference>().m_reference; MeshRenderer a = m.GetComponent <MeshRenderer>(); //MeshRenderer hatRenderer = m_playerList[i].PlayerHat.GetComponent<Reference>().gameObject.GetComponent<MeshRenderer>(); a.material = newMat; } // Add the players to the playerList // Set the shirts material Material newMaterial = Instantiate(holder.PlayerMaterial); newMaterial.SetColor(holder.PlayerMaterial.name, holder.PlayerMaterial.color); SkinnedMeshRenderer thisRenderer = m_playerList[i].GetPlayerShirt().GetComponent <SkinnedMeshRenderer>(); thisRenderer.material = newMaterial; } }
private void ApplyModificationDown(StaticVariables a_holder) { if (((int)a_holder.HatID) > 0) { a_holder.HatID--; } else { a_holder.HatID = e_Hats.PAPERBOAT; } // Have to loop through all the other players to not allow two players to have the same hat // Each player requires a different silhouette for disability friendly gameplay for (int i = 0; i < Menus.GetActivatedPlayerAmount(); i++) { StaticVariables otherPlayers = Menus.GetPlayerInformation(i); // Only have this affect players who have not readied-up //if (otherPlayers.IsReady) //{ // // Make sure we are not checking the player who is adjusting the hat to themself, only to other players // if (otherPlayers.Player != a_holder.Player) // { // // Check if they are wearing the same hat // if ((int)otherPlayers.HatID == (int)a_holder.HatID) // { // if (((int)a_holder.HatID) > 0) // { // a_holder.HatID--; // } // else // { // a_holder.HatID = e_Hats.PAPERBOAT; // } // } // } //} } a_holder.Hat = Instantiate(m_hats[(int)a_holder.HatID]); a_holder.Hat.transform.SetParent(m_unreadyAttachPoints[a_holder.Player]); a_holder.Hat.transform.ResetTransform(); // Gets the material a_holder.HatMaterial = GetNewHatMaterial(a_holder.Player, a_holder.HatID); // Material needs to be applied to model if (a_holder.HatMaterial != null) { a_holder.Hat.GetComponent<Reference>().m_reference.GetComponent<MeshRenderer>().material = a_holder.HatMaterial; } m_wasChanged = true; }
public void ProcedureChanged() { if (GetComponent <Dropdown>().value == 0) { StaticVariables.SetSystemProcedure(SYSTEM_PROCEDURE.SECTION_BASED); } if (GetComponent <Dropdown>().value == 1) { StaticVariables.SetSystemProcedure(SYSTEM_PROCEDURE.PREDICTION_BASED); } if (GetComponent <Dropdown>().value == 2) { StaticVariables.SetSystemProcedure(SYSTEM_PROCEDURE.BOTH); } }
// A method is a member of a class. It has a signature and a body. The signature defines the type and number of parameters that the method will accept. // The body is a block of code that is performed when the method is called. If the method has a type other than void, all code paths through the body of the code // must end with a return statement that returns a value of the type of the method. public void SimpleMethods() { StaticVariables x = new StaticVariables(10); Console.WriteLine("x = {0}", x); if (x.RemoveLives(2)) { Console.WriteLine("Still alive"); } else { Console.WriteLine("Alien destroyed"); } Console.WriteLine("x = {0}", x); }
public PlayerController(GameObject playerGmj, Message_ServerCommand_CreateGameObject info, UnityPlayerData generalPlayerData, IDeviceInput deviceInput) { alive = true; playerScoreController = new PlayerScoreController(); spellCaster = new SpellCasterController(this); playerAnimator = new PlayerAnimatorController(playerGmj); healthController = new PlayerHealthController(this, generalPlayerData); this.playerGmj = playerGmj; this.generalPlayerData = generalPlayerData; PlayerControllerGUID = info.GmjGUID; OwnerID = info.OwnerGUID; playerGmj.transform.position = new Vector3(info.transform.xPos, StaticVariables.GetYPos(), info.transform.zPos); targetPos = playerGmj.transform.position; this.deviceInput = deviceInput; }
private void ReadyUp() { for (int i = 0; i < Menus.GetActivatedPlayerAmount(); i++) { StaticVariables holder = Menus.GetPlayerInformation(i); XboxController controller = holder.Controller; if (XCI.GetButtonDown(XboxButton.Y, controller)) { holder.IsReady = true; m_listOfUI[i].GetComponent<ConfirmController>().ChangeConfirmState(holder.IsReady); LockedIn(holder); } } }
void Shoot() { AudioSource.PlayClipAtPoint(laserSFX, transform.position, laserVolume + StaticVariables.VolumeVariance()); laserCooldown = laserCooldownMax; GameObject laser_01 = (GameObject)Instantiate(laser, player.transform.position, player.transform.rotation); GameObject laser_02 = (GameObject)Instantiate(laser, player.transform.position, player.transform.rotation); laser_01.transform.localPosition += laserStartPosition[0].y * laser_01.transform.up; laser_01.transform.localPosition += laserStartPosition[0].x * laser_01.transform.right; laser_02.transform.localPosition += laserStartPosition[1].y * laser_01.transform.up; laser_02.transform.localPosition += laserStartPosition[1].x * laser_01.transform.right; laser_01.transform.parent = Camera.main.transform; laser_02.transform.parent = Camera.main.transform; }
void Update() { switch (_state) { case (State.Idle): if (Input.GetMouseButtonDown(0)) { _state = State.Flying; } break; case (State.Flying): if (IsIntersects(_logObject.GetComponent <CircleCollider2D>().bounds)) { Stuck(_logObject.transform); _levelScript.Stuck(); var desiredPosition = _logObject.transform.position.y - _gameState.LogHeight / 2 - _gameState.KunaiHeight / 2 + StaticVariables.KunaiMargin; transform.Translate(0, desiredPosition - transform.position.y, 0); } else { if (_apple != null && IsIntersects(_apple.GetComponent <CircleCollider2D>().bounds)) { _levelScript.HitApple(); } var missed = false; var kunaiId = 0; var stuckKunai = _logObject.transform.Find(StaticVariables.GetKunaiName(kunaiId)); while (stuckKunai != null) { missed = missed || IsIntersects(stuckKunai.GetComponent <PolygonCollider2D>().bounds); kunaiId++; stuckKunai = _logObject.transform.Find(StaticVariables.GetKunaiName(kunaiId)); } if (missed) { _levelScript.Missed(); } else { transform.Translate(0, 2 * _gameState.ScreenHeight * Time.deltaTime, 0); } } break; } }
void PlotGraph() { Vector3 p1, p2; Vector3 screenPos1, screenPos2; dataPointArray = PairDistributionFunction.PairDistributionAverage; if (dataPointArray.Length <= 1) { xSpacing = 0; } else { xSpacing = graphRect.width * canvasScale / (dataPointArray.Length - 1); } yMax = Mathf.Max(dataPointArray); if (yMax <= 0) { return; } for (int i = 0; i < dataPointArray.Length - 1; i++) { float d1 = (float)dataPointArray[i]; float d2 = (float)dataPointArray[i + 1]; float percent1 = d1 / yMax; float percent2 = d2 / yMax; float yVal1 = percent1 * graphHeight; float yVal2 = percent2 * graphHeight; screenPos1 = new Vector3(graphOrigin.x + (i * xSpacing), graphOrigin.y + yVal1, 5.0f); screenPos2 = new Vector3(screenPos1.x + xSpacing, graphOrigin.y + yVal2, 5.0f); //screen p1 = Camera.main.ScreenToWorldPoint(screenPos1); p2 = Camera.main.ScreenToWorldPoint(screenPos2); //Debug.Log(p1); StaticVariables.DrawLine(p1, p2, Color.white, Color.white, 0.015f, mat); } }
// Use this for initialization void Awake() { if (isStartDebug) { Load.initialize(); StaticVariables.GetCharacterAttribute(StaticVariables.characterID); } if (debugChar != -1) { StaticVariables.characterID = debugChar; } for (int i = 0; i < characters.Length; ++i) { if (i == StaticVariables.characterID) { characters[i].SetActive(true); } } /* * int playerID = PlayerPrefs.GetInt ("PlayerID"); * * if(playerID == 0) { * Destroy (character2); * } else if(playerID == 1) { * Destroy (character1); * } */ coin = StaticVariables.coinNumber; //PlayerPrefs.GetInt ("Coins"); rank = StaticVariables.ranking; time = StaticVariables.raceTimeStr; //PlayerPrefs.GetString ("TotalTime"); Debug.Log("rank = " + rank); /* * if (rank == 1) { * grade.text = "A"; * description.text = "CONGRATULATIONS!\nYou were the FIRST ONE who reached the classroom!! You spent " + time + " to reach the classroom. Professor was very happy and decided to give you a BIG A!!"; * } else { * grade.text = "B"; * description.text = "UNFORTUNATELY...\nYou were NOT the first one who reached the classroom... You spent " + time + " to reach the classroom. As a result, you are not assigned an A... Try again!!"; * } * description.text += "\nYou've eared " + coin + " coins during the race. You can go to store to make upgration!"; */ }
void Start() { Load.initialize(true); if (debugExp != -1) { StaticVariables.expGained = debugExp; } pointsToGain = StaticVariables.expGained; speed = StaticVariables.expGained / totalTime; description.text = "Level = " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("level").n; description.text += "\nHP = " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("hp").n; description.text += "\nMP = " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("mp").n; description.text += "\nAttack = " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("attack").n; description.text += "\nDefense = " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("defense").n; description.text += "\nSpeed = " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("speed").n; description.text += "\nMP Regen. = " + StaticVariables.GetCharacterAttribute(StaticVariables.characterID).GetField("CD").n; }
// Update is called once per frame void Update() { //Debug.Log("Waiting " + m_waiting); //Debug.Log("Time " + Time.time); if (m_waiting < Time.time) { m_imageToDisplay.SetActive(true); for (int i = 0; i < Menus.GetActivatedPlayerAmount(); i++) { StaticVariables characterBeingChecked = Menus.GetPlayerInformation(i); if (XCI.GetButtonDown(XboxButton.Start, characterBeingChecked.Controller)) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } } } }
// Use this for initialization void Start() { TotalEnergyUsedOnRoadwayLighting = TotalEnergyUsedOnRoadwayLighting * PercentOfRoadsUsingTheSystem; float OffIntensityToOnIntensity = RoadController.LightsOffIntensity / RoadController.LightsOnIntensity; LightsOnText.text = "Total Time On: " + StaticVariables.CommulativeLightsOnTime.ToString(); LightsOffText.text = "Total Time Off: " + StaticVariables.CommulativeLightsOffTime.ToString(); float i = (StaticVariables.CommulativeLightsOnTime / (StaticVariables.CommulativeLightsOnTime + StaticVariables.CommulativeLightsOffTime)); float w = (StaticVariables.CommulativeLightsOffTime / (StaticVariables.CommulativeLightsOnTime + StaticVariables.CommulativeLightsOffTime)); OnToTotalTimeRatio.text = "On to Total Time Ratio: " + i.ToString(); OffToTotalTimeRatio.text = "Off to Total Time Ratio: " + w.ToString(); float powerSaved = TotalEnergyUsedOnRoadwayLighting * w * OffIntensityToOnIntensity; float moneySaved = powerSaved * PriceOfKilowattHour; PercentageUsageText.text = "With " + (PercentOfRoadsUsingTheSystem * 100).ToString() + "% of the U.S. Using this System:"; PowerSavedText.text = "Power Saved: " + powerSaved.ToString() + " Kilowatt/Hours"; MoneySavedText.text = "Money Saved: $" + moneySaved.ToString(); StaticVariables.LReset(); }
// Update is called once per frame void Update() { for (int i = 0; i < Menus.GetActivatedPlayerAmount(); i++) { StaticVariables player = Menus.GetPlayerInformation(i); if (XCI.GetButtonDown(XboxButton.Start, player.Controller)) { if (m_gameIsPaused && m_playerWhoPaused == player.Controller) { Resume(); } else if (!m_gameIsPaused) { m_playerWhoPaused = player.Controller; Pause(player.Player); } } } }
private static void Entities_OnCloseAll() { MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll; MyAPIGateway.Multiplayer.UnregisterMessageHandler(ShipAutopilot.ModId_CustomInfo, MessageHandler); Static.s_logger.debugLog("Unregisterd for messages", Logger.severity.DEBUG); Static = null; }
void Start() { vars = FindObjectOfType<StaticVariables>(); }
private static void Entities_OnCloseAll() { MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll; Static = null; }
private void close() { Static.m_lockLogging.AcquireExclusive(); LogItem closingLog = new LogItem() { context = f_context.InvokeIfExists(), className = m_classname, time = DateTime.Now, level = severity.INFO, //member = null, //lineNumber = 0, toLog = "Closing log", //primaryState = null, //secondaryState = null, thread = ThreadTracker.GetNameOrNumber() }; log(ref closingLog); StaticVariables temp = Static; Static = null; try { if (temp.logWriter != null) { temp.logWriter.Flush(); temp.logWriter.Close(); } } catch (ObjectDisposedException) { } finally { temp.m_lockLogging.ReleaseExclusive(); } }
private static void Entities_OnCloseAll() { MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll; MyTerminalControls.Static.CustomControlGetter -= CustomControlGetter; Static = null; }