void OnCollisionEnter(Collision collision) { var seq = new CodeSequence(); // seq.AddEffect(0.0, new CodeEffect("double_click", 1 - (playerHealth / playerMaxHealth), (playerMaxHealth / playerHealth))); seq.AddEffect(0.0, new CodeEffect("double_click", 0.9f)); seq.Play(AreaFlag.All_Areas); }
IEnumerator MyHeartbeat() { IsHeartBeating = true; var seq = new CodeSequence(); //seq.AddEffect(0.0, new CodeEffect("double_click", 1 - (playerHealth / playerMaxHealth), (playerMaxHealth / playerHealth))); seq.AddEffect(0.0, new CodeEffect("double_click", 0.6f)); while (IsHeartBeating) { seq.Play(AreaFlag.Chest_Left); yield return(new WaitForSeconds(1.0f)); //yield return new WaitForSeconds((playerHealth / playerMaxHealth)); } }