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

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

View File

@ -1,5 +1,6 @@
using UnityEngine;
using System.Collections;
using XInputDotNetPure;
[RequireComponent(typeof(Rigidbody))]
public class SelectorWithBolts : MonoBehaviour
@ -74,5 +75,26 @@ public class SelectorWithBolts : MonoBehaviour
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);
}
}
}