void ConsiderTriggering(LuckHolder lh = null) { float threshold = tension*.3f; if (lh != null) { // Case on Trigger Enter float unluck = lh.GetUnluckyFactor (); threshold = unluck * 0.9f + tension * 0.1f; } if (Random.Range (0.1f, 1f) < threshold) { activated = true; Debug.Log ("Trigered"); activateCallback.Invoke (); } }
public void setGrab(bool grab, Transform player) { isGrabbed = grab; myPlayer = (player != null) ? player.GetComponent<LuckHolder>() : null; }