Upload from upload_mods.ps1
This commit is contained in:
49
KFAttached/Misc/AimReference.cs
Normal file
49
KFAttached/Misc/AimReference.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class AimReference : MonoBehaviour
|
||||
{
|
||||
[NonSerialized]
|
||||
public Vector3 positionOffset;
|
||||
[NonSerialized]
|
||||
public Quaternion rotationOffset;
|
||||
[NonSerialized]
|
||||
public AimReferenceGroup group;
|
||||
[NonSerialized]
|
||||
public int index = -1;
|
||||
[NonSerialized]
|
||||
public ScopeBase scopeBase;
|
||||
[SerializeField]
|
||||
private GameObject scopeBindingObject;
|
||||
public bool asReference;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (!group)
|
||||
{
|
||||
return;
|
||||
}
|
||||
scopeBase = GetComponentInParent<ScopeBase>();
|
||||
Transform refTrans = scopeBase ? scopeBase.transform : transform.parent;
|
||||
rotationOffset = Quaternion.Inverse(refTrans.rotation) * transform.rotation;
|
||||
positionOffset = refTrans.InverseTransformDirection(transform.position - refTrans.position);
|
||||
group.UpdateEnableStates();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (!group)
|
||||
{
|
||||
return;
|
||||
}
|
||||
group.UpdateEnableStates();
|
||||
}
|
||||
|
||||
public void UpdateEnableState(bool state)
|
||||
{
|
||||
if (scopeBindingObject)
|
||||
{
|
||||
scopeBindingObject.SetActive(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
KFAttached/Misc/AimReference.cs.meta
Normal file
11
KFAttached/Misc/AimReference.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53a21d5a88ab0034c8b0db6ea40e7d85
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
62
KFAttached/Misc/AimReferenceGroup.cs
Normal file
62
KFAttached/Misc/AimReferenceGroup.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
#if NotEditor
|
||||
using KFCommonUtilityLib;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
|
||||
public class AimReferenceGroup : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public AimReference[] aimReferences;
|
||||
private bool registered;
|
||||
|
||||
#if NotEditor
|
||||
private ActionModuleProceduralAiming.ProceduralAimingData data;
|
||||
private void Awake()
|
||||
{
|
||||
if (aimReferences != null)
|
||||
{
|
||||
foreach (var reference in aimReferences)
|
||||
{
|
||||
reference.group = this;
|
||||
}
|
||||
}
|
||||
|
||||
EntityPlayerLocal player = GetComponentInParent<EntityPlayerLocal>();
|
||||
if (aimReferences == null || aimReferences.Length == 0 || !player || player.inventory?.holdingItemData?.actionData?[1] is not IModuleContainerFor<ActionModuleProceduralAiming.ProceduralAimingData> module)
|
||||
{
|
||||
Destroy(this);
|
||||
if (aimReferences != null)
|
||||
{
|
||||
foreach (var reference in aimReferences)
|
||||
{
|
||||
Destroy(reference);
|
||||
}
|
||||
aimReferences = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
data = module.Instance;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (registered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
registered = data.RegisterGroup(aimReferences, gameObject.name);
|
||||
}
|
||||
#endif
|
||||
|
||||
internal void UpdateEnableStates()
|
||||
{
|
||||
#if NotEditor
|
||||
if (!registered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
data.UpdateCurrentReference();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
11
KFAttached/Misc/AimReferenceGroup.cs.meta
Normal file
11
KFAttached/Misc/AimReferenceGroup.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93cdda222d3f0e24aa2b48c9b9fd7b81
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7
KFAttached/Misc/AttachmentReference.cs
Normal file
7
KFAttached/Misc/AttachmentReference.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("")]
|
||||
public class AttachmentReference : MonoBehaviour
|
||||
{
|
||||
public Transform attachmentReference;
|
||||
}
|
||||
11
KFAttached/Misc/AttachmentReference.cs.meta
Normal file
11
KFAttached/Misc/AttachmentReference.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ade2782c6b27f6448984f3d9d0ef550
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
45
KFAttached/Misc/AttachmentReferenceAppended.cs
Normal file
45
KFAttached/Misc/AttachmentReferenceAppended.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class AttachmentReferenceAppended : AttachmentReference
|
||||
{
|
||||
private Transform[] bindings;
|
||||
public void Merge(AnimationTargetsAbs targets)
|
||||
{
|
||||
if (attachmentReference && targets)
|
||||
{
|
||||
foreach (var bindings in attachmentReference.GetComponentsInChildren<TransformActivationBinding>(true))
|
||||
{
|
||||
bindings.targets = targets;
|
||||
}
|
||||
bindings = new Transform[attachmentReference.childCount];
|
||||
for (int i = 0; i < attachmentReference.childCount; i++)
|
||||
{
|
||||
bindings[i] = attachmentReference.GetChild(i);
|
||||
bindings[i].SetParent(targets.AttachmentRef, false);
|
||||
}
|
||||
Destroy(attachmentReference.gameObject);
|
||||
attachmentReference = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
if (bindings != null)
|
||||
{
|
||||
foreach (var binding in bindings)
|
||||
{
|
||||
if (binding)
|
||||
{
|
||||
binding.SetParent(null, false);
|
||||
Destroy(binding.gameObject);
|
||||
}
|
||||
}
|
||||
bindings = null;
|
||||
}
|
||||
if (attachmentReference)
|
||||
{
|
||||
Destroy(attachmentReference.gameObject);
|
||||
attachmentReference = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
KFAttached/Misc/AttachmentReferenceAppended.cs.meta
Normal file
11
KFAttached/Misc/AttachmentReferenceAppended.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2f4680216a56a6479d51c0c8a9f51a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
KFAttached/Misc/AudioSourceGroup.cs
Normal file
15
KFAttached/Misc/AudioSourceGroup.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class AudioSourceGroup
|
||||
{
|
||||
[SerializeField]
|
||||
public string groupName;
|
||||
[SerializeField]
|
||||
public AudioClip[] clips = new AudioClip[0];
|
||||
[SerializeField]
|
||||
public AudioSource source;
|
||||
|
||||
public bool IsValid => source != null && clips != null && clips.Length > 0 && source != null;
|
||||
}
|
||||
11
KFAttached/Misc/AudioSourceGroup.cs.meta
Normal file
11
KFAttached/Misc/AudioSourceGroup.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8d5d39385ea6d348b03c7cdf161c572
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
6
KFAttached/Misc/IgnoreTint.cs
Normal file
6
KFAttached/Misc/IgnoreTint.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class IgnoreTint : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
11
KFAttached/Misc/IgnoreTint.cs.meta
Normal file
11
KFAttached/Misc/IgnoreTint.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 122c053de47e8a14aa2aa57287456e86
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
31
KFAttached/Misc/ItemAnimatorUpdate.cs
Normal file
31
KFAttached/Misc/ItemAnimatorUpdate.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Animations.Rigging;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
[AddComponentMenu("")]
|
||||
[DisallowMultipleComponent]
|
||||
internal class ItemAnimatorUpdate : MonoBehaviour
|
||||
{
|
||||
private Animator animator;
|
||||
private RigBuilder weaponRB;
|
||||
internal PlayableGraph graph;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
TryGetComponent<RigBuilder>(out weaponRB);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
//animator.playableGraph.Evaluate(Time.deltaTime);
|
||||
animator.Update(Time.deltaTime);
|
||||
//graph.Evaluate(Time.deltaTime);
|
||||
//weaponRB?.Evaluate(Time.deltaTime);
|
||||
}
|
||||
}
|
||||
11
KFAttached/Misc/ItemAnimatorUpdate.cs.meta
Normal file
11
KFAttached/Misc/ItemAnimatorUpdate.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b9545ce69a57b542aef2de6d8093b73
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
34
KFAttached/Misc/PlayerRigLateUpdate.cs
Normal file
34
KFAttached/Misc/PlayerRigLateUpdate.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Animations.Rigging;
|
||||
|
||||
[Obsolete]
|
||||
[AddComponentMenu("")]
|
||||
public class PlayerRigLateUpdate : MonoBehaviour
|
||||
{
|
||||
#if NotEditor
|
||||
//private Animator animator;
|
||||
//private RigBuilder rigBuilder;
|
||||
//private void Awake()
|
||||
//{
|
||||
// animator = GetComponent<Animator>();
|
||||
// rigBuilder = GetComponent<RigBuilder>();
|
||||
//}
|
||||
|
||||
//private void OnAnimatorMove()
|
||||
//{
|
||||
// if (rigBuilder.enabled)
|
||||
// ForceToManualUpdate();
|
||||
//}
|
||||
|
||||
//private void LateUpdate()
|
||||
//{
|
||||
// rigBuilder.Evaluate(Time.deltaTime);
|
||||
//}
|
||||
|
||||
//private void ForceToManualUpdate()
|
||||
//{
|
||||
// RigTargets.RebuildRig(animator, rigBuilder);
|
||||
//}
|
||||
#endif
|
||||
}
|
||||
11
KFAttached/Misc/PlayerRigLateUpdate.cs.meta
Normal file
11
KFAttached/Misc/PlayerRigLateUpdate.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f95fdfaecc53e6146a222aa23dd93ae2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
5
KFAttached/Misc/ScopeBase.cs
Normal file
5
KFAttached/Misc/ScopeBase.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ScopeBase : MonoBehaviour
|
||||
{
|
||||
}
|
||||
11
KFAttached/Misc/ScopeBase.cs.meta
Normal file
11
KFAttached/Misc/ScopeBase.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22006be69eab7844e8873de3daedd07c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
62
KFAttached/Misc/WeaponCameraFollow.cs
Normal file
62
KFAttached/Misc/WeaponCameraFollow.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
|
||||
[AddComponentMenu("")]
|
||||
public class WeaponCameraFollow : MonoBehaviour
|
||||
{
|
||||
public RenderTexture targetTexture;
|
||||
#if NotEditor
|
||||
public ActionModuleDynamicSensitivity.DynamicSensitivityData dynamicSensitivityData;
|
||||
public EntityPlayerLocal player;
|
||||
#endif
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
#if NotEditor
|
||||
OcclusionManager.Instance.SetMultipleCameras(true);
|
||||
if (dynamicSensitivityData != null)
|
||||
{
|
||||
dynamicSensitivityData.activated = true;
|
||||
}
|
||||
//UpdateAntialiasing();
|
||||
#endif
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
#if NotEditor
|
||||
OcclusionManager.Instance.SetMultipleCameras(false);
|
||||
if (dynamicSensitivityData != null)
|
||||
{
|
||||
dynamicSensitivityData.activated = false;
|
||||
}
|
||||
#endif
|
||||
if (!targetTexture || !targetTexture.IsCreated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
var cmd = new CommandBuffer();
|
||||
cmd.SetRenderTarget(targetTexture);
|
||||
cmd.ClearRenderTarget(true, true, Color.black);
|
||||
Graphics.ExecuteCommandBuffer(cmd);
|
||||
cmd.Dispose();
|
||||
}
|
||||
|
||||
#if NotEditor
|
||||
public void UpdateAntialiasing()
|
||||
{
|
||||
var pipCamera = GetComponent<Camera>();
|
||||
var layer = GetComponent<PostProcessLayer>();
|
||||
var prevFsr = player.renderManager.fsr;
|
||||
int num = player.renderManager.dlssEnabled ? 0 : GamePrefs.GetInt(EnumGamePrefs.OptionsGfxAA);
|
||||
float @float = GamePrefs.GetFloat(EnumGamePrefs.OptionsGfxAASharpness);
|
||||
player.renderManager.FSRInit(layer.superResolution);
|
||||
player.renderManager.SetAntialiasing(num, @float, layer);
|
||||
Rect rect = pipCamera.rect;
|
||||
rect.x = ((layer.antialiasingMode == PostProcessLayer.Antialiasing.SuperResolution) ? 1E-07f : 0f);
|
||||
pipCamera.rect = rect;
|
||||
player.renderManager.fsr = prevFsr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
11
KFAttached/Misc/WeaponCameraFollow.cs.meta
Normal file
11
KFAttached/Misc/WeaponCameraFollow.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9ea69da20db0064282418fbfd9a57c7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user