예제 #1
0
    /// <summary>
    /// Move into the given playable.
    /// </summary>
    /// <param name="next"></param>
    public void MoveTo(Playable next)
    {
        next.Enter();

        if (currentPlayable != null)
        {
            currentPlayable.Leave();
        }

        currentPlayable = next;

        // NB: only update if it has an ID assigned.
        if (currentPlayable.Id != "")
        {
            State.CurrentPlayableId = currentPlayable.Id;
        }
    }
예제 #2
0
    void Update()
    {
        currentPlayable.PlayableUpdate();

        if (Input.GetMouseButton(0) && currentTarget != null)
        {
            Playable nextPlayable = currentTarget.GetComponent <Playable>();

            if (nextPlayable != null)
            {
                if (Input.GetMouseButton(0))
                {
                    nextPlayable.Enter();
                    currentPlayable.Leave();
                    currentPlayable = nextPlayable;

                    if (currentPlayable.Id != null && currentPlayable.Id != "")
                    {
                        State.CurrentPlayableId = currentPlayable.Id;
                    }
                }
            }
        }
    }
예제 #3
0
 void Start()
 {
     currentPlayable = State.CurrentPlayable;
     currentPlayable.Enter();
     FindObjectOfType <HoverController>().OnHoverUpdate += this.OnHoverUpdate;
 }