public void Awake() { rootTransform = GetComponent <Transform>(); rootAnimation = GetComponent <RemotePlayerAnimation>(); warpEffect = UnityEngine.Object.Instantiate <VFWarpEffect>(Configs.builtin.warpEffectPrefab, GetComponent <Transform>()); warpEffect.enabled = false; tunnelMat = (Material)AccessTools.Field(typeof(VFWarpEffect), "tunnelMat").GetValue(warpEffect); distortMat = (Material)AccessTools.Field(typeof(VFWarpEffect), "distortMat").GetValue(warpEffect); astrosMat = (Material)AccessTools.Field(typeof(VFWarpEffect), "astrosMat").GetValue(warpEffect); nebulasMat = (Material)AccessTools.Field(typeof(VFWarpEffect), "nebulasMat").GetValue(warpEffect); astrosParticles = warpEffect.astrosParticles; nebulasParticles = warpEffect.nebulasParticles; tunnelRenderer = warpEffect.tunnelRenderer; distortRenderer = warpEffect.distortRenderer; astrosRenderer = warpEffect.astrosRenderer; nebulasRenderer = warpEffect.nebulasRenderer; tunnelMul = (float)AccessTools.Field(typeof(VFWarpEffect), "tunnelMul").GetValue(warpEffect); distortMul = (float)AccessTools.Field(typeof(VFWarpEffect), "distortMul").GetValue(warpEffect); astrosMul = (float)AccessTools.Field(typeof(VFWarpEffect), "astrosMul").GetValue(warpEffect); nebulasMul = (float)AccessTools.Field(typeof(VFWarpEffect), "nebulasMul").GetValue(warpEffect); intensByState_astro = warpEffect.intensByState_astro; intensByState = warpEffect.intensByState; warpRotations = new Vector4[24]; tunnelMat = UnityEngine.Object.Instantiate <Material>(tunnelRenderer.sharedMaterial); distortMat = UnityEngine.Object.Instantiate <Material>(distortRenderer.sharedMaterial); astrosMat = UnityEngine.Object.Instantiate <Material>(astrosRenderer.sharedMaterial); nebulasMat = UnityEngine.Object.Instantiate <Material>(nebulasRenderer.sharedMaterial); tunnelRenderer.sharedMaterial = tunnelMat; distortRenderer.sharedMaterial = distortMat; astrosRenderer.sharedMaterial = astrosMat; nebulasRenderer.sharedMaterial = nebulasMat; tunnelMul = tunnelMat.GetFloat("_Multiplier"); distortMul = distortMat.GetFloat("_DistortionStrength"); astrosMul = astrosMat.GetFloat("_Multiplier"); nebulasMul = nebulasMat.GetFloat("_Multiplier"); for (int i = 0; i < warpRotations.Length; i++) { warpRotations[i] = new Vector4(0f, 0f, 0f, 1f); } ToggleEffect(false); }
public void Awake() { rootTransform = GetComponent <Transform>(); rootAnimation = GetComponent <RemotePlayerAnimation>(); warpEffect = UnityEngine.Object.Instantiate <VFWarpEffect>(Configs.builtin.warpEffectPrefab, GetComponent <Transform>()); warpEffect.enabled = false; tunnelMat = (Material)typeof(VFWarpEffect).GetField("tunnelMat", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); distortMat = (Material)typeof(VFWarpEffect).GetField("distortMat", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); astrosMat = (Material)typeof(VFWarpEffect).GetField("astrosMat", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); nebulasMat = (Material)typeof(VFWarpEffect).GetField("nebulasMat", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); astrosParticles = (ParticleSystem)typeof(VFWarpEffect).GetField("astrosParticles", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); nebulasParticles = (ParticleSystem)typeof(VFWarpEffect).GetField("nebulasParticles", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); tunnelRenderer = (MeshRenderer)typeof(VFWarpEffect).GetField("tunnelRenderer", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); distortRenderer = (MeshRenderer)typeof(VFWarpEffect).GetField("distortRenderer", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); astrosRenderer = (ParticleSystemRenderer)typeof(VFWarpEffect).GetField("astrosRenderer", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); nebulasRenderer = (ParticleSystemRenderer)typeof(VFWarpEffect).GetField("nebulasRenderer", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); tunnelMul = (float)typeof(VFWarpEffect).GetField("tunnelMul", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); distortMul = (float)typeof(VFWarpEffect).GetField("distortMul", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); astrosMul = (float)typeof(VFWarpEffect).GetField("astrosMul", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); nebulasMul = (float)typeof(VFWarpEffect).GetField("nebulasMul", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); intensByState_astro = (AnimationCurve)typeof(VFWarpEffect).GetField("intensByState_astro", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); intensByState = (AnimationCurve)typeof(VFWarpEffect).GetField("intensByState", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(warpEffect); warpRotations = new Vector4[24]; tunnelMat = UnityEngine.Object.Instantiate <Material>(tunnelRenderer.sharedMaterial); distortMat = UnityEngine.Object.Instantiate <Material>(distortRenderer.sharedMaterial); astrosMat = UnityEngine.Object.Instantiate <Material>(astrosRenderer.sharedMaterial); nebulasMat = UnityEngine.Object.Instantiate <Material>(nebulasRenderer.sharedMaterial); tunnelRenderer.sharedMaterial = tunnelMat; distortRenderer.sharedMaterial = distortMat; astrosRenderer.sharedMaterial = astrosMat; nebulasRenderer.sharedMaterial = nebulasMat; tunnelMul = tunnelMat.GetFloat("_Multiplier"); distortMul = distortMat.GetFloat("_DistortionStrength"); astrosMul = astrosMat.GetFloat("_Multiplier"); nebulasMul = nebulasMat.GetFloat("_Multiplier"); for (int i = 0; i < warpRotations.Length; i++) { warpRotations[i] = new Vector4(0f, 0f, 0f, 1f); } toggleEffect(false); }
public void Awake() { rootAnimation = GetComponent <RemotePlayerAnimation>(); rootTransform = GetComponent <Transform>(); rootModelTransform = rootTransform.Find("Model"); psys = new ParticleSystem[2]; psysr = new ParticleSystemRenderer[2]; torchEffect = rootModelTransform.Find("bip/pelvis/spine-1/spine-2/spine-3/r-clavicle/r-upper-arm/r-forearm/r-torch/vfx-torch/blast").GetComponent <ParticleSystem>(); FootEffect = new ParticleSystem[2]; WaterEffect = new ParticleSystem[2]; FootSmokeEffect = new ParticleSystem[2][]; FootSmokeEffect[0] = new ParticleSystem[2]; FootSmokeEffect[1] = new ParticleSystem[2]; FootSmallSmoke = new ParticleSystem[2]; FootLargeSmoke = new ParticleSystem[2]; Transform VFX = rootModelTransform.Find("bip/pelvis/spine-1/spine-2/spine-3/backpack/VFX").GetComponent <Transform>(); psys[0] = VFX.GetChild(0).GetComponent <ParticleSystem>(); psys[1] = VFX.GetChild(1).GetComponent <ParticleSystem>(); psysr[0] = VFX.GetChild(0).Find("flames").GetComponent <ParticleSystemRenderer>(); psysr[1] = VFX.GetChild(1).Find("flames").GetComponent <ParticleSystemRenderer>(); WaterEffect[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/vfx-footsteps/water").GetComponent <ParticleSystem>(); WaterEffect[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/vfx-footsteps/water").GetComponent <ParticleSystem>(); FootSmokeEffect[0][0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/vfx-footsteps/smoke").GetComponent <ParticleSystem>(); FootSmokeEffect[0][1] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/vfx-footsteps/smoke-2").GetComponent <ParticleSystem>(); FootSmokeEffect[1][0] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/vfx-footsteps/smoke").GetComponent <ParticleSystem>(); FootSmokeEffect[1][1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/vfx-footsteps/smoke-2").GetComponent <ParticleSystem>(); FootEffect[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/vfx-footsteps").GetComponent <ParticleSystem>(); FootEffect[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/vfx-footsteps").GetComponent <ParticleSystem>(); FootSmallSmoke[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/vfx-footsteps/smoke").GetComponent <ParticleSystem>(); FootSmallSmoke[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/vfx-footsteps/smoke").GetComponent <ParticleSystem>(); FootLargeSmoke[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/vfx-footsteps/smoke-2").GetComponent <ParticleSystem>(); FootLargeSmoke[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/vfx-footsteps/smoke-2").GetComponent <ParticleSystem>(); solidSoundEvents[0] = "footsteps-0"; solidSoundEvents[1] = "footsteps-1"; solidSoundEvents[2] = "footsteps-2"; solidSoundEvents[3] = "footsteps-3"; collider = new Collider[16]; rootTransform.gameObject.AddComponent <RemoteWarpEffect>(); rootWarp = rootTransform.gameObject.GetComponent <RemoteWarpEffect>(); }