mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-12-18 06:20:03 +00:00
31 lines
493 B
Markdown
31 lines
493 B
Markdown
|
# Starpelly
|
||
|
Tools for Unity
|
||
|
|
||
|
Simulates the "A" key press every 0.6 seconds:
|
||
|
```cs
|
||
|
using UnityEngine;
|
||
|
|
||
|
using Starpelly.OS;
|
||
|
|
||
|
public class test : MonoBehaviour
|
||
|
{
|
||
|
private float action = 0.0f;
|
||
|
private float period = 0.6f;
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
Application.runInBackground = true;
|
||
|
}
|
||
|
|
||
|
private void Update()
|
||
|
{
|
||
|
if (Time.time > action)
|
||
|
{
|
||
|
action += period;
|
||
|
Windows.KeyPress(Starpelly.KeyCodeWin.KEY_A);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
```
|