-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
883 additions
and
280 deletions.
There are no files selected for viewing
269 changes: 269 additions & 0 deletions
269
...m.yuxiaviation.vau320neo/Runtime/Accesories/SFEXT_a320_AdvancedFlapsKeyboardControl.asset
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...iaviation.vau320neo/Runtime/Accesories/SFEXT_a320_AdvancedFlapsKeyboardControl.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
.../com.yuxiaviation.vau320neo/Runtime/Accesories/SFEXT_a320_AdvancedFlapsKeyboardControl.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using EsnyaSFAddons.DFUNC; | ||
using UdonSharp; | ||
using UnityEngine; | ||
using VRC.SDKBase; | ||
using VRC.Udon; | ||
|
||
namespace A320VAU.SFEXT { | ||
public class SFEXT_a320_AdvancedFlapsKeyboardControl : UdonSharpBehaviour { | ||
public DFUNC_AdvancedFlaps advancedFlaps; | ||
|
||
public KeyCode flapsUpKey = KeyCode.Alpha1; | ||
public KeyCode flapsDownKey = KeyCode.Alpha2; | ||
|
||
private bool _isKeyPress; | ||
|
||
private void LateUpdate() { | ||
if (Input.GetKey(flapsUpKey)) { | ||
if (_isKeyPress) return; | ||
|
||
var targetFlapDetentIndex = advancedFlaps.targetDetentIndex - 1; | ||
if (targetFlapDetentIndex < advancedFlaps.detents.Length && targetFlapDetentIndex >= 0) | ||
advancedFlaps.targetAngle = advancedFlaps.detents[targetFlapDetentIndex]; | ||
|
||
_isKeyPress = true; | ||
return; | ||
} | ||
|
||
if (Input.GetKey(flapsDownKey)) { | ||
if (_isKeyPress) return; | ||
|
||
var targetFlapDetentIndex = advancedFlaps.targetDetentIndex + 1; | ||
if (targetFlapDetentIndex < advancedFlaps.detents.Length && targetFlapDetentIndex >= 0) | ||
advancedFlaps.targetAngle = advancedFlaps.detents[targetFlapDetentIndex]; | ||
|
||
_isKeyPress = true; | ||
return; | ||
} | ||
|
||
_isKeyPress = false; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...yuxiaviation.vau320neo/Runtime/Accesories/SFEXT_a320_AdvancedFlapsKeyboardControl.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.