IEnumerator execOpen(CMJ2Hero hero) { Vector3 posl = m_leftDoor.transform.position; Vector3 posr = m_rightDoor.transform.position; iTween.MoveTo(m_leftDoor, iTween.Hash( "position", posl - new Vector3 (m_doorOpenDist, 0f), "time", m_doorOpenSpeed, "easetype", iTween.EaseType.easeOutQuad)); iTween.MoveTo(m_rightDoor, iTween.Hash( "position", posr + new Vector3 (m_doorOpenDist, 0f), "time", m_doorOpenSpeed, "easetype", iTween.EaseType.easeOutQuad)); yield return new WaitForSeconds (m_doorCloseDelay); iTween.MoveTo(m_leftDoor, iTween.Hash( "position", posl, "time", m_doorOpenSpeed, "easetype", iTween.EaseType.easeInQuad)); iTween.MoveTo(m_rightDoor, iTween.Hash( "position", posr, "time", m_doorOpenSpeed, "easetype", iTween.EaseType.easeInQuad)); yield return new WaitForSeconds (m_doorOpenSpeed); hero.doorClosed(); }
public void open(CMJ2Hero hero) { if (m_open) return; m_open = true; StartCoroutine(execOpen(hero)); }