Decompiled source of DBZUtils v6.9.2
DBZUtilities.dll
Decompiled 5 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using EntityStates; using EntityStates.Commando; using EntityStates.JellyfishMonster; using EntityStates.Merc; using IL.RoR2; using JetBrains.Annotations; using KinematicCharacterController; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Utils; using Rewired; using RoR2; using RoR2.Achievements; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using TMPro; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("DBZUtilities")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyCompany("DBZUtilities")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: CompilationRelaxations(8)] [assembly: AssemblyConfiguration("Debug")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyTitle("DBZUtilities")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [ExecuteInEditMode] public class ChildTubeRenderer : MonoBehaviour { [SerializeField] private Vector3[] _positions; [SerializeField] private int _sides; [SerializeField] private float _radiusOne; [SerializeField] private float _radiusTwo; [SerializeField] private bool _useWorldSpace = true; [SerializeField] private bool _useTwoRadii = false; private Vector3[] _vertices; private Mesh _mesh; private MeshFilter _meshFilter; private MeshRenderer _meshRenderer; public Transform start; public Transform end; public LineRenderer lineRenderer; [SerializeField] public Vector2 lineRendererScale; public Material material { get { return ((Renderer)_meshRenderer).material; } set { ((Renderer)_meshRenderer).material = value; } } private void Awake() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) _meshFilter = ((Component)this).GetComponent<MeshFilter>(); if ((Object)(object)_meshFilter == (Object)null) { _meshFilter = ((Component)this).gameObject.AddComponent<MeshFilter>(); } _meshRenderer = ((Component)this).GetComponent<MeshRenderer>(); if ((Object)(object)_meshRenderer == (Object)null) { _meshRenderer = ((Component)this).gameObject.AddComponent<MeshRenderer>(); } _mesh = new Mesh(); _meshFilter.mesh = _mesh; start = ((Component)((Component)this).transform.parent).GetComponent<TubeRenderer>().start; end = ((Component)((Component)this).transform.parent).GetComponent<TubeRenderer>().end; _positions = (Vector3[])(object)new Vector3[2] { start.position, end.position }; if (Object.op_Implicit((Object)(object)lineRenderer)) { lineRenderer.positionCount = 2; } } private void OnEnable() { ((Renderer)_meshRenderer).enabled = true; } private void OnDisable() { ((Renderer)_meshRenderer).enabled = false; } private void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) GenerateMesh(); _positions[0] = start.position; _positions[1] = end.position; if (Object.op_Implicit((Object)(object)lineRenderer)) { lineRenderer.SetPosition(0, start.position); lineRenderer.SetPosition(1, end.position); lineRenderer.startWidth = lineRendererScale.x; lineRenderer.endWidth = lineRendererScale.y; } } private void OnValidate() { _sides = Mathf.Max(3, _sides); } public void SetPositions(Vector3[] positions) { _positions = positions; GenerateMesh(); } private void GenerateMesh() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_mesh == (Object)null || _positions == null || _positions.Length <= 1) { _mesh = new Mesh(); return; } int num = _sides * _positions.Length; if (_vertices == null || _vertices.Length != num) { _vertices = (Vector3[])(object)new Vector3[num]; int[] triangles = GenerateIndices(); Vector2[] uv = GenerateUVs(); if (num > _mesh.vertexCount) { _mesh.vertices = _vertices; _mesh.triangles = triangles; _mesh.uv = uv; } else { _mesh.triangles = triangles; _mesh.vertices = _vertices; _mesh.uv = uv; } } int num2 = 0; for (int i = 0; i < _positions.Length; i++) { Vector3[] array = CalculateCircle(i); Vector3[] array2 = array; foreach (Vector3 val in array2) { _vertices[num2++] = (_useWorldSpace ? ((Component)this).transform.InverseTransformPoint(val) : val); } } _mesh.vertices = _vertices; _mesh.RecalculateNormals(); _mesh.RecalculateBounds(); _meshFilter.mesh = _mesh; } private Vector2[] GenerateUVs() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) Vector2[] array = (Vector2[])(object)new Vector2[_positions.Length * _sides]; for (int i = 0; i < _positions.Length; i++) { for (int j = 0; j < _sides; j++) { int num = i * _sides + j; float num2 = (float)j / ((float)_sides - 1f); float num3 = (float)i / ((float)_positions.Length - 1f); array[num] = new Vector2(num2, num3); } } return array; } private int[] GenerateIndices() { int[] array = new int[_positions.Length * _sides * 2 * 3]; int num = 0; for (int i = 1; i < _positions.Length; i++) { for (int j = 0; j < _sides; j++) { int num2 = i * _sides + j; int num3 = num2 - _sides; array[num++] = num3; array[num++] = ((j == _sides - 1) ? (num2 - (_sides - 1)) : (num2 + 1)); array[num++] = num2; array[num++] = ((j == _sides - 1) ? (num3 - (_sides - 1)) : (num3 + 1)); array[num++] = ((j == _sides - 1) ? (num2 - (_sides - 1)) : (num2 + 1)); array[num++] = num3; } } return array; } private Vector3[] CalculateCircle(int index) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) int num = 0; Vector3 val = Vector3.zero; Vector3 val3; if (index > 0) { Vector3 val2 = val; val3 = _positions[index] - _positions[index - 1]; val = val2 + ((Vector3)(ref val3)).normalized; num++; } if (index < _positions.Length - 1) { Vector3 val4 = val; val3 = _positions[index + 1] - _positions[index]; val = val4 + ((Vector3)(ref val3)).normalized; num++; } val3 = val / (float)num; val = ((Vector3)(ref val3)).normalized; val3 = Vector3.Cross(val, val + new Vector3(0.123564f, 0.34675f, 0.756892f)); Vector3 normalized = ((Vector3)(ref val3)).normalized; val3 = Vector3.Cross(val, normalized); Vector3 normalized2 = ((Vector3)(ref val3)).normalized; Vector3[] array = (Vector3[])(object)new Vector3[_sides]; float num2 = 0f; float num3 = MathF.PI * 2f / (float)_sides; float num4 = (float)index / ((float)_positions.Length - 1f); float num5 = (_useTwoRadii ? Mathf.Lerp(_radiusOne, _radiusTwo, num4) : _radiusOne); for (int i = 0; i < _sides; i++) { float num6 = Mathf.Cos(num2); float num7 = Mathf.Sin(num2); array[i] = _positions[index] + normalized * num6 * num5 + normalized2 * num7 * num5; num2 += num3; } return array; } } public class SpiralLineRenderer : MonoBehaviour { public Transform object1; public Transform object2; private LineRenderer lineRenderer; private int NUMBER_OF_POINTS = 200; private int NUMBER_OF_REVOLUTIONS = 12; public float SPIRAL_WIDTH = 2f; private void Awake() { lineRenderer = ((Component)this).GetComponent<LineRenderer>(); } private void Start() { CreateCurveShape(); } private void CreateCurveShape() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Distance(object1.position, object2.position); NUMBER_OF_REVOLUTIONS = Mathf.CeilToInt(num * 0.3f); NUMBER_OF_POINTS = Mathf.CeilToInt(num * 5.6f); lineRenderer.positionCount = NUMBER_OF_POINTS; Vector3[] array = (Vector3[])(object)new Vector3[NUMBER_OF_POINTS]; for (int i = 0; i < NUMBER_OF_POINTS; i++) { Vector3 val = object2.position - object1.position; Vector3 val2 = Quaternion.Euler(90f, 0f, 0f) * val; Vector3 val3 = Vector3.Cross(val, val2); float num2 = (float)i / (float)NUMBER_OF_POINTS; float num3 = num2 * num; Vector3 val4 = object1.position + SPIRAL_WIDTH * ((Vector3)(ref val3)).normalized * Mathf.Sin((float)NUMBER_OF_REVOLUTIONS * num2 * 2f * MathF.PI) + SPIRAL_WIDTH * ((Vector3)(ref val2)).normalized * Mathf.Cos((float)NUMBER_OF_REVOLUTIONS * num2 * 2f * MathF.PI) + ((Vector3)(ref val)).normalized * num3; array[i] = val4; } lineRenderer.SetPositions(array); } } [ExecuteInEditMode] public class TubeRenderer : MonoBehaviour { [SerializeField] private Vector3[] _positions; [SerializeField] private int _sides; [SerializeField] private float _radiusOne; [SerializeField] private float _radiusTwo; [SerializeField] private bool _useWorldSpace = true; [SerializeField] private bool _useTwoRadii = false; private Vector3[] _vertices; private Mesh _mesh; private MeshFilter _meshFilter; private MeshRenderer _meshRenderer; public Transform start; public Transform end; public LineRenderer lineRenderer; [SerializeField] public Vector2 lineRendererScale; public Material material { get { return ((Renderer)_meshRenderer).material; } set { ((Renderer)_meshRenderer).material = value; } } private void Awake() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) _meshFilter = ((Component)this).GetComponent<MeshFilter>(); if ((Object)(object)_meshFilter == (Object)null) { _meshFilter = ((Component)this).gameObject.AddComponent<MeshFilter>(); } _meshRenderer = ((Component)this).GetComponent<MeshRenderer>(); if ((Object)(object)_meshRenderer == (Object)null) { _meshRenderer = ((Component)this).gameObject.AddComponent<MeshRenderer>(); } _mesh = new Mesh(); _meshFilter.mesh = _mesh; _positions = (Vector3[])(object)new Vector3[2] { start.position, end.position }; if (Object.op_Implicit((Object)(object)lineRenderer)) { lineRenderer.positionCount = 2; } } private void OnEnable() { ((Renderer)_meshRenderer).enabled = true; } private void OnDisable() { ((Renderer)_meshRenderer).enabled = false; } private void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) GenerateMesh(); _positions[0] = start.position; _positions[1] = end.position; Vector3 val = Vector3.RotateTowards(start.forward, -end.position, 10f, 0f); Vector3 val2 = Vector3.RotateTowards(end.forward, start.position, 10f, 0f); if (Object.op_Implicit((Object)(object)lineRenderer)) { lineRenderer.SetPosition(0, start.position); lineRenderer.SetPosition(1, end.position); lineRenderer.startWidth = lineRendererScale.x; lineRenderer.endWidth = lineRendererScale.y; } } private void OnValidate() { _sides = Mathf.Max(3, _sides); } public void SetPositions(Vector3[] positions) { _positions = positions; GenerateMesh(); } private void GenerateMesh() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_mesh == (Object)null || _positions == null || _positions.Length <= 1) { _mesh = new Mesh(); return; } int num = _sides * _positions.Length; if (_vertices == null || _vertices.Length != num) { _vertices = (Vector3[])(object)new Vector3[num]; int[] triangles = GenerateIndices(); Vector2[] uv = GenerateUVs(); if (num > _mesh.vertexCount) { _mesh.vertices = _vertices; _mesh.triangles = triangles; _mesh.uv = uv; } else { _mesh.triangles = triangles; _mesh.vertices = _vertices; _mesh.uv = uv; } } int num2 = 0; for (int i = 0; i < _positions.Length; i++) { Vector3[] array = CalculateCircle(i); Vector3[] array2 = array; foreach (Vector3 val in array2) { _vertices[num2++] = (_useWorldSpace ? ((Component)this).transform.InverseTransformPoint(val) : val); } } _mesh.vertices = _vertices; _mesh.RecalculateNormals(); _mesh.RecalculateBounds(); _meshFilter.mesh = _mesh; } private Vector2[] GenerateUVs() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) Vector2[] array = (Vector2[])(object)new Vector2[_positions.Length * _sides]; for (int i = 0; i < _positions.Length; i++) { for (int j = 0; j < _sides; j++) { int num = i * _sides + j; float num2 = (float)j / ((float)_sides - 1f); float num3 = (float)i / ((float)_positions.Length - 1f); array[num] = new Vector2(num2, num3); } } return array; } private int[] GenerateIndices() { int[] array = new int[_positions.Length * _sides * 2 * 3]; int num = 0; for (int i = 1; i < _positions.Length; i++) { for (int j = 0; j < _sides; j++) { int num2 = i * _sides + j; int num3 = num2 - _sides; array[num++] = num3; array[num++] = ((j == _sides - 1) ? (num2 - (_sides - 1)) : (num2 + 1)); array[num++] = num2; array[num++] = ((j == _sides - 1) ? (num3 - (_sides - 1)) : (num3 + 1)); array[num++] = ((j == _sides - 1) ? (num2 - (_sides - 1)) : (num2 + 1)); array[num++] = num3; } } return array; } private Vector3[] CalculateCircle(int index) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) int num = 0; Vector3 val = Vector3.zero; Vector3 val3; if (index > 0) { Vector3 val2 = val; val3 = _positions[index] - _positions[index - 1]; val = val2 + ((Vector3)(ref val3)).normalized; num++; } if (index < _positions.Length - 1) { Vector3 val4 = val; val3 = _positions[index + 1] - _positions[index]; val = val4 + ((Vector3)(ref val3)).normalized; num++; } val3 = val / (float)num; val = ((Vector3)(ref val3)).normalized; val3 = Vector3.Cross(val, val + new Vector3(0.123564f, 0.34675f, 0.756892f)); Vector3 normalized = ((Vector3)(ref val3)).normalized; val3 = Vector3.Cross(val, normalized); Vector3 normalized2 = ((Vector3)(ref val3)).normalized; Vector3[] array = (Vector3[])(object)new Vector3[_sides]; float num2 = 0f; float num3 = MathF.PI * 2f / (float)_sides; float num4 = (float)index / ((float)_positions.Length - 1f); float num5 = (_useTwoRadii ? Mathf.Lerp(_radiusOne, _radiusTwo, num4) : _radiusOne); for (int i = 0; i < _sides; i++) { float num6 = Mathf.Cos(num2); float num7 = Mathf.Sin(num2); array[i] = _positions[index] + normalized * num6 * num5 + normalized2 * num7 * num5; num2 += num3; } return array; } } [RequireComponent(typeof(MeshFilter))] [RequireComponent(typeof(MeshRenderer))] [ExecuteInEditMode] public class VolumetricLineStripBehavior : MonoBehaviour { private static readonly Vector3 Average = new Vector3(1f / 3f, 1f / 3f, 1f / 3f); [SerializeField] public Material m_templateMaterial; [SerializeField] private bool m_doNotOverwriteTemplateMaterialProperties; [SerializeField] private Color m_lineColor; [SerializeField] private float m_lineWidth; [SerializeField] [Range(0f, 1f)] private float m_lightSaberFactor; private Material m_material; private MeshFilter m_meshFilter; private MeshRenderer m_meshRenderer; [SerializeField] private Vector3[] m_lineVertices = (Vector3[])(object)new Vector3[3] { Vector3.zero, Vector3.zero, Vector3.zero }; public Vector3 maxLengthVector = new Vector3(0f, 0.0108f, 0f); private Vector3 targetLength; private float targetTrailLength; public float speed = 5f; public float maxTrailLength = 1.1f; public bool start = false; public int form = 0; private bool play = true; public VolumetricLineStripBehavior behaviour; private float stopwatch; public LightsaberTrail[] lightsaberTrails; public float lengthDelay = 0.15f; public bool hasStartDelay = true; public Material TemplateMaterial { get { return m_templateMaterial; } set { m_templateMaterial = value; } } public bool DoNotOverwriteTemplateMaterialProperties { get { return m_doNotOverwriteTemplateMaterialProperties; } set { m_doNotOverwriteTemplateMaterialProperties = value; } } public Color LineColor { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return m_lineColor; } set { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) CreateMaterial(); if ((Object)null != (Object)(object)m_material) { m_lineColor = value; m_material.color = m_lineColor; } } } public float LineWidth { get { return m_lineWidth; } set { CreateMaterial(); if ((Object)null != (Object)(object)m_material) { m_lineWidth = value; m_material.SetFloat("_LineWidth", m_lineWidth); } UpdateBounds(); } } public float LightSaberFactor { get { return m_lightSaberFactor; } set { CreateMaterial(); if ((Object)null != (Object)(object)m_material) { m_lightSaberFactor = value; m_material.SetFloat("_LightSaberFactor", m_lightSaberFactor); } } } public Vector3[] LineVertices => m_lineVertices; private void CreateMaterial() { if ((Object)null == (Object)(object)m_material || (Object)null == (Object)(object)((Renderer)((Component)this).GetComponent<MeshRenderer>()).sharedMaterial) { if ((Object)null != (Object)(object)m_templateMaterial) { m_material = Object.Instantiate<Material>(m_templateMaterial); ((Renderer)((Component)this).GetComponent<MeshRenderer>()).sharedMaterial = m_material; SetAllMaterialProperties(); } else { m_material = ((Renderer)((Component)this).GetComponent<MeshRenderer>()).sharedMaterial; } } } private void DestroyMaterial() { if ((Object)null != (Object)(object)m_material) { Object.DestroyImmediate((Object)(object)m_material); m_material = null; } } private float CalculateLineScale() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return Vector3.Dot(((Component)this).transform.lossyScale, Average); } public void UpdateLineScale() { if ((Object)null != (Object)(object)m_material) { m_material.SetFloat("_LineScale", CalculateLineScale()); } } private void SetAllMaterialProperties() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) UpdateLineVertices(m_lineVertices); if ((Object)null != (Object)(object)m_material) { if (!m_doNotOverwriteTemplateMaterialProperties) { m_material.color = m_lineColor; m_material.SetFloat("_LineWidth", m_lineWidth); m_material.SetFloat("_LightSaberFactor", m_lightSaberFactor); } UpdateLineScale(); } } private Bounds CalculateBounds() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(new float[3] { ((Component)this).transform.lossyScale.x, ((Component)this).transform.lossyScale.y, ((Component)this).transform.lossyScale.z }); float num2 = num * LineWidth * 0.5f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num2, num2, num2); Bounds result; if (m_lineVertices.Length == 0) { result = default(Bounds); return result; } Vector3 val2 = m_lineVertices[0]; Vector3 val3 = m_lineVertices[0]; for (int i = 1; i < m_lineVertices.Length; i++) { ((Vector3)(ref val2))..ctor(Mathf.Min(val2.x, m_lineVertices[i].x), Mathf.Min(val2.y, m_lineVertices[i].y), Mathf.Min(val2.z, m_lineVertices[i].z)); ((Vector3)(ref val3))..ctor(Mathf.Max(val3.x, m_lineVertices[i].x), Mathf.Max(val3.y, m_lineVertices[i].y), Mathf.Max(val3.z, m_lineVertices[i].z)); } result = default(Bounds); ((Bounds)(ref result)).min = val2 - val; ((Bounds)(ref result)).max = val3 + val; return result; } public void UpdateBounds() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)null != (Object)(object)m_meshFilter) { Mesh sharedMesh = m_meshFilter.sharedMesh; if ((Object)null != (Object)(object)sharedMesh) { sharedMesh.bounds = CalculateBounds(); } } } public void UpdateLineVertices(Vector3[] newSetOfVertices) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06d9: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0733: Unknown result type (might be due to invalid IL or missing references) if (newSetOfVertices == null) { return; } if (newSetOfVertices.Length < 3) { Debug.LogError((object)"Add at least 3 vertices to the VolumetricLineStrip"); return; } m_lineVertices = newSetOfVertices; Vector3[] array = (Vector3[])(object)new Vector3[m_lineVertices.Length * 2 + 4]; int[] array2 = new int[(m_lineVertices.Length * 2 + 2) * 3]; int num = 0; int num2 = 0; array[num++] = m_lineVertices[0]; array[num++] = m_lineVertices[0]; for (int i = 0; i < m_lineVertices.Length; i++) { array[num++] = m_lineVertices[i]; array[num++] = m_lineVertices[i]; array2[num2++] = num - 2; array2[num2++] = num - 3; array2[num2++] = num - 4; array2[num2++] = num - 1; array2[num2++] = num - 2; array2[num2++] = num - 3; } array[num++] = m_lineVertices[m_lineVertices.Length - 1]; array[num++] = m_lineVertices[m_lineVertices.Length - 1]; array2[num2++] = num - 2; array2[num2++] = num - 3; array2[num2++] = num - 4; array2[num2++] = num - 1; array2[num2++] = num - 2; array2[num2++] = num - 3; Vector2[] array3 = (Vector2[])(object)new Vector2[array.Length]; Vector2[] array4 = (Vector2[])(object)new Vector2[array.Length]; int num3 = 0; int num4 = 0; array3[num3++] = new Vector2(1f, 0f); array3[num3++] = new Vector2(1f, 1f); array3[num3++] = new Vector2(0.5f, 0f); array3[num3++] = new Vector2(0.5f, 1f); array4[num4++] = new Vector2(1f, -1f); array4[num4++] = new Vector2(1f, 1f); array4[num4++] = new Vector2(0f, -1f); array4[num4++] = new Vector2(0f, 1f); for (int j = 1; j < m_lineVertices.Length - 1; j++) { if ((j & 1) == 1) { array3[num3++] = new Vector2(0.5f, 0f); array3[num3++] = new Vector2(0.5f, 1f); } else { array3[num3++] = new Vector2(0.5f, 0f); array3[num3++] = new Vector2(0.5f, 1f); } array4[num4++] = new Vector2(0f, 1f); array4[num4++] = new Vector2(0f, -1f); } array3[num3++] = new Vector2(0.5f, 0f); array3[num3++] = new Vector2(0.5f, 1f); array3[num3++] = new Vector2(0f, 0f); array3[num3++] = new Vector2(0f, 1f); array4[num4++] = new Vector2(0f, 1f); array4[num4++] = new Vector2(0f, -1f); array4[num4++] = new Vector2(1f, 1f); array4[num4++] = new Vector2(1f, -1f); Vector3[] array5 = (Vector3[])(object)new Vector3[array.Length]; Vector4[] array6 = (Vector4[])(object)new Vector4[array.Length]; int num5 = 0; int num6 = 0; array5[num5++] = m_lineVertices[1]; array5[num5++] = m_lineVertices[1]; array5[num5++] = m_lineVertices[1]; array5[num5++] = m_lineVertices[1]; array6[num6++] = Vector4.op_Implicit(m_lineVertices[1]); array6[num6++] = Vector4.op_Implicit(m_lineVertices[1]); array6[num6++] = Vector4.op_Implicit(m_lineVertices[1]); array6[num6++] = Vector4.op_Implicit(m_lineVertices[1]); for (int k = 1; k < m_lineVertices.Length - 1; k++) { array5[num5++] = m_lineVertices[k - 1]; array5[num5++] = m_lineVertices[k - 1]; array6[num6++] = Vector4.op_Implicit(m_lineVertices[k + 1]); array6[num6++] = Vector4.op_Implicit(m_lineVertices[k + 1]); } array5[num5++] = m_lineVertices[m_lineVertices.Length - 2]; array5[num5++] = m_lineVertices[m_lineVertices.Length - 2]; array5[num5++] = m_lineVertices[m_lineVertices.Length - 2]; array5[num5++] = m_lineVertices[m_lineVertices.Length - 2]; array6[num6++] = Vector4.op_Implicit(m_lineVertices[m_lineVertices.Length - 2]); array6[num6++] = Vector4.op_Implicit(m_lineVertices[m_lineVertices.Length - 2]); array6[num6++] = Vector4.op_Implicit(m_lineVertices[m_lineVertices.Length - 2]); array6[num6++] = Vector4.op_Implicit(m_lineVertices[m_lineVertices.Length - 2]); if ((Object)null != (Object)(object)m_meshFilter) { Mesh sharedMesh = m_meshFilter.sharedMesh; if ((Object)null != (Object)(object)sharedMesh) { sharedMesh.SetIndices((int[])null, (MeshTopology)0, 0); sharedMesh.vertices = array; sharedMesh.normals = array5; sharedMesh.tangents = array6; sharedMesh.uv = array3; sharedMesh.uv2 = array4; sharedMesh.SetIndices(array2, (MeshTopology)0, 0); UpdateBounds(); } } } private void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) m_meshRenderer = ((Component)this).GetComponent<MeshRenderer>(); Mesh mesh = new Mesh(); m_meshFilter = ((Component)this).GetComponent<MeshFilter>(); m_meshFilter.mesh = mesh; UpdateLineVertices(m_lineVertices); CreateMaterial(); m_lineVertices[0] = Vector3.zero; lightsaberTrails = ((Component)this).GetComponentsInChildren<LightsaberTrail>(); } private void OnDestroy() { if ((Object)null != (Object)(object)m_meshFilter) { if (Application.isPlaying) { Object.Destroy((Object)(object)m_meshFilter.sharedMesh); } else { Object.DestroyImmediate((Object)(object)m_meshFilter.sharedMesh); } m_meshFilter.sharedMesh = null; } DestroyMaterial(); } private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) targetLength = (start ? maxLengthVector : Vector3.zero); targetTrailLength = (start ? maxTrailLength : 0f); if (LineVertices[0] != targetLength) { Vector3 val = Vector3.Lerp(LineVertices[0], targetLength, speed * Time.deltaTime); LineVertices[0] = val; UpdateLineVertices(m_lineVertices); LightsaberTrail[] array = lightsaberTrails; foreach (LightsaberTrail val2 in array) { val2.height = Mathf.Lerp(val2.height, targetTrailLength, speed * Time.deltaTime); } } if (!start && LineVertices[0] == Vector3.zero) { ((Renderer)m_meshRenderer).enabled = false; } else { ((Renderer)m_meshRenderer).enabled = true; } if (Object.op_Implicit((Object)(object)behaviour)) { if (behaviour.start) { if (!hasStartDelay) { stopwatch = lengthDelay; } if (stopwatch < lengthDelay) { stopwatch += Time.deltaTime; } } else if (stopwatch > 0f) { stopwatch -= Time.deltaTime; } if (stopwatch >= lengthDelay) { if (play) { play = false; } start = true; } else if (stopwatch <= 0f) { if (!play) { play = true; } start = false; } } else if (start) { if (play) { play = false; } } else if (!play) { play = true; } if (((Component)this).transform.hasChanged) { UpdateLineScale(); UpdateBounds(); } } private void OnValidate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Scene scene = ((Component)this).gameObject.scene; if (!string.IsNullOrEmpty(((Scene)(ref scene)).name)) { scene = ((Component)this).gameObject.scene; if (!string.IsNullOrEmpty(((Scene)(ref scene)).path)) { CreateMaterial(); SetAllMaterialProperties(); UpdateBounds(); } } } private void OnDrawGizmos() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.green; if (m_lineVertices != null) { for (int i = 0; i < m_lineVertices.Length - 1; i++) { Gizmos.DrawLine(((Component)this).gameObject.transform.TransformPoint(m_lineVertices[i]), ((Component)this).gameObject.transform.TransformPoint(m_lineVertices[i + 1])); } } } } namespace DBZUtils; public static class Achievements { public static UnlockableDef NewUnlockable<T>(string AchievementIdentifier, Sprite Icon, string Title, string Description) where T : BaseAchievement { string text = "ACHIEVEMENT_SURVIVOR_"; UnlockableDef val = ScriptableObject.CreateInstance<UnlockableDef>(); string langName = text + AchievementIdentifier + "_NAME"; string langDesc = text + AchievementIdentifier + "_DESCRIPTION"; LanguageAPI.Add(langName, Title); LanguageAPI.Add(langDesc, Description); Func<string> func = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2] { Language.GetString(langName), Language.GetString(langDesc) }); Type typeFromHandle = typeof(T); val.cachedName = text + AchievementIdentifier + "_UNLOCKABLE_ID"; val.getHowToUnlockString = func; val.getUnlockedString = func; val.achievementIcon = Icon; val.sortScore = 200; val.hidden = false; ContentAddition.AddUnlockableDef(val); return val; } } public class DBZAimIndicator : HuntressTracker { public float maxTrackDistance = 60f; public float maxTrackAngle = 15f; public TextMeshProUGUI name; public TextMeshProUGUI power; private ChildLocator childLocator; private CharacterBody body; public SkillLocator skillLocator; public DBZSkillBehaviour skillBehaviour; public bool forceScan = false; private bool scanEnemies { get { if (forceScan) { return true; } if (Object.op_Implicit((Object)(object)skillLocator) && Object.op_Implicit((Object)(object)skillLocator.primary) && Object.op_Implicit((Object)(object)skillLocator.secondary) && Object.op_Implicit((Object)(object)skillLocator.utility) && Object.op_Implicit((Object)(object)skillLocator.special)) { if (skillLocator.utility.HasSkillOverrideOfPriority((SkillOverridePriority)4)) { return false; } SkillDef skillDef = skillLocator.primary.skillDef; SkillDef skillDef2 = skillLocator.secondary.skillDef; SkillDef skillDef3 = skillLocator.utility.skillDef; SkillDef skillDef4 = skillLocator.special.skillDef; if (((skillDef as DBZSkillDef).isAimBased && skillLocator.primary.IsReady()) || ((skillDef2 as DBZSkillDef).isAimBased && skillLocator.secondary.IsReady()) || ((skillDef3 as DBZSkillDef).isAimBased && skillLocator.utility.IsReady()) || ((skillDef4 as DBZSkillDef).isAimBased && skillLocator.special.IsReady())) { return true; } } return false; } } private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown base.indicator = new Indicator(((Component)this).gameObject, Prefabs.scouterIndicator); base.maxTrackingDistance = maxTrackDistance; base.maxTrackingAngle = maxTrackAngle; } private void OnEnable() { ((HuntressTracker)this).OnEnable(); skillBehaviour = ((Component)this).GetComponent<DBZSkillBehaviour>(); skillLocator = ((Component)this).GetComponent<SkillLocator>(); } private void FixedUpdate() { ((HuntressTracker)this).FixedUpdate(); base.indicator.active = scanEnemies; if (Object.op_Implicit((Object)(object)name) && Object.op_Implicit((Object)(object)power)) { ((Behaviour)name).enabled = base.indicator.visible; ((Behaviour)power).enabled = base.indicator.visible; if (Object.op_Implicit((Object)(object)base.trackingTarget) && Object.op_Implicit((Object)(object)base.trackingTarget.healthComponent) && Object.op_Implicit((Object)(object)base.trackingTarget.healthComponent.body) && (!Object.op_Implicit((Object)(object)body) || (Object.op_Implicit((Object)(object)body) && (Object)(object)body != (Object)(object)base.trackingTarget.healthComponent.body) || ((TMP_Text)name).text == "NoName")) { if (Object.op_Implicit((Object)(object)skillBehaviour)) { skillBehaviour.target = base.trackingTarget; } UpdateInfo(); } } else if (base.indicator != null && base.indicator.hasVisualizer) { childLocator = base.indicator.visualizerInstance.GetComponentInChildren<ChildLocator>(); if (Object.op_Implicit((Object)(object)childLocator)) { name = ((Component)childLocator.FindChild("name")).GetComponent<TextMeshProUGUI>(); power = ((Component)childLocator.FindChild("power")).GetComponent<TextMeshProUGUI>(); } } } private void UpdateInfo() { body = base.trackingTarget.healthComponent.body; string text = Mathf.CeilToInt(body.level * body.damage + body.maxHealth * 10f).ToString(); string text2 = ""; if (text.Length <= 8) { List<string> list = new List<string>(); for (int i = 0; i < text.Length; i++) { list.Add("<sprite=" + text[i] + ">"); } text2 = string.Join("", list); } else { text2 = "<sprite=10><sprite=10><sprite=10><sprite=10><sprite=10><sprite=10><sprite=10><sprite=10>"; } ((TMP_Text)power).SetText(text2, true); ((TMP_Text)name).SetText(Language.GetString(base.trackingTarget.healthComponent.body.baseNameToken), true); } } public class DBZEventProjectileBehaviour : MonoBehaviour { [SerializeField] public ProjectileSimple simple; [SerializeField] public Rigidbody rigidBody; [SerializeField] public SphereCollider collider; [SerializeField] public ObjectScaleCurve scale; [SerializeField] public GameObject ghost; [SerializeField] public ProjectileController controller; [SerializeField] public GameObject owner; [SerializeField] public CharacterBody body; [SerializeField] public ModelLocator modelLocator; [SerializeField] public DBZSkillEventHandler skillEvent; [SerializeField] public Transform parent; [SerializeField] public float damage; public bool addCollider = false; public string parentName = "sphereMuzzle"; private bool playScaleSound; private bool playLaunchSound; public float radius = 5.8f; public uint scaleSound = 639080239u; public uint launchSound = 356987030u; public string loopSound = "Play_Beerus_Sphere_Projectile_Loop"; private uint loopID; private uint launchID; public float xDirection = 0f; public float yDirection = 0f; public float zDirection = 0f; private void OnEnable() { loopID = Util.PlaySound(loopSound, ((Component)this).gameObject); } private void OnDisable() { AkSoundEngine.StopPlayingID(loopID); AkSoundEngine.StopPlayingID(launchID); } private void Update() { //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)collider)) { collider = ((Component)this).GetComponent<SphereCollider>(); } if (!Object.op_Implicit((Object)(object)simple)) { simple = ((Component)this).GetComponent<ProjectileSimple>(); ((Behaviour)simple).enabled = false; } if (!Object.op_Implicit((Object)(object)rigidBody)) { rigidBody = ((Component)this).GetComponent<Rigidbody>(); } if (!Object.op_Implicit((Object)(object)owner)) { controller = ((Component)this).GetComponent<ProjectileController>(); if (Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.Networkowner)) { if (Object.op_Implicit((Object)(object)controller.ghost)) { ghost = ((Component)controller.ghost).gameObject; scale = ghost.GetComponent<ObjectScaleCurve>(); } owner = controller.owner; body = owner.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)body)) { damage = body.damage; modelLocator = body.modelLocator; if (Object.op_Implicit((Object)(object)modelLocator) && Object.op_Implicit((Object)(object)modelLocator.modelTransform)) { skillEvent = ((Component)modelLocator.modelTransform).GetComponent<DBZSkillEventHandler>(); if (Object.op_Implicit((Object)(object)skillEvent)) { skillEvent.fireSphere = false; skillEvent.fire = false; skillEvent.sphereScale = false; skillEvent.charge = false; skillEvent.hellzoneCharge = false; skillEvent.stopDash = false; skillEvent.nextState = false; skillEvent.dashCount = 0; skillEvent.fireCount = 0; } ChildLocator component = ((Component)modelLocator.modelTransform).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { parent = component.FindChild(parentName); } } } } } if (Object.op_Implicit((Object)(object)skillEvent)) { OnSkillEvent(); SphereScale(); FireSphere(); if (Object.op_Implicit((Object)(object)collider) && !skillEvent.fireSphere) { ((Collider)collider).enabled = false; if (!playLaunchSound) { playLaunchSound = true; launchID = AkSoundEngine.PostEvent(launchSound, ((Component)this).gameObject); } } } if (Object.op_Implicit((Object)(object)parent)) { ((Component)this).transform.position = parent.position; } if (Object.op_Implicit((Object)(object)rigidBody) && Object.op_Implicit((Object)(object)simple) && ((Behaviour)simple).enabled && yDirection != 0f && rigidBody.velocity.y != yDirection) { rigidBody.velocity = new Vector3(rigidBody.velocity.x, yDirection, rigidBody.velocity.z); } } protected virtual void SphereScale() { if (skillEvent.sphereScale && Object.op_Implicit((Object)(object)scale)) { ((Behaviour)scale).enabled = true; if (!playScaleSound) { playScaleSound = true; AkSoundEngine.PostEvent(scaleSound, ((Component)this).gameObject); } } } protected virtual void FireSphere() { if (skillEvent.fireSphere && Object.op_Implicit((Object)(object)simple)) { parent = null; ((Behaviour)simple).enabled = true; if (Object.op_Implicit((Object)(object)collider)) { ((Collider)collider).enabled = true; collider.radius = radius; } else if (addCollider) { ((Component)this).gameObject.AddComponent<SphereCollider>().radius = radius; } } } protected virtual void OnSkillEvent() { } } internal class DBZPodBehaviour : MonoBehaviour { private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) VehicleSeat component = ((Component)this).GetComponent<VehicleSeat>(); component.onPassengerExit += Exit; GameObject val = new GameObject("exitPosition"); val.transform.position = ((Component)this).transform.position + ((Component)this).transform.forward * 5f; component.exitPosition = val.transform; } private void Exit(GameObject obj) { Animator componentInChildren = ((Component)this).GetComponentInChildren<Animator>(); componentInChildren.Play("Open"); } } public class DBZSkillBehaviour : NetworkBehaviour { public bool canExecute = true; public bool canExecuteSkill1 = true; public bool canExecuteSkill2 = true; public bool canExecuteSkill3 = true; public bool canExecuteSkill4 = true; internal SkillLocator skillLocator; internal KiBehaviour kiBehaviour; public float baseSecondaryCost = 0.2f; public float baseSpecialCost = 0.55f; public DBZSurvivorDef survivorDef; public bool lockMovement = false; [SerializeField] [SyncVar] public bool allowFlight; [SerializeField] [SyncVar] public bool isMoving; [SyncVar] [SerializeField] public bool inFlight; [SyncVar] [SerializeField] public bool isBoosted; [SyncVar] [SerializeField] public bool flightCancel; public int integer1; public int integer2; public int integer3; public int integer4; public int integer5; public float float1; public float float2; public float float3; public float float4; public float float5; public bool bool1; public bool bool2; public bool bool3; public bool bool4; public bool bool5; public Ray aimRay; public Vector3 vector1; public Vector3 vector2; public Vector3 vector3; public Vector3 vector4; public Vector3 vector5; public uint sound1; public uint sound2; public uint sound3; public uint sound4; public uint sound5; public AimRequest aimRequest; public GameObject vfx1; public GameObject vfx2; public GameObject vfx3; public GameObject vfx4; public GameObject vfx5; public HurtBox target; public List<ProjectileController> controlledProjectiles = new List<ProjectileController>(); private static int kCmdCmdUpdateAllowFlight; private static int kCmdCmdUpdateInFlight; private static int kCmdCmdUpdateFlightCancel; public DBZSurvivorDef.VFXColor vfxColor { get; set; } public uint VO { get { if (Object.op_Implicit((Object)(object)survivorDef)) { return survivorDef.skillVO; } return 0u; } } public float currentKi { get { if (Object.op_Implicit((Object)(object)kiBehaviour)) { return kiBehaviour.currentKiValue; } return 0f; } } public bool fullKi { get { if (Object.op_Implicit((Object)(object)kiBehaviour)) { return kiBehaviour.maxKi; } return false; } } public bool NetworkallowFlight { get { return allowFlight; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<bool>(value, ref allowFlight, 1u); } } public bool NetworkisMoving { get { return isMoving; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<bool>(value, ref isMoving, 2u); } } public bool NetworkinFlight { get { return inFlight; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<bool>(value, ref inFlight, 4u); } } public bool NetworkisBoosted { get { return isBoosted; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<bool>(value, ref isBoosted, 8u); } } public bool NetworkflightCancel { get { return flightCancel; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<bool>(value, ref flightCancel, 16u); } } [Command] public void CmdUpdateAllowFlight(bool flag) { NetworkallowFlight = flag; } [Command] public void CmdUpdateInFlight(bool flag) { NetworkinFlight = flag; } [Command] public void CmdUpdateFlightCancel(bool flag) { NetworkflightCancel = flag; } private void Start() { skillLocator = ((Component)this).GetComponent<SkillLocator>(); kiBehaviour = ((Component)this).GetComponent<KiBehaviour>(); CharacterBody component = ((Component)this).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { survivorDef = DBZSurvivorCatalog.FindDBZSurvivorDef(component.baseNameToken); vfxColor = survivorDef.vfxColor; } } public void DisableSkill(int skillIndex) { switch (skillIndex) { case 0: canExecuteSkill1 = false; break; case 1: canExecuteSkill2 = false; break; case 2: canExecuteSkill3 = false; break; case 3: canExecuteSkill4 = false; break; } } public void EnableSkill(int skillIndex) { switch (skillIndex) { case 0: canExecuteSkill1 = true; break; case 1: canExecuteSkill2 = true; break; case 2: canExecuteSkill3 = true; break; case 3: canExecuteSkill4 = true; break; } } public void SetExecutableSkills(int skillIndex) { switch (skillIndex) { case -2: canExecuteSkill1 = false; canExecuteSkill2 = false; canExecuteSkill3 = false; canExecuteSkill4 = false; break; case -1: canExecuteSkill1 = true; canExecuteSkill2 = true; canExecuteSkill3 = true; canExecuteSkill4 = true; break; case 0: canExecuteSkill1 = true; canExecuteSkill2 = false; canExecuteSkill3 = false; canExecuteSkill4 = false; break; case 1: canExecuteSkill1 = false; canExecuteSkill2 = true; canExecuteSkill3 = false; canExecuteSkill4 = false; break; case 2: canExecuteSkill1 = false; canExecuteSkill2 = false; canExecuteSkill3 = true; canExecuteSkill4 = false; break; case 3: canExecuteSkill1 = false; canExecuteSkill2 = false; canExecuteSkill3 = false; canExecuteSkill4 = true; break; } } private void UNetVersion() { } protected static void InvokeCmdCmdUpdateAllowFlight(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) { Debug.LogError((object)"Command CmdUpdateAllowFlight called on client."); } else { ((DBZSkillBehaviour)(object)obj).CmdUpdateAllowFlight(reader.ReadBoolean()); } } protected static void InvokeCmdCmdUpdateInFlight(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) { Debug.LogError((object)"Command CmdUpdateInFlight called on client."); } else { ((DBZSkillBehaviour)(object)obj).CmdUpdateInFlight(reader.ReadBoolean()); } } protected static void InvokeCmdCmdUpdateFlightCancel(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) { Debug.LogError((object)"Command CmdUpdateFlightCancel called on client."); } else { ((DBZSkillBehaviour)(object)obj).CmdUpdateFlightCancel(reader.ReadBoolean()); } } public void CallCmdUpdateAllowFlight(bool flag) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active) { Debug.LogError((object)"Command function CmdUpdateAllowFlight called on server."); return; } if (((NetworkBehaviour)this).isServer) { CmdUpdateAllowFlight(flag); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)5); val.WritePackedUInt32((uint)kCmdCmdUpdateAllowFlight); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); val.Write(flag); ((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdUpdateAllowFlight"); } public void CallCmdUpdateInFlight(bool flag) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active) { Debug.LogError((object)"Command function CmdUpdateInFlight called on server."); return; } if (((NetworkBehaviour)this).isServer) { CmdUpdateInFlight(flag); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)5); val.WritePackedUInt32((uint)kCmdCmdUpdateInFlight); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); val.Write(flag); ((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdUpdateInFlight"); } public void CallCmdUpdateFlightCancel(bool flag) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active) { Debug.LogError((object)"Command function CmdUpdateFlightCancel called on server."); return; } if (((NetworkBehaviour)this).isServer) { CmdUpdateFlightCancel(flag); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)5); val.WritePackedUInt32((uint)kCmdCmdUpdateFlightCancel); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); val.Write(flag); ((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdUpdateFlightCancel"); } static DBZSkillBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown kCmdCmdUpdateAllowFlight = 876682248; NetworkBehaviour.RegisterCommandDelegate(typeof(DBZSkillBehaviour), kCmdCmdUpdateAllowFlight, new CmdDelegate(InvokeCmdCmdUpdateAllowFlight)); kCmdCmdUpdateInFlight = 1731750246; NetworkBehaviour.RegisterCommandDelegate(typeof(DBZSkillBehaviour), kCmdCmdUpdateInFlight, new CmdDelegate(InvokeCmdCmdUpdateInFlight)); kCmdCmdUpdateFlightCancel = 539198971; NetworkBehaviour.RegisterCommandDelegate(typeof(DBZSkillBehaviour), kCmdCmdUpdateFlightCancel, new CmdDelegate(InvokeCmdCmdUpdateFlightCancel)); NetworkCRC.RegisterBehaviour("DBZSkillBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.Write(allowFlight); writer.Write(isMoving); writer.Write(inFlight); writer.Write(isBoosted); writer.Write(flightCancel); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(allowFlight); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isMoving); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 4u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(inFlight); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 8u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isBoosted); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x10u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(flightCancel); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { allowFlight = reader.ReadBoolean(); isMoving = reader.ReadBoolean(); inFlight = reader.ReadBoolean(); isBoosted = reader.ReadBoolean(); flightCancel = reader.ReadBoolean(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { allowFlight = reader.ReadBoolean(); } if (((uint)num & 2u) != 0) { isMoving = reader.ReadBoolean(); } if (((uint)num & 4u) != 0) { inFlight = reader.ReadBoolean(); } if (((uint)num & 8u) != 0) { isBoosted = reader.ReadBoolean(); } if (((uint)num & 0x10u) != 0) { flightCancel = reader.ReadBoolean(); } } } internal class DelayedMissile : MonoBehaviour, IProjectileImpactBehavior { private Rigidbody rigidBody; private Vector3 point; private ProjectileTargetComponent targetComponent; private bool collision; public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) collision = true; if (!Object.op_Implicit((Object)(object)((Component)impactInfo.collider).GetComponent<HurtBox>()) && Object.op_Implicit((Object)(object)rigidBody)) { rigidBody.AddExplosionForce(2500f, impactInfo.estimatedPointOfImpact, 5f); } } private void OnEnable() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) rigidBody = ((Component)this).GetComponent<Rigidbody>(); rigidBody.angularDrag = 0f; rigidBody.drag = 15f; targetComponent = ((Component)this).GetComponent<ProjectileTargetComponent>(); ((Component)this).GetComponent<ProjectileSphereTargetFinder>().onNewTargetFound.AddListener(new UnityAction(OnTargetFound)); point = ((Component)this).transform.position + ((Component)this).transform.forward * 20f; } private void OnTargetFound() { ((Component)this).gameObject.AddComponent<MissileController>().maxVelocity = 70f; } private void FixedUpdate() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)targetComponent) && !Object.op_Implicit((Object)(object)targetComponent.target) && !collision) { ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, point, 5f * Time.fixedDeltaTime); } } } internal class DelayedScreenShake : MonoBehaviour { private ShakeEmitter shake; private float stopwatch; private float stopwatchD; private int count; private void OnEnable() { shake = ((Component)this).GetComponent<ShakeEmitter>(); } private void FixedUpdate() { if (!Object.op_Implicit((Object)(object)shake)) { return; } stopwatch += Time.fixedDeltaTime; if (!(stopwatch >= 1f)) { return; } stopwatchD += Time.fixedDeltaTime; shake.radius = 15f; if (stopwatchD >= 0.2f) { count++; if (count >= 3) { Object.Destroy((Object)(object)this); } stopwatchD = 0f; stopwatch = 0f; shake.radius = 0f; } } } public class DoubleCrushProjectileBehaviour : MonoBehaviour { public GameObject owner; public ProjectileSimple simple; public ProjectileTargetComponent target; public ProjectileController controller; public DBZSkillBehaviour behaviour; public float floatDuration = 0.45f; public float floatDistance = 2.5f; public Vector3 targetPosition; public Vector3 currentPosition; public float stopwatch; private bool playedSound; public uint readySound = Sounds.Play_DBZ_Common_DoubleCrush_Ready; public bool changedDirection; private void Awake() { controller = ((Component)this).GetComponent<ProjectileController>(); simple = ((Component)this).GetComponent<ProjectileSimple>(); target = ((Component)this).GetComponent<ProjectileTargetComponent>(); } private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) currentPosition = ((Component)this).transform.position; targetPosition = currentPosition + Vector3.up * floatDistance; } private void FixedUpdate() { //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)owner)) { owner = controller.owner; if (Object.op_Implicit((Object)(object)owner)) { behaviour = owner.GetComponent<DBZSkillBehaviour>(); if (Object.op_Implicit((Object)(object)behaviour)) { behaviour.controlledProjectiles.Add(controller); } } } if (((Behaviour)simple).enabled) { if (!changedDirection && Object.op_Implicit((Object)(object)target.target)) { changedDirection = true; Transform transform = ((Component)this).transform; Vector3 val = ((Component)target.target).transform.position - ((Component)this).transform.position; transform.forward = ((Vector3)(ref val)).normalized; } } else if (((Component)this).transform.position != targetPosition) { stopwatch += Time.fixedDeltaTime; ((Component)this).transform.position = Vector3.Lerp(currentPosition, targetPosition, stopwatch / floatDuration); } else if (!playedSound) { playedSound = true; AkSoundEngine.PostEvent(readySound, ((Component)this).gameObject); } } private void OnDisable() { if (behaviour.controlledProjectiles.Contains(controller)) { behaviour.controlledProjectiles.Remove(controller); } } } internal class EnemyMarked : MonoBehaviour { } internal class EnemyMarkerBehaviour : MonoBehaviour { private EnemyMarked mark; public CharacterBody body; public ModelLocator modelLocator; public Transform modelTransform; public RigidbodyMotor motor; private void Start() { body = ((Component)this).GetComponentInParent<CharacterBody>(); modelLocator = ((Component)this).GetComponentInParent<ModelLocator>(); motor = ((Component)this).GetComponentInParent<RigidbodyMotor>(); mark = ((Component)body).gameObject.AddComponent<EnemyMarked>(); } private void Update() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { Object.Destroy((Object)(object)mark); Object.Destroy((Object)(object)((Component)this).gameObject); return; } if (!Object.op_Implicit((Object)(object)modelTransform)) { modelTransform = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null); return; } if (Object.op_Implicit((Object)(object)((Component)this).transform.parent)) { ((Component)this).transform.parent = null; } ((Component)this).transform.position = (Object.op_Implicit((Object)(object)motor) ? body.transform.position : modelTransform.position); ((Component)this).transform.rotation = Quaternion.Euler(0f, Object.op_Implicit((Object)(object)motor) ? body.transform.rotation.y : modelTransform.rotation.y, 0f); } } internal class DisableFades : MonoBehaviour { private void OnEnable() { InstanceTracker.Add<DisableFades>(this); } private void OnDisable() { InstanceTracker.Remove<DisableFades>(this); } } internal class FadeDisabler : MonoBehaviour { private void Start() { List<DisableFades> instancesList = InstanceTracker.GetInstancesList<DisableFades>(); if (instancesList != null && instancesList.Count > 0) { ((Component)this).gameObject.SetActive(false); } } } internal class GenkidamaSuccBehaviour : MonoBehaviour { private SphereSearch sphereSearch = new SphereSearch(); public TeamFilter teamComponent; public float stopwatch; public ProjectileDamage projectileDamage; public DBZEventProjectileBehaviour behaviour; public ProjectileImpactExplosion explosion; public float searchDelay = 0.25f; public float radius = 999f; public int stacks = 0; public CharacterBody body => Object.op_Implicit((Object)(object)behaviour) ? behaviour.body : null; private GameObject owner => Object.op_Implicit((Object)(object)behaviour) ? behaviour.owner : null; private TeamIndex teamIndex => (TeamIndex)((!Object.op_Implicit((Object)(object)teamComponent)) ? 1 : ((int)teamComponent.teamIndex)); private void OnEnable() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) explosion = ((Component)this).GetComponent<ProjectileImpactExplosion>(); projectileDamage = ((Component)this).GetComponent<ProjectileDamage>(); teamComponent = ((Component)this).GetComponent<TeamFilter>(); behaviour = ((Component)this).GetComponent<DBZEventProjectileBehaviour>(); sphereSearch.origin = ((Component)this).transform.position; sphereSearch.radius = radius; sphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; } private void OnDisable() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)explosion)) { EffectManager.SpawnEffect(Prefabs.beastGenkidamaRedExplosionEffect, new EffectData { origin = ((Component)this).transform.position, scale = ((ProjectileExplosion)explosion).blastRadius }, false); } } private void FixedUpdate() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Expected O, but got Unknown //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)projectileDamage) || Object.op_Implicit((Object)(object)behaviour)) { } if (Object.op_Implicit((Object)(object)explosion)) { ((ProjectileExplosion)explosion).blastDamageCoefficient = (float)stacks * 2.5f; } if (Object.op_Implicit((Object)(object)explosion)) { ((ProjectileExplosion)explosion).blastRadius = 15 + stacks * 5; } ((Component)this).transform.localScale = Vector3.one * (1f + (float)stacks * 0.5f); stopwatch += Time.fixedDeltaTime; if (!(stopwatch >= searchDelay)) { return; } stopwatch = 0f; HurtBox[] hurtBoxes = sphereSearch.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(teamIndex)).OrderCandidatesByDistance() .FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(); foreach (HurtBox val in hurtBoxes) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && Object.op_Implicit((Object)(object)val.healthComponent.body) && !val.healthComponent.body.HasBuff(Prefabs.genkidamaDebuff) && NetworkServer.active) { val.healthComponent.body.AddTimedBuff(Prefabs.genkidamaDebuff, 10f); DamageInfo val2 = new DamageInfo { attacker = (Object.op_Implicit((Object)(object)owner) ? owner : null), inflictor = (Object.op_Implicit((Object)(object)owner) ? owner : null), damage = (Object.op_Implicit((Object)(object)body) ? (body.damage * 2.5f) : 0f), procCoefficient = 0f, damageType = DamageTypeCombo.op_Implicit((DamageType)0), damageColorIndex = (DamageColorIndex)3, position = ((Component)val).transform.position, rejected = false }; val.healthComponent.TakeDamage(val2); GenkidamaOrb genkidamaOrb = new GenkidamaOrb { origin = ((Component)val).transform.position, targetObject = ((Component)this).gameObject }; OrbManager.instance.AddOrb((Orb)(object)genkidamaOrb); } } } } public class KiBehaviour : NetworkBehaviour { public GameObject kiBar; public TextMeshProUGUI currentKi; public TextMeshProUGUI fullKi; public Image barImage; public float maxKiValue = 1f; private float kiValue = 0f; private bool barSetupDone; private static readonly StringBuilder sharedStringBuilder; private static Color baseKiColor; public bool passiveRegen = true; public float passiveRegenValue = 0.02f; private float regenStopwatch; public float testFloat = 0.75f; internal Image powerupImage; public bool hasPowerup; private static int kRpcRpcResetKi; private static int kRpcRpcAddKi; private static int kRpcRpcConsumeKi; internal bool canRegen => regenStopwatch >= 2f; internal bool maxKi { get { if ((float)Mathf.RoundToInt(kiValue * 100f) >= maxKiValue * 100f) { return true; } return false; } } internal float currentKiValue => kiValue; public event Action<KiBehaviour, float> onConsumeKi; public void ResetKi() { regenStopwatch = 0f; kiValue = 0f; } [Server] public void ResetKiServer() { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void DBZUtils.KiBehaviour::ResetKiServer()' called on client"); } else { CallRpcResetKi(); } } [ClientRpc] public void RpcResetKi() { ResetKi(); } [Server] public void AddKiServer(float amount) { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void DBZUtils.KiBehaviour::AddKiServer(System.Single)' called on client"); } else { CallRpcAddKi(amount); } } [ClientRpc] public void RpcAddKi(float amount) { AddKi(amount); } [Server] public void ConsumeKiServer(float amount) { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void DBZUtils.KiBehaviour::ConsumeKiServer(System.Single)' called on client"); } else { CallRpcConsumeKi(amount); } } [ClientRpc] public void RpcConsumeKi(float amount) { ConsumeKi(amount); } public void AddKi(float amount) { kiValue += amount; } public void ConsumeKi(float amount) { kiValue -= amount; regenStopwatch = 0f; this.onConsumeKi?.Invoke(this, amount); } private void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HUD.Update += new hook_Update(HUD_Update); } private void HUD_Update(orig_Update orig, HUD self) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); regenStopwatch += Time.deltaTime; if (passiveRegen && canRegen) { AddKi(passiveRegenValue * Time.deltaTime); } kiValue = Mathf.Clamp(kiValue, 0f, maxKiValue); if (Object.op_Implicit((Object)(object)barImage)) { barImage.fillAmount = kiValue / maxKiValue; ((Graphic)barImage).color = baseKiColor; } if (Object.op_Implicit((Object)(object)currentKi) && Object.op_Implicit((Object)(object)fullKi)) { sharedStringBuilder.Clear().Append(Mathf.RoundToInt(kiValue * 100f)); ((TMP_Text)currentKi).SetText(sharedStringBuilder); ((TMP_Text)fullKi).SetText((maxKiValue * 100f).ToString(), true); } if (!Object.op_Implicit((Object)(object)self.targetBodyObject) || !((Object)(object)self.targetBodyObject == (Object)(object)((Component)this).gameObject) || !Object.op_Implicit((Object)(object)self.mainUIPanel) || self.mainUIPanel.transform.childCount < 3 || Object.op_Implicit((Object)(object)kiBar) || !Util.HasEffectiveAuthority(self.targetBodyObject.GetComponent<NetworkIdentity>())) { return; } HealthBar componentInChildren = self.mainUIPanel.GetComponentInChildren<HealthBar>(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { return; } Transform child = ((Component)componentInChildren).transform.GetChild(0); if (!barSetupDone && child.childCount >= 3) { Image[] componentsInChildren = ((Component)componentInChildren).gameObject.GetComponentsInChildren<Image>(); if (componentsInChildren.Length >= 4) { barSetupDone = true; } } if (!barSetupDone) { return; } ((Component)((Component)componentInChildren).transform.parent).GetComponent<RectTransform>().sizeDelta = new Vector2(0f, 108.2f); kiBar = Object.Instantiate<GameObject>(((Component)componentInChildren).gameObject, ((Component)componentInChildren).gameObject.transform.parent); ((Object)kiBar).name = "KiBar"; Object.Destroy((Object)(object)kiBar.GetComponent<HealthBar>()); TextMeshProUGUI[] componentsInChildren2 = kiBar.GetComponentsInChildren<TextMeshProUGUI>(); for (int i = 0; i < componentsInChildren2.Length; i++) { if (Object.op_Implicit((Object)(object)componentsInChildren2[i]) && Object.op_Implicit((Object)(object)((Component)componentsInChildren2[i]).gameObject)) { if (((Object)((Component)componentsInChildren2[i]).gameObject).name == "CurrentHealthText") { currentKi = componentsInChildren2[i]; ((TMP_Text)currentKi).text = "0"; } if (((Object)((Component)componentsInChildren2[i]).gameObject).name == "FullHealthText") { fullKi = componentsInChildren2[i]; ((TMP_Text)fullKi).SetText((maxKiValue * 100f).ToString(), true); } } } Image[] componentsInChildren3 = kiBar.GetComponentsInChildren<Image>(); for (int j = 0; j < componentsInChildren3.Length; j++) { if (!Object.op_Implicit((Object)(object)componentsInChildren3[j]) || !Object.op_Implicit((Object)(object)((Component)componentsInChildren3[j]).gameObject)) { continue; } if ((Object)(object)componentsInChildren3[j] != (Object)(object)componentsInChildren3[3] && (Object)(object)componentsInChildren3[j] != (Object)(object)componentsInChildren3[0]) { Object.Destroy((Object)(object)((Component)componentsInChildren3[j]).gameObject); } if ((Object)(object)componentsInChildren3[j] == (Object)(object)componentsInChildren3[3]) { barImage = componentsInChildren3[j]; ((Graphic)barImage).color = baseKiColor; barImage.type = (Type)3; barImage.fillMethod = (FillMethod)0; barImage.fillCenter = false; if (hasPowerup) { powerupImage = Object.Instantiate<GameObject>(((Component)barImage).gameObject, ((Component)barImage).transform.parent).GetComponent<Image>(); ((Object)((Component)powerupImage).gameObject).name = "PowerupBar"; ((Graphic)powerupImage).color = Color.white; powerupImage.sprite = Assets.MainAssetBundle.LoadAsset<Sprite>("powerupBarFill"); } } } } private void OnDisable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HUD.Update -= new hook_Update(HUD_Update); if (Object.op_Implicit((Object)(object)kiBar)) { Object.Destroy((Object)(object)kiBar); } } static KiBehaviour() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown sharedStringBuilder = new StringBuilder(); baseKiColor = new Color(0.2549f, 0.82353f, 0.93725f); kRpcRpcResetKi = -909243816; NetworkBehaviour.RegisterRpcDelegate(typeof(KiBehaviour), kRpcRpcResetKi, new CmdDelegate(InvokeRpcRpcResetKi)); kRpcRpcAddKi = -499372054; NetworkBehaviour.RegisterRpcDelegate(typeof(KiBehaviour), kRpcRpcAddKi, new CmdDelegate(InvokeRpcRpcAddKi)); kRpcRpcConsumeKi = -54506747; NetworkBehaviour.RegisterRpcDelegate(typeof(KiBehaviour), kRpcRpcConsumeKi, new CmdDelegate(InvokeRpcRpcConsumeKi)); NetworkCRC.RegisterBehaviour("KiBehaviour", 0); } private void UNetVersion() { } protected static void InvokeRpcRpcResetKi(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcResetKi called on server."); } else { ((KiBehaviour)(object)obj).RpcResetKi(); } } protected static void InvokeRpcRpcAddKi(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddKi called on server."); } else { ((KiBehaviour)(object)obj).RpcAddKi(reader.ReadSingle()); } } protected static void InvokeRpcRpcConsumeKi(NetworkBehaviour obj, NetworkReader reader) {