Exemple #1
0
    IEnumerator SlamOpen()
    {
        if (playerSelection)
        {
            playerSelection.ClearPrompt();
            playerSelection.gameObject.GetComponent <Player>().rig.SetTrigger("bash");


            float elapsedTime = 0;
            float waitTime    = 0.1f;

            while (elapsedTime < waitTime)
            {
                float state = Mathf.Lerp(0f, 90f, Mathf.SmoothStep(0f, 1f, elapsedTime / waitTime));
                transform.localEulerAngles = new Vector3(0f, state, 0f);

                elapsedTime += Time.deltaTime;
                yield return(null);
            }
            yield return(null);

            playerSelection.transform.GetComponent <Player>().OnEndInteract();
            doorState = 1f;

            playerSelection.gameObject.GetComponent <Player>().rig.ResetTrigger("bash");

            Destroy(this);
        }
    }
Exemple #2
0
 public void OnEndHover(Transform player)
 {
     playerSelection.ClearPrompt();
 }