/// <summary>
    /// 人クラスから呼び出す(引数にチケットの種類入力)
    /// </summary>
    /// <param name="type"></param>
    public void SetTicket(TicketType type)
    {
        //人の持っているチケット情報をこのスクリプトのenum変数に取得する
        _ticket = type;
        //チケットの種類を見て、_gateの値を変える(switch)
        switch (_ticket)
        {
        case TicketType.paper:
        case TicketType.paper_miss:
            _gate = GateContoroller.Ticket;
            StartCoroutine(TicketPreview(_ticket == TicketType.paper));
            SpriteChange(0);
            //Debug.Log("TICKET");
            break;

        case TicketType.suica:
            StartCoroutine(LampPreview(true));
            _gate = GateContoroller.Pasumo_OK;
            SpriteChange(2);
            //Debug.Log("PASUMO");
            break;

        case TicketType.suica_miss:
            StartCoroutine(LampPreview(false));
            _gate = GateContoroller.NO;
            SpriteChange(4);
            //Debug.Log("PASUMO_NO");
            break;
        }
        //タイマーを開始する
        timeOn = true;
    }
    public IEnumerator WaitTicketTiming(System.Action action)
    {
        GateContoroller nowType = _gate;

        while (nowType == _gate)
        {
            yield return(null);
        }

        action();
    }
 private void Completed()
 {
     timeOn = false;
     //Debug.Log(timer);
     /*人クラスにタイムと終了したかを渡す関数呼び出し*/
     HumanManager.instance.ActionComplete(timer);
     timer = 0;
     _gate = GateContoroller.Start;
     HumanManager.instance.EndPosComplate();
     SpriteChange(5);
     Debug.Log("END");
 }
 /// <summary>
 /// 切符が間違っているかどうかを取得(間違ってたらNO,あってたらTicket_OK1)
 /// </summary>
 private void TicketSort()
 {
     //切符が間違っているかどうかを取得(間違ってたらNO,あってたらTicket_OK1)
     if (_ticket == TicketType.paper)
     {
         _gate = GateContoroller.Ticket_OK1;
         SpriteChange(3);
         //Debug.Log("GOOD");
     }
     if (_ticket == TicketType.paper_miss)
     {
         _gate = GateContoroller.NO;
         SpriteChange(4);
         //Debug.Log("NO_GOOD");
     }
 }
    /// <summary>
    /// 特定の列挙かどうか判断、および列挙変更(スペース以外)
    /// </summary>
    /// <param name="gate"></param>
    private void TicketChoice(GateContoroller gate)
    {
        if (_gate != gate)
        {
            //ポコポコ怒りアニメーション
            //Debug.Log("??");
            return;
        }
        switch (gate)
        {
        case GateContoroller.Pasumo_OK:
            staffAnim.SetTrigger("pasumo");
            Completed();
            //Debug.Log("↑");
            EffectManager.instance.PlayEffect(EffectManager.EffectType.Peep, new Vector2(-300, 0));
            SoundManager.instance.PlaySE(Random.Range(0, 3) == 0 ? SoundManager.SoundType.peep_ka : SoundManager.SoundType.peep_ra);
            SpriteChange(5);
            break;

        case GateContoroller.Ticket:
            staffAnim.SetTrigger("toGet");
            TicketSort();
            //Debug.Log("←");
            break;

        case GateContoroller.Ticket_OK1:
            staffAnim.SetTrigger("toPush");
            _gate = GateContoroller.Ticket_OK2;
            SpriteChange(1);
            //Debug.Log("↓");
            break;

        case GateContoroller.Ticket_OK2:
            staffAnim.SetTrigger("toOut");
            SpriteChange(5);
            Completed();
            //Debug.Log("→");
            break;

        default:
            return;
        }
    }
 /// <summary>
 /// スペース時の判別
 /// </summary>
 private void SpaceDoor()
 {
     staffAnim.SetTrigger("toGate");
     if (_gate == GateContoroller.NO || (_gate == GateContoroller.Ticket && _ticket == TicketType.paper_miss))
     {
         //正しく止めたことを人クラスに渡す(関数呼び出し)
         //Debug.Log("SPACE");
         HumanManager.instance.GateClose(true);
     }
     else
     {
         //間違えて止めたことを人クラスに渡す(関数呼び出し)
         //Debug.Log("SPACE_BAD");
         HumanManager.instance.GateClose(false);
     }
     timeOn = false;
     timer  = 0;
     _gate  = GateContoroller.Start;
     SpriteChange(5);
     EffectManager.instance.PlayEffect(EffectManager.EffectType.cutIn, Vector3.zero);
     SoundManager.instance.PlaySE(SoundManager.SoundType.Stop);
     //HumanManager.instance.EndPosComplate();
 }