public void AnimateXpGain(ReadyCallback readyCallback) { xpReadyCallback = readyCallback; updateSpeed = Configs.main.UI.XpBarUpdateSpeed; xpGained = Resource.Value; levelsAtStart = Resource.Level; currentLevel = levelsAtStart; levelsGained = 0; XPContainer.SetActive(false); if (xpGained > 0) { BarContainer.SetActive(true); IconContainer.SetActive(true); LevelContainer.SetActive(true); } xpsPerLevel = new List <int>(); currentLevelXpBound = Resource.XpPerLevel; while (xpGained >= Resource.XpPerLevel) { levelsGained++; xpGained -= Resource.XpPerLevel; xpsPerLevel.Add(Resource.XpPerLevel); Resource.Level++; } SetCurrentTarget(); StartCoroutine("GainXP"); }
public void Reset(ResetCause cause, ReadyCallback readyCallback) { if (!isResetting) { this.cause = cause; isResetting = true; animator.enabled = true; animator.SetTrigger("Open"); allReadyCallback = readyCallback; } }
//Constructors public RconClient(IPEndPoint endpoint, string password, ReadyCallback onReady) { //First, we're going to make a socket to the server. sock = new Socket(SocketType.Stream, ProtocolType.Tcp); //Connect sock.Connect(endpoint); //Begin waiting for a packet. PrivateBeginWaitingForPacket(); //Authenticate with the server PrivateGetPackets(new RconPacket(0, RconPacketType.SERVERDATA_AUTH, password), new GotPacketCallback((List <RconPacket> packets) => { onReady(this, true); })); }
public void StartFading(ResetCause cause, ReadyCallback readyCallback) { if (config == null) { config = Configs.main.UI; } textList = new List <string>(); string text = DetermineText(cause); foreach (string line in text.Split('\n')) { textList.Add(line.Trim()); } StartFading(textList, readyCallback); }
public void StartFading(List <string> texts, ReadyCallback readyCallback) { config = Configs.main.UI; if (texts.Count == 0) { readyCallback(); } currentText = 0; textList = texts; if (txtTarget == null) { txtTarget = this.FindChildObject("txtTarget").GetComponent <Text>(); } if (txtInfo == null) { txtInfo = this.FindChildObject("txtInfo").GetComponent <Text>(); txtInfo.text = "- Press {0} to skip -".Format(config.SkipKey); } txtInfo.enabled = true; this.readyCallback = readyCallback; isRunning = true; FadeInText(); }
public void OpenResetDialog(ResetCause cause, ReadyCallback callback) { Time.timeScale = 0f; readyCallback = callback; loopResetDialog.Reset(cause, AfterReset); }