Skip to content

Commit

Permalink
make useful variables in dfuncs public, fix SF-1 material
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacchan-VRC committed Nov 13, 2021
1 parent 732612e commit b77380e
Show file tree
Hide file tree
Showing 29 changed files with 1,008 additions and 839 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This is a prefab for VRChat containing the vehicles I've made. It is made in suc

As of version 1.5 it has become quite modular, allowing for much greator customization, and easy addition of custom code.

# License

This project is licensed under the MIT License - see the LICENSE.md file for details.

# Support

If you like my work, please consider buying me a coffee at https://ko-fi.com/sacchanvrc !
4 changes: 2 additions & 2 deletions SF-1/Materials/SF-1Cockpit.mat
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: c663fa37589eee2469f8653d9f36a8c4, type: 3}
m_Texture: {fileID: 2800000, guid: 636b2996f24a1e347966ac454f00fb11, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 99176770257d24147909e371515acf40, type: 3}
m_Texture: {fileID: 2800000, guid: a600760c8b8c7f842aa8e77f681df337, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
Expand Down
6 changes: 3 additions & 3 deletions SF-1/Materials/SF-1Main.mat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Material:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 8972777ba7d2ccd4786a6410d9f70304, type: 3}
m_Texture: {fileID: 2800000, guid: 689df2ad2cf661847aa0c46084981652, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
Expand All @@ -40,11 +40,11 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 54fa21666fe534c4d8918358abddb548, type: 3}
m_Texture: {fileID: 2800000, guid: 3dffd8b619844aa4d8d0df941c4b0c57, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: ba0609bad418b3646b18503dd320da9b, type: 3}
m_Texture: {fileID: 2800000, guid: 8fe6996d97424754e9a9c74fcda23ee0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
Expand Down
6 changes: 3 additions & 3 deletions Scripts/DFUNC/DFUNC_AAM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public class DFUNC_AAM : UdonSharpBehaviour
{
[SerializeField] public UdonSharpBehaviour SAVControl;
[SerializeField] private Animator AAMAnimator;
[SerializeField] private int NumAAM = 6;
public int NumAAM = 6;
[Tooltip("If target is within this angle of the direction the gun is aiming, it is lockable")]
public float AAMLockAngle = 15;
[Tooltip("AAM takes this long to lock before it can fire (seconds)")]
[SerializeField] private float AAMLockTime = 1.5f;
public float AAMLockTime = 1.5f;
[Tooltip("Minimum time between missile launches")]
[SerializeField] private float AAMLaunchDelay = 0;
[Tooltip("How long it takes to fully reload from empty in seconds. Can be inaccurate because it can only reload by integers per resupply")]
Expand Down Expand Up @@ -69,7 +69,7 @@ public bool sendtargeted
private int NumAAMTargets;
private float AAMLockTimer = 0;
private bool AAMHasTarget = false;
private bool AAMLocked = false;
[System.NonSerializedAttribute] public bool AAMLocked = false;
private bool TriggerLastFrame;
private float AAMLastFiredTime = 0;
private float FullAAMsDivider;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DFUNC/DFUNC_AltHold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DFUNC_AltHold : UdonSharpBehaviour
private SaccEntity EntityControl;
private bool UseLeftTrigger = false;
private bool TriggerLastFrame;
private bool AltHold;
[System.NonSerializedAttribute] public bool AltHold;
private Rigidbody VehicleRigidbody;
private Transform VehicleTransform;
private Vector3 RotationInputs;
Expand Down
4 changes: 2 additions & 2 deletions Scripts/DFUNC/DFUNC_Bomb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public class DFUNC_Bomb : UdonSharpBehaviour
{
[SerializeField] public UdonSharpBehaviour SAVControl;
[SerializeField] private Animator BombAnimator;
[SerializeField] private GameObject Bomb;
public GameObject Bomb;
[Tooltip("How long it takes to fully reload from empty in seconds. Can be inaccurate because it can only reload by integers per resupply")]
[SerializeField] private float FullReloadTimeSec = 8;
[SerializeField] private Text HUDText_Bomb_ammo;
[SerializeField] private int NumBomb = 4;
public int NumBomb = 4;
[Tooltip("Delay between bomb drops when holding the trigger")]
[SerializeField] private float BombHoldDelay = 0.5f;
[Tooltip("Minimum delay between bomb drops")]
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DFUNC/DFUNC_Brake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class DFUNC_Brake : UdonSharpBehaviour
[Tooltip("Because you have to hold the break, and the keyboardcontrols script can only send events, this option is here.")]
[SerializeField] private KeyCode KeyboardControl = KeyCode.B;
private bool UseLeftTrigger = false;
[UdonSynced(UdonSyncMode.None)] private float BrakeInput;
[System.NonSerializedAttribute, UdonSynced(UdonSyncMode.None)] public float BrakeInput;
private Rigidbody VehicleRigidbody;
private bool HasAirBrake;
[SerializeField] private float AirbrakeStrength = 4f;
Expand Down
8 changes: 4 additions & 4 deletions Scripts/DFUNC/DFUNC_Canopy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ public class DFUNC_Canopy : UdonSharpBehaviour
[Tooltip("Extra drag applied to vehicle while canopy is open")]
[SerializeField] private float CanopyDragMulti = 1.2f;
[Tooltip("Name of animator boolean that is true when canopy is open")]
[SerializeField]private string AnimCanopyBool = "canopyopen";
[SerializeField] private string AnimCanopyBool = "canopyopen";
[Tooltip("Name of animator boolean that is true when canopy is broken")]
[SerializeField]private string AnimCanopyBroken = "canopybroken";
[SerializeField] private string AnimCanopyBroken = "canopybroken";
private SaccEntity EntityControl;
private bool UseLeftTrigger = false;
private bool TriggerLastFrame;
private Transform VehicleTransform;
private VRCPlayerApi localPlayer;
private SAV_HUDController HUDControl;
private bool InVR;
private bool CanopyOpen;
private bool CanopyBroken;
[System.NonSerializedAttribute] public bool CanopyOpen;
[System.NonSerializedAttribute] public bool CanopyBroken;
private bool Selected;
private float LastCanopyToggleTime = -999;
private bool DragApplied;
Expand Down
9 changes: 6 additions & 3 deletions Scripts/DFUNC/DFUNC_Catapult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public class DFUNC_Catapult : UdonSharpBehaviour
private bool UseLeftTrigger = false;
private bool TriggerLastFrame;
private bool Selected;
private bool OnCatapult;
private bool Launching = false;
[System.NonSerializedAttribute] public bool OnCatapult;
[System.NonSerializedAttribute] public bool Launching = false;
private bool Piloting = false;
private Transform VehicleTransform;
private Transform CatapultTransform;
[System.NonSerializedAttribute] public Transform CatapultTransform;
private int CatapultDeadTimer;
private Rigidbody VehicleRigidbody;
private float InVehicleThrustVolumeFactor;
Expand Down Expand Up @@ -303,17 +303,20 @@ public void LaunchCatapult()
if (Utilities.IsValid(CatapultAnimator))
{ CatapultAnimator.SetTrigger("launch"); }
if (Dial_Funcon) { Dial_Funcon.SetActive(false); }
EntityControl.SendEventToExtensions("SFEXT_G_LaunchFromCatapult");
}
public void CatapultLockIn()
{
OnCatapult = true;
VehicleAnimator.SetBool("oncatapult", true);
if (CatapultLock) { CatapultLock.Play(); }
if (Dial_Funcon) { Dial_Funcon.SetActive(true); }
EntityControl.SendEventToExtensions("SFEXT_G_CatapultLockIn");
}
public void CatapultLockOff()
{
OnCatapult = false;
VehicleAnimator.SetBool("oncatapult", false);
EntityControl.SendEventToExtensions("SFEXT_G_CatapultLockOff");
}
}
2 changes: 1 addition & 1 deletion Scripts/DFUNC/DFUNC_Flaps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class DFUNC_Flaps : UdonSharpBehaviour
[SerializeField] private float FlapsExtraMaxLift = 0;
private SaccEntity EntityControl;
private bool UseLeftTrigger = false;
private bool Flaps = false;
[System.NonSerializedAttribute] public bool Flaps = false;
private bool TriggerLastFrame;
private bool DragApplied;
private bool LiftApplied;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DFUNC/DFUNC_Flares.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class DFUNC_Flares : UdonSharpBehaviour
{
[SerializeField] private UdonSharpBehaviour SAVControl;
[SerializeField] private int NumFlares = 60;
public int NumFlares = 60;
[Tooltip("Speed to launch flare particles at")]
[SerializeField] private float FlareLaunchSpeed = 100;
[SerializeField] private ParticleSystem[] FlareParticles;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DFUNC/DFUNC_Gun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DFUNC_Gun : UdonSharpBehaviour
private bool UseLeftTrigger = false;
private float FullGunAmmoInSeconds = 12;
private Rigidbody VehicleRigidbody;
[UdonSynced, FieldChangeCallback(nameof(Firing))] private bool _firing;
[System.NonSerializedAttribute, UdonSynced, FieldChangeCallback(nameof(Firing))] public bool _firing;
public bool Firing
{
set
Expand Down
6 changes: 3 additions & 3 deletions Scripts/DFUNC/DFUNC_Hook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public class DFUNC_Hook : UdonSharpBehaviour
private bool UseLeftTrigger = false;
public LayerMask HookCableLayer;
private bool TriggerLastFrame;
[System.NonSerializedAttribute] private bool Hooked = false;
[System.NonSerializedAttribute] private float HookedTime = 0f;
[System.NonSerializedAttribute] public bool Hooked = false;
private float HookedTime = 0f;
private Vector3 HookedLoc;
private Transform VehicleTransform;
private Animator VehicleAnimator;
private Rigidbody VehicleRigidbody;
[System.NonSerializedAttribute] private bool HookDown = false;
[System.NonSerializedAttribute] public bool HookDown = false;
private bool DisableGroundBrake;
private bool func_active;
public void DFUNC_LeftDial() { UseLeftTrigger = true; }
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DFUNC/DFUNC_Reverse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class DFUNC_Reverse : UdonSharpBehaviour
private float ReversingABStrength;
private bool UseLeftTrigger = false;
private bool TriggerLastFrame;
private bool Reversing;
[System.NonSerializedAttribute] public bool Reversing;
public void DFUNC_LeftDial() { UseLeftTrigger = true; }
public void DFUNC_RightDial() { UseLeftTrigger = false; }
public void SFEXT_L_EntityStart()
Expand Down
10 changes: 9 additions & 1 deletion Scripts/DFUNC/DFUNC_Smoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ public bool SmokeOn
private Vector3 SmokeZeroPoint;
private ParticleSystem.EmissionModule[] DisplaySmokeem;
private bool DisplaySmokeNull = true;
[System.NonSerializedAttribute] public Vector3 SmokeColor = Vector3.one;
[UdonSynced, System.NonSerializedAttribute] public Vector3 SmokeColor = Vector3.one;
[System.NonSerializedAttribute] private Vector3 SmokeColorLast = Vector3.one;
[System.NonSerializedAttribute] public bool localSmoking = false;
[System.NonSerializedAttribute] public Color SmokeColor_Color;
private Vector3 TempSmokeCol = Vector3.zero;
private bool Pilot;
private bool Selected;
private bool InEditor; private int DialPosition;
private bool LeftDial;
private float LastSerialization;
private Transform ControlsRoot;
public void DFUNC_LeftDial() { UseLeftTrigger = true; }
public void DFUNC_RightDial() { UseLeftTrigger = false; }
Expand Down Expand Up @@ -161,6 +163,12 @@ private void LateUpdate()
SmokeColor.x = Mathf.Clamp(SmokeColor.x + ((keypad7 - Keypad4) * DeltaTime), 0, 1);
SmokeColor.y = Mathf.Clamp(SmokeColor.y + ((Keypad8 - Keypad5) * DeltaTime), 0, 1);
SmokeColor.z = Mathf.Clamp(SmokeColor.z + ((Keypad9 - Keypad6) * DeltaTime), 0, 1);
if (SmokeColor != SmokeColorLast && (Time.time - LastSerialization > .5f))
{
RequestSerialization();
LastSerialization = Time.time;
}
SmokeColorLast = SmokeColor;
}
//Smoke Color Indicator
SmokeColorIndicatorMaterial.color = SmokeColor_Color;
Expand Down
4 changes: 2 additions & 2 deletions Scripts/DFUNC/DFUNC_ToggleBool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class DFUNC_ToggleBool : UdonSharpBehaviour
[SerializeField] private UdonSharpBehaviour SoundControl;
[Tooltip("How long it takes for the sound to change after toggle to closed")]
[SerializeField] private float DoorCloseTime = 2;
private bool AnimOn = false;
private float ToggleTime;
[System.NonSerializedAttribute] public bool AnimOn = false;
[System.NonSerializedAttribute] public float ToggleTime;
private bool UseLeftTrigger = false;
private bool TriggerLastFrame;
private bool sound_DoorOpen;
Expand Down
Loading

0 comments on commit b77380e

Please sign in to comment.