This commit is contained in:
Patrice Vignola 2016-01-31 09:53:08 -05:00
parent da8d5a0506
commit fe98521b0d
3 changed files with 145 additions and 119 deletions

View File

@ -71,9 +71,13 @@ public class RuneBehaviour : MonoBehaviour {
float ratio = 0f; float ratio = 0f;
while (ratio < 1f) while (ratio < 1f)
{
// Hack
if (enabled)
{ {
ratio += Time.deltaTime / LightTime; ratio += Time.deltaTime / LightTime;
symbol.color = Color.Lerp(startColor, DefaultColor, ratio); symbol.color = Color.Lerp(startColor, DefaultColor, ratio);
}
yield return null; yield return null;
} }

View File

@ -1,5 +1,6 @@
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using XInputDotNetPure;
[RequireComponent(typeof(Rigidbody))] [RequireComponent(typeof(Rigidbody))]
public class SelectorWithBolts : MonoBehaviour public class SelectorWithBolts : MonoBehaviour
@ -74,5 +75,26 @@ public class SelectorWithBolts : MonoBehaviour
yield return null; yield return null;
} }
StartCoroutine(VibrateController(playerId));
}
private IEnumerator VibrateController(int playerId)
{
GamePad.SetVibration((PlayerIndex)playerId, 1f, 1f);
yield return new WaitForSeconds(0.5f);
GamePad.SetVibration((PlayerIndex)playerId, 0f, 0f);
}
void OnApplicationQuit()
{
// In case the coroutine was still running when we closed the game
for (int i = 0; i < Bolts.Length; i++)
{
GamePad.SetVibration((PlayerIndex)i, 0f, 0f);
}
} }
} }