Beispiel #1
0
    public void OnMouseDrag()
    {
        // This is so scuffed.
        // Make the raycast coming up go through this die.
        gameObject.layer = 2;

        m_DieValue   = m_PhysicsDie.GetResult();
        m_PointerRay = m_GameCamera.ScreenPointToRay(Input.mousePosition);
        Physics.Raycast(m_PointerRay, out m_Hit, float.MaxValue);
        transform.position = m_Hit.point + (Vector3.up * m_DragHeight);
        m_PhysicsDie.GetRigidbody().velocity = Vector3.zero;

        // This is dumb.
        // Have to reset for function to even be called again.
        gameObject.layer = 0;
    }
Beispiel #2
0
 public void CheckResult()
 {
     JamesManager.instance.DoEffects((dieOnCard == null || dieOnCard.GetResult() < cardData.dc) ? cardData.failureEffects : cardData.successEffects);
 }