Beispiel #1
0
        /************************************************************************************************************************/

        /// <summary>[<see cref="IInteractable"/>]
        /// Toggles this door between open and closed.
        /// </summary>
        public void Interact()
        {
            // Get the state to set its speed (or we could have just kept the state from Awake).
            var state = _Animancer.GetState(_Open);

            // If currently near closed, play the animation forwards.
            if (_Openness < 0.5f)
            {
                state.Speed = 1;
                _Openness   = 1;
            }
            else// Otherwise play it backwards.
            {
                state.Speed = -1;
                _Openness   = 0;
            }

            // And make sure the graph is playing.
            _Animancer.Playable.UnpauseGraph();
        }