Tanoda
TransitionBehaviour.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using System.Collections;
10using System.Collections.Generic;
11using UnityEngine;
12
13namespace Leap.Unity.Recording {
14
15 public class TransitionBehaviour : MonoBehaviour {
16 private static List<TransitionBehaviour> _transitionBehaviours = new List<TransitionBehaviour>();
17
18 public GameObject destination;
19 public GameObject transitionState;
20
21 [ContextMenu("Trigger Transition")]
22 public void Transition() {
23 gameObject.SetActive(false);
24
25 if (transitionState != null) {
26 transitionState.GetComponents(_transitionBehaviours);
27 foreach (var tb in _transitionBehaviours) {
28 tb.destination = destination;
29 }
30
31 transitionState.SetActive(true);
32 } else {
33 destination.SetActive(true);
34 }
35 }
36 }
37}