/// <inheritdoc /> public override void Initialize() { base.Initialize(); if (!Application.isPlaying) { return; } var currentEventSystem = EventSystem.current; frameEventData = new FrameEventData(currentEventSystem); consoleEventData = new ConsoleEventData(currentEventSystem); memoryEventData = new MemoryEventData(currentEventSystem); }
private void SpawnMysteriousGod(FrameEventData evt) { _MysteriousGod = Main.npc[NPC.NewNPC((int)EoCDeathPoint.X + 1000, (int)EoCDeathPoint.Y, TUA.instance.NPCType("Eye_of_Apocalypse"))].modNPC as EyeOApocalypse; _MysteriousGod.npc.color = Color.Black; _MysteriousGod.npc.GivenName = "???"; _MysteriousGod.npc.immortal = true; _MysteriousGod.npc.dontTakeDamage = true; _MysteriousGod.npc.takenDamageMultiplier = 0f; _MysteriousGod.npc.knockBackResist = 0f; _MysteriousGod.npc.immune[255] = 100000; _MysteriousGod.npc.Opacity = 0; _MysteriousGod.npc.rotation = _UEoC.rotation * -1; _MysteriousGod.npc.localAI[0] = 1f; }
private void UpdateCamera(FrameEventData evt) { Vector2 cameraPosition = Main.screenPosition; //Vector2 difference = cameraPosition - _CameraTarget; //difference = Vector2.Normalize(difference); //var dif = difference * (float) TUA.gameTime.ElapsedGameTime.TotalSeconds; cameraPosition = Vector2.Lerp(cameraPosition, _CameraTarget, 0.6f); //cameraPosition += difference * (float) TUA.gameTime.ElapsedGameTime.TotalSeconds * 0.4f; if ((cameraPosition - _CameraTarget).Length() < _speed) { cameraPosition = _CameraTarget; } TUAPlayer.LockPlayerCamera(cameraPosition, true); }
/// <inheritdoc /> public void OnFrameRateChanged(FrameEventData eventData) { var framesPerSecond = eventData.FramesPerSecond; var milliseconds = framesPerSecond == 0 ? 0.0f : (1.0f / framesPerSecond) * 1000.0f; millisecondStringBuilder.AppendFormat(DisplayedDecimalFormat, milliseconds.ToString(CultureInfo.InvariantCulture)); if (eventData.IsGpuReading) { stringBuilder.AppendFormat(GPU, framesPerSecond.ToString(), millisecondStringBuilder); gpuFrameRateText.text = stringBuilder.ToString(); } else { stringBuilder.AppendFormat(CPU, framesPerSecond.ToString(), millisecondStringBuilder); cpuFrameRateText.text = stringBuilder.ToString(); } millisecondStringBuilder.Clear(); stringBuilder.Clear(); }
void JObject(FrameEventData frameEventData) { var jObject = frameEventData.EventData; switch (frameEventData.name) { case "RoleAtk": animEventDelegate?.OnAtk(jObject.ToObject <FrameEventInfo.RoleAtkFrameEventData>()); break; case "RoleSkill": animEventDelegate?.OnSkill(jObject.ToObject <FrameEventInfo.RoleSkillFrameEventData>()); break; case "PlayAnim": animEventDelegate?.OnPlayAnim(jObject.ToObject <FrameEventInfo.PlayAnimFrameEventData>()); break; case "Custom": animEventDelegate?.OnCustom(jObject.ToObject <FrameEventInfo.CustomFrameEventData>()); break; case "VariableSpeed": animEventDelegate?.OnVariableRoleMoveSpeed(jObject.ToObject <FrameEventInfo.VariableRoleMoveSpeedData>()); break; case "PlayAnimList": animEventDelegate?.OnPlayAnimList(jObject.ToObject <FrameEventInfo.FrameEventAnimList>()); break; case "SetSpeed": animEventDelegate?.OnSetSpeedFrameEvent(jObject.ToObject <FrameEventInfo.SetSpeedFrameEvent>()); break; case "PlayAnimEffect": animEventDelegate?.OnPlayAnimEffect(jObject.ToObject <FrameEventInfo.PlayAnimEffectFrameEventData>()); break; case "SetAnimSpeed": animEventDelegate?.OnSetAnimSpeedFrameEvent(jObject.ToObject <FrameEventInfo.SetAnimSpeedFrameEvent>()); break; case "MoveToTarget": animEventDelegate?.OnMoveToTargetFrameEvent(jObject.ToObject <FrameEventInfo.MoveToTargetFrameEvent>()); break; case "CameraShake": animEventDelegate?.OnCameraShakeFrameEvent(jObject.ToObject <FrameEventInfo.CameraShakeFrameEvent>()); break; case "SuperArmor": animEventDelegate?.OnSuperArmor(jObject.ToObject <FrameEventInfo.SuperArmorFrameEvent>()); break; case "RoleSkillList": animEventDelegate?.OnSkillList(jObject.ToObject <FrameEventInfo.RoleSkillListFrameEvent>()); break; case "RoleAiFlyTo": animEventDelegate?.OnRoleAiFlyTo(jObject.ToObject <FrameEventInfo.RoleAiFlyToFrameEventData>()); break; case "AnimProperty": animEventDelegate?.OnAnimProperty(jObject.ToObject <FrameEventInfo.AnimProperty>()); break; case "PlayAudio": animEventDelegate?.OnPlayAudio(jObject.ToObject <FrameEventInfo.PlayAudio>()); break; case "OnTread": animEventDelegate?.OnTread(jObject.ToObject <FrameEventInfo.OnTread>()); break; default: animEventDelegate?.OnJObject(jObject); break; } }
private static void BlankFrame(FrameEventData evt) { //num }
private void UEoCInitialDialog(FrameEventData evt) { TUA.BroadcastMessage("<Eye of Cthulhu> ... Not again, I'm too weak to defeat the terrarian, sorry lord but I cannot avenge you..."); _UEoC.Opacity -= 0.25f; }
private void FreeLock(FrameEventData evt) { TUAPlayer.LockPlayerCamera(null, false); }
private void UEoCfirstTalk(FrameEventData evt) { TUA.BroadcastMessage("<Eye of Cthulhu> Who are you???"); }
private void UpdateMysteriousGodOpacityInitial(FrameEventData evt) { //_MysteriousGod.npc.Opacity += 0.05f; }