Ejemplo n.º 1
0
    public void ToggleDoor(Transform door)
    {
        //assumes all door transforms start shut
        if (!doorRotator.ContainsKey(door))
        {
            doorRotator[door] = new DoorRotationLerpContext(door, door.localRotation, Quaternion.Euler(0, 0, 90f), .4f);
        }

        doorRotator[door].Toggle(StartCoroutine);
    }
Ejemplo n.º 2
0
    public void ToggleDoor(Transform door)
    {
        //assumes all door transforms start shut
        if (lerp == null)
        {
            lerp = new DoorRotationLerpContext(door, door.localRotation, Quaternion.Euler(-60, 0, -90f), .8f);
        }

        lerp.Toggle(StartCoroutine);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Using the public Ramps array, create door rotate lerp contexts for them
    /// </summary>
    private void InitializeRamps()
    {
        ramps = new DoorRotationLerpContext[Ramps.Length];
        int i = 0;

        foreach (Transform t in Ramps)
        {
            ramps[i] = new DoorRotationLerpContext(t, t.localRotation, t.localRotation * Quaternion.Euler(0f, -150f, 0f), DoorMoveDuration);
            i++;
        }
    }
Ejemplo n.º 4
0
    public void ToggleDoor(Transform door)
    {
        //assumes all door transforms start shut
        if (lerp == null)
        {
            lerp = new DoorRotationLerpContext(door, door.localRotation, Quaternion.Euler(0, -90, 90f), .4f, this.onToggle);
        }

        this.rigid.isKinematic = true;
        lerp.Toggle(StartCoroutine);
    }