Exemple #1
0
    public bool     isEventIgnitable(Item.TYPE carried_item, GameObject event_go)
    {
        bool ret = false;

        Event.TYPE type = Event.TYPE.NONE;
        if (event_go != null)
        {
            type = this.getEventType(event_go);
        }
        switch (type)
        {
        case Event.TYPE.ROCKET:
            if (carried_item == Item.TYPE.IRON)
            {
                ret = true;
            }
            if (carried_item == Item.TYPE.PLANT)
            {
                ret = true;
            }
            break;

        case Event.TYPE.FIRE:
            if (carried_item == Item.TYPE.APPLE)
            {
                ret = true;
            }
            if (carried_item == Item.TYPE.PLANT)
            {
                ret = true;
            }
            break;
        }
        return(ret);
    }
    // 지정된 게임 오브젝트의 이벤트 타입 반환
    public string getIgnitableMessage(GameObject event_go)
    {
        string message = string.Empty;

        Event.TYPE type = Event.TYPE.NONE;
        if (event_go != null)
        {
            type = this.getEventType(event_go);
        }
        switch (type)
        {
        case Event.TYPE.House:
            message = "1. 나무저장\n2. 잠자기";
            break;

        case Event.TYPE.Farm:
            message = "1. 물뿌리기\n2. 수확하기";
            break;

        case Event.TYPE.Mail:
            message = "1. 모두 팔기";
            break;
        }
        return(message);
    }
Exemple #3
0
    // 지정된 게임 오브젝트의 이벤트 타입 반환
    public string getIgnitableMessage(GameObject event_go)
    {
        string message = "";

        Event.TYPE type = Event.TYPE.NONE;
        if (event_go != null)
        {
            type = this.getEventType(event_go);
        }
        switch (type)
        {
        case Event.TYPE.ROCKET:
            message = "땟목을 만든다.";
            break;

        case Event.TYPE.MAKEFIRE:
            message = "장작을 쌓는다.";
            break;

        case Event.TYPE.GETFIRE:
            message = "횃불을 든다.";
            break;
        }
        return(message);
    }
Exemple #4
0
    // 철광석이나 식물을 든 상태에서 우주선에 접촉했는지 확인
    public bool isEventIgnitable(Item.TYPE carried_item, GameObject event_go)
    {
        bool ret = false;

        Event.TYPE type = Event.TYPE.NONE;
        if (event_go != null)
        {
            type = this.getEventType(event_go); // 이벤트 타입을 구한다.
        }
        switch (type)
        {
        case Event.TYPE.ROCKET:
            if (carried_item == Item.TYPE.IRON)
            {               // 가지고 있는 것이 철광석이라면.
                ret = true; // '이벤트할 수 있어요!'라고 응답한다.
            }
            if (carried_item == Item.TYPE.PLANT)
            {               // 가지고 있는 것이 식물이라면.
                ret = true; // '이벤트할 수 있어요!'라고 응답한다.
            }
            break;

        case Event.TYPE.MAKEFIRE:
            if (carried_item == Item.TYPE.PLANT)
            {               // 가지고 있는 것이 식물이라면.
                ret = true; // '이벤트할 수 있어요!'라고 응답한다.
            }
            break;

        case Event.TYPE.GETFIRE:
            ret = true;
            break;
        }
        return(ret);
    }
    public bool isEventIgnitable(Item.TYPE carried_item, GameObject event_go)
    {
        bool ret = false;

        Event.TYPE type = Event.TYPE.NONE;

        if (event_go != null)
        {
            type = this.getEventType(event_go); // イベントタイプを取得
        }

        switch (type)
        {
        case Event.TYPE.ROCKET:
            if (carried_item == Item.TYPE.IRON)  // 持っているのが鉄鉱石なら
            {
                ret = true;                      // 「イベントできるよ!」と返す
            }
            if (carried_item == Item.TYPE.PLANT) // 持っているのが植物なら
            {
                ret = true;                      // 「イベントできるよ!」と返す
            }
            break;
        }
        return(ret);
    }
Exemple #6
0
 public Event.TYPE getEventType(GameObject event_go)
 {
     Event.TYPE type = Event.TYPE.NONE;
     if (event_go != null)
     { // 인수의 GameObject가 비어있지 않으면.
         if (event_go.tag == "Rocket")
         {
             type = Event.TYPE.ROCKET;
         }
     }
     return(type);
 }
Exemple #7
0
        /// <summary>
        /// タッチイベントを発行する
        /// </summary>
        /// <param name="type"></param>
        /// <param name="touchInfo"></param>
        private void DispatchEvent(Event.TYPE type, TouchInfo touchInfo)
        {
            List <Event> eventList;

            if (_events.TryGetValue((uint)type, out eventList))
            {
                for (int i = 0; i < eventList.Count; ++i)
                {
                    eventList[i].onTouch(touchInfo);
                }
            }
        }
    public Event.TYPE getEventType(GameObject event_go)
    {
        Event.TYPE type = Event.TYPE.NONE;

        if (event_go != null) // 引数のGameObjectが空っぽでないなら
        {
            if (event_go.tag == "Rocket")
            {
                type = Event.TYPE.ROCKET;
            }
        }
        return(type);
    }
Exemple #9
0
    // 지정된 게임 오브젝트의 이벤트 타입 반환
    public string getIgnitableMessage(GameObject event_go)
    {
        string message = "";

        Event.TYPE type = Event.TYPE.NONE;
        if (event_go != null)
        {
            type = this.getEventType(event_go);
        }
        switch (type)
        {
        case Event.TYPE.ROCKET:
            message = "수리한다";
            break;
        }
        return(message);
    }
Exemple #10
0
    public Event.TYPE getEventType(GameObject event_go)
    {
        Event.TYPE type = Event.TYPE.NONE;
        if (event_go != null)
        {
            if (event_go.tag == "Rocket")
            {
                type = Event.TYPE.ROCKET;
            }

            //fire.
            if (event_go.tag == "Fire")
            {
                type = Event.TYPE.FIRE;
            }
        }
        return(type);
    }
Exemple #11
0
 public Event.TYPE getEventType(GameObject event_go)
 {
     Event.TYPE type = Event.TYPE.NONE;
     if (event_go != null)
     { // 인수의 GameObject가 비어있지 않으면.
         if (event_go.tag == "Rocket")
         {
             type = Event.TYPE.ROCKET;
         }
         if (event_go.tag == "CampFire")
         {
             type = Event.TYPE.GETFIRE;
         }
         if (event_go.tag == "FireRespawn")
         {
             type = Event.TYPE.MAKEFIRE;
         }
     }
     return(type);
 }
 public Event.TYPE getEventType(GameObject event_go)
 {
     Event.TYPE type = Event.TYPE.NONE;
     if (event_go != null)
     { // 인수의 GameObject가 비어있지 않으면.
         if (event_go.layer == LayerMask.NameToLayer("House"))
         {
             //type = Event.TYPE.;
             Debug.Log("get event type is house");
             type = Event.TYPE.House;
         }
         else if (event_go.layer == LayerMask.NameToLayer("Farm"))
         {
             //typ
             Debug.Log("get event type is farm");
             type = Event.TYPE.Farm;
         }
         else if (event_go.layer == LayerMask.NameToLayer("Mail"))
         {
             type = Event.TYPE.Mail;
         }
     }
     return(type);
 }
Exemple #13
0
    public bool isEventIgnitable(Item.TYPE carried_item, GameObject event_go)
    {
        bool ret = false;

        Event.TYPE type = Event.TYPE.NONE;
        if (event_go != null)
        {
            type = this.getEventType(event_go);             // 이벤트 타입을 취득.
        }
        switch (type)
        {
        case Event.TYPE.ROCKET:
            if (carried_item == Item.TYPE.IRON)  // 가지고 있는 것이 철광석이면.
            {
                ret = true;                      // '이벤트할 수 있어요!'라고 반환한다.
            }
            if (carried_item == Item.TYPE.PLANT) // 가지고 있는 것이 식물이면.
            {
                ret = true;                      // '이벤트할 수 있어요!'라고 반환한다.
            }
            break;
        }
        return(ret);
    }
Exemple #14
0
    // Update is called once per frame
    // 상태를 변화시키는 부분, 상태가 변화했을 때의 처리 부분, 각 상태에서의 동작 부분에 추가
    void Update()
    {
        this.get_input(); // 입력 정보 취득.
        this.step_timer += Time.deltaTime;
        float eat_time    = 0.01f;
        float repair_time = 0.5f;

        // 상태를 변화시킨다---------------------.
        if (this.next_step == STEP.NONE)
        { // 다음 예정이 없으면.
            switch (this.step)
            {
            case STEP.MOVE:     // '이동 중' 상태의 처리.
                do
                {
                    if (!this.key.action)
                    {          // 액션 키가 눌려있지 않다.
                        break; // 루프 탈출.
                    }

                    // 주목하는 이벤트가 있을 때.
                    if (this.closest_event != null)
                    {
                        if (!this.is_event_ignitable())
                        {          // 이벤트를 시작할 수 없으면.
                            break; // 아무 것도 하지 않는다.
                        }
                        // 이벤트 종류를 가져온다.
                        Event.TYPE ignitable_event =
                            this.event_root.getEventType(this.closest_event);
                        switch (ignitable_event)
                        {
                        case Event.TYPE.ROCKET:         // 이벤트의 종류가 ROCKET이면.
                                                        // REPAIRING(수리) 상태로 이행.
                            this.next_step = STEP.REPAIRING;
                            break;
                        }
                        break;
                    }



                    if (this.carried_item != null)
                    {
                        // 가지고 있는 아이템 판별.
                        Item.TYPE carried_item_type =
                            this.item_root.getItemType(this.carried_item);
                        switch (carried_item_type)
                        {
                        case Item.TYPE.APPLE:         // 사과라면.
                            // case Item.TYPE.PLANT: // 식물이라면.
                            // '식사 중' 상태로 이행.
                            this.next_step = STEP.EATING;
                            break;
                        }
                    }
                } while (false);
                break;

            case STEP.EATING:                   // '식사 중' 상태의 처리.
                if (this.step_timer > eat_time)
                {                               // 2초 대기.
                    this.next_step = STEP.MOVE; // '이동' 상태로 이행.
                }
                break;

            case STEP.REPAIRING:                // '수리 중' 상태의 처리.
                if (this.step_timer > repair_time)
                {                               // 2초 대기.
                    this.next_step = STEP.MOVE; // '이동' 상태로 이행.
                }
                break;
            }
        }

        // 상태가 변화했을 때------------.
        while (this.next_step != STEP.NONE)
        { // 상태가 NONE이외 = 상태가 변화했다.
            this.step      = this.next_step;
            this.next_step = STEP.NONE;
            switch (this.step)
            {
            case STEP.MOVE:
                break;

            case STEP.EATING:     // '식사 중' 상태의 처리.
                if (this.carried_item != null)
                {
                    // 들고 있는 아이템의 '체력 회복 정도'를 가져와서 설정.
                    this.game_status.addSatiety(
                        this.item_root.getRegainSatiety(this.carried_item));
                    // 가지고 있던 아이템을 폐기.
                    GameObject.Destroy(this.carried_item);
                    this.carried_item = null;
                }
                break;

            case STEP.REPAIRING:     // '수리 중'이 되면.
                if (this.carried_item != null)
                {
                    // 들고 있는 아이템의 '수리 진척 상태'를 가져와서 설정.
                    this.game_status.addRepairment(
                        this.item_root.getGainRepairment(this.carried_item));
                    // 가지고 있는 아이템 삭제.
                    GameObject.Destroy(this.carried_item);
                    this.carried_item = null;
                    this.closest_item = null;
                }
                break;
            }
            this.step_timer = 0.0f;
        }
        // 각 상황에서 반복할 것----------.
        switch (this.step)
        {
        case STEP.MOVE:
            this.move_control();
            this.pick_or_drop_control();
            // 이동 가능한 경우는 항상 배가 고파진다.
            this.game_status.alwaysSatiety();
            break;

        case STEP.REPAIRING:
            // 우주선을 회전시킨다.
            //this.rocket_model.transform.localRotation *=
            //Quaternion.AngleAxis(360.0f / 10.0f * Time.deltaTime,
            //Vector3.up);
            break;
        }
    }
Exemple #15
0
    // Update is called once per frame
    void Update()
    {
        if (Vector3.Distance(willson.transform.position, transform.position) > 3)
        {
            game_status.addLonely(GameStatus.CONSUME_LONELY_FAR_FROM_WILLSON);
        }
        else
        {
            game_status.addLonely(-GameStatus.CONSUME_LONELY_FAR_FROM_WILLSON);
        }

        if (game_status.getFire)
        {
            _Torch.SetActive(true);
        }
        else
        {
            _Torch.SetActive(false);
        }

        if (carried_item == null)
        {
            animator.SetBool("isCarried", false);
            item_root.itemInfo.sprite = item_root.emptySprite;
        }
        else if (carried_item != null)
        {
            animator.SetBool("isCarried", true);
        }

        this.get_input(); // 입력 정보 취득.
                          // 상태가 변화했을 때------------.

        this.step_timer += Time.deltaTime;
        float eat_time    = 0.5f; // 사과는 2초에 걸쳐 먹는다.
        float repair_time = 2.0f; // 수리에 걸리는 시간도 2초.

        // 상태를 변화시킨다---------------------.
        if (this.next_step == STEP.NONE)
        { // 다음 예정이 없으면.
            switch (this.step)
            {
            case STEP.MOVE:     // '이동 중' 상태의 처리.
                do
                {
                    if (!this.key.action)
                    {          // 액션 키가 눌려있지 않다.
                        break; // 루프 탈출.
                    }
                    // 주목하는 이벤트가 있을 때.
                    if (this.closest_event != null)
                    {
                        if (!this.is_event_ignitable())
                        {          // 이벤트를 시작할 수 없으면.
                            break; // 아무 것도 하지 않는다.
                        }
                        // 이벤트 종류를 가져온다.
                        Event.TYPE ignitable_event =
                            this.event_root.getEventType(this.closest_event);
                        switch (ignitable_event)
                        {
                        case Event.TYPE.ROCKET:         // 이벤트의 종류가 ROCKET이면.
                                                        // REPAIRING(수리) 상태로 이행.
                            this.next_step = STEP.REPAIRING;
                            break;

                        case Event.TYPE.MAKEFIRE:
                            this.next_step = STEP.MAKINGCAMP;
                            break;

                        case Event.TYPE.GETFIRE:
                            this.next_step = STEP.GETTINGFIRE;
                            break;
                        }
                        break;
                    }
                    if (this.carried_item != null)
                    {
                        // 가지고 있는 아이템 판별.
                        Item.TYPE carried_item_type = this.item_root.getItemType(this.carried_item);
                        switch (carried_item_type)
                        {
                        case Item.TYPE.APPLE:         // 사과라면.
                            this.next_step = STEP.EATING;
                            break;

                        case Item.TYPE.PLANT:             // 식물이라면.
                            this.next_step = STEP.EATING; // '식사 중' 상태로 이행.
                            break;
                        }
                    }
                } while (false);
                break;

            case STEP.EATING: // '식사 중' 상태의 처리.
                if (this.step_timer > eat_time)
                {             // 2초 대기.
                    if (SoundManager.instance.myAudio.isPlaying)
                    {
                        SoundManager.instance.myAudio.Stop();
                    }
                    else
                    {
                        SoundManager.instance.eatEFS();
                    }
                    this.next_step = STEP.MOVE;     // '이동' 상태로 이행.
                }
                break;

            case STEP.REPAIRING:                // '수리 중' 상태의 처리.
                if (this.step_timer > repair_time)
                {                               // 2초 대기.
                    this.next_step = STEP.MOVE; // '이동' 상태로 이행.
                }
                break;

            case STEP.MAKINGCAMP:
                this.next_step = STEP.MOVE;
                break;

            case STEP.GETTINGFIRE:
                this.next_step = STEP.MOVE;
                break;

            default:
                break;
            }
        }
        while (this.next_step != STEP.NONE)
        { // 상태가 NONE이외 = 상태가 변화했다.
            this.step      = this.next_step;
            this.next_step = STEP.NONE;
            switch (this.step)
            {
            case STEP.MOVE:
                break;

            case STEP.EATING:     // '식사 중' 상태의 처리.
                if (this.carried_item != null)
                {
                    // 가지고 있던 아이템을 폐기.
                    GameObject.Destroy(this.carried_item);
                    this.game_status.addSatiety(this.item_root.getRegainSatiety(this.carried_item));
                    this.carried_item = null;
                }
                break;

            case STEP.REPAIRING:     // '수리 중'이 되면.
                if (this.carried_item != null)
                {
                    // 들고 있는 아이템의 '수리 진척 상태'를 가져와서 설정.
                    this.game_status.addRepairment(this.item_root.getGainRepairment(this.carried_item));

                    // 가지고 있는 아이템 삭제.
                    GameObject.Destroy(this.carried_item);
                    this.carried_item = null;
                    this.closest_item = null;
                }
                break;

            case STEP.MAKINGCAMP:
                if (this.carried_item != null)
                {
                    GameObject.Destroy(this.carried_item);
                    game_status.fireCount = 3;
                    this.carried_item     = null;
                    this.closest_item     = null;
                }
                break;

            case STEP.GETTINGFIRE:
                if (this.carried_item == null)
                {
                    game_status.fireCount -= 1;
                    game_status.getFire    = true;
                }
                break;
            }
            this.step_timer = 0.0f;
        }
        // 각 상황에서 반복할 것----------.
        switch (this.step)
        {
        case STEP.MOVE:
            this.move_control();
            this.pick_or_drop_control();
            // 이동 가능한 경우는 항상 배가 고파진다.
            this.game_status.alwaysSatiety();
            break;

        case STEP.REPAIRING:
            // 우주선을 회전시킨다.
            animator.SetBool("fix", true);
            if (SoundManager.instance.myAudio.isPlaying)
            {
                SoundManager.instance.myAudio.Stop();
            }
            else
            {
                SoundManager.instance.fixEFS();
            }
            //this.rocket_model.transform.localRotation *=
            //Quaternion.AngleAxis(360.0f / 10.0f * Time.deltaTime,
            //Vector3.up);
            break;
        }
    }
    void Update()
    {
        this.get_input();         // 入力情報を取得
        this.step_timer += Time.deltaTime;
        float eat_time    = 0.5f; // リンゴは、2秒かけて食べる
        float repair_time = 0.5f; // 修理にかかる時間も2秒

        // 状態を変化させる---------------------
        if (this.next_step == STEP.NONE) // 次の予定がないなら
        {
            switch (this.step)
            {
            case STEP.MOVE:     // 「移動中」状態の処理
                do
                {
                    if (!this.key.action) // アクションキーが押されていない
                    {
                        break;            // ループを脱出
                    }
                    // 注目中のイベントがある場合
                    if (this.closest_event != null)
                    {
                        if (!this.is_event_ignitable()) // イベントが開始不可なら
                        {
                            break;                      // 何もしない
                        }
                        // イベントの種類を取得
                        Event.TYPE ignitable_event = this.event_root.getEventType(this.closest_event);

                        switch (ignitable_event)
                        {
                        case Event.TYPE.ROCKET:
                            // イベントの種類がROCKETなら
                            // REPAIRING(種類)状態に移行
                            this.next_step = STEP.REPAIRING;
                            break;
                        }
                        break;
                    }
                    if (this.carried_item != null)
                    {
                        // 持っているアイテムを判別
                        Item.TYPE carried_item_type = this.item_root.getItemType(this.carried_item);

                        switch (carried_item_type)
                        {
                        case Item.TYPE.APPLE:         // リンゴなら
                        case Item.TYPE.PLANT:         // 植物なら
                            // 「食事中」状態に移行
                            this.next_step = STEP.EATING;
                            break;
                        }
                    }
                } while (false);
                break;

            case STEP.EATING:                   // 「食事中」状態の処理
                if (this.step_timer > eat_time) // 2秒待つ
                {
                    this.next_step = STEP.MOVE; // 「移動」状態に移行
                }
                break;

            case STEP.REPAIRING:                   // 「修理中」状態の処理
                if (this.step_timer > repair_time) // 2秒待つ
                {
                    this.next_step = STEP.MOVE;    // 「移動」状態に移行
                }
                break;
            }
        }

        // 状態が変化した場合------------
        while (this.next_step != STEP.NONE) // 状態がNONE以外=状態が変化した
        {
            this.step      = this.next_step;
            this.next_step = STEP.NONE;
            switch (this.step)
            {
            case STEP.MOVE:
                break;

            case STEP.EATING:     // 「食事中」状態の処理
                if (this.carried_item != null)
                {
                    // 持っているアイテムの「お腹の回復具合」を取得し、設定
                    this.game_status.addSatiety(this.item_root.getRegainSatiety(this.carried_item));
                    // 持っていたアイテムを破棄
                    GameObject.Destroy(this.carried_item);
                    this.carried_item = null;
                }
                break;

            case STEP.REPAIRING:     // 「修理中」になったら
                if (this.carried_item != null)
                {
                    // 持っているアイテムの「お腹の回復具合」を取得し、設定
                    this.game_status.addRepairment(this.item_root.getGainRepairment(this.carried_item));
                    // 持っているアイテムを削除
                    GameObject.Destroy(this.carried_item);
                    this.carried_item = null;
                    this.closest_item = null;
                }
                break;
            }
            this.step_timer = 0.0f;
        }

        // 各状態で繰り返しすること------------
        switch (this.step)
        {
        case STEP.MOVE:
            this.move_control();
            this.pick_or_drop_control();
            // 移動可能な場合は常にお腹が減る
            this.game_status.alwaysSatiety();
            break;

        case STEP.REPAIRING:
            // 宇宙船を回転させる
            this.rocket_model.transform.localRotation *= Quaternion.AngleAxis(360.0f / 10.0f * Time.deltaTime, Vector3.up);
            break;
        }
    }
    void Update()
    {
        this.get_input();
        this.step_timer += Time.deltaTime;

        float eat_time    = 1.0f;
        float repair_time = 1.0f;
        float fire_time   = 1.0f;
        float action_time = 0.3f;

        // 변화대기.
        if (this.next_step == STEP.NONE)
        {
            switch (this.step)
            {
            case STEP.MOVE:
                do
                {
                    if (!this.key.action)
                    {
                        break;
                    }

                    if (this.closest_event != null)
                    {
                        if (!this.is_event_ignitable())
                        {
                            break;
                        }
                        Event.TYPE ignitable_event = this.event_root.getEventType(this.closest_event);
                        switch (ignitable_event)
                        {
                        case Event.TYPE.ROCKET:
                            this.next_step = STEP.REPAIRING;
                            break;

                        // fire.
                        case Event.TYPE.FIRE:
                            this.next_step = STEP.FIRE;
                            break;
                        }
                        break;
                    }
                    if (this.carried_item != null)
                    {
                        Item.TYPE carried_item_type = this.item_root.getItemType(this.carried_item);
                        switch (carried_item_type)
                        {
                        case Item.TYPE.APPLE:
                        case Item.TYPE.PLANT:
                            this.next_step = STEP.EATING;
                            break;
                        }
                    }
                } while(false);
                break;

            case STEP.EATING:
                if (this.step_timer > eat_time)
                {
                    this.next_step = STEP.MOVE;
                }
                break;

            case STEP.REPAIRING:
                if (this.step_timer > repair_time)
                {
                    this.next_step = STEP.MOVE;
                }
                break;

            case STEP.FIRE:
                if (this.step_timer > fire_time)
                {
                    this.next_step = STEP.MOVE;
                }
                break;

            case STEP.PICKUP:
                if (this.step_timer > action_time)
                {
                    this.next_step = STEP.MOVE;
                }
                break;

            case STEP.THROW:
                if (this.step_timer > action_time)
                {
                    this.next_step = STEP.MOVE;
                }
                break;

            case STEP.PLANT:
                if (this.step_timer > action_time)
                {
                    this.next_step = STEP.MOVE;
                }
                break;
            }
        }


        // ---------------------------------------------------------------- //
        // 상태가 전환됐을 때의 초기화.
        while (this.next_step != STEP.NONE)
        {
            Debug.Log(next_step);

            this.step      = this.next_step;
            this.next_step = STEP.NONE;
            switch (this.step)
            {
            case STEP.MOVE:

                break;

            case STEP.EATING:
                if (this.carried_item != null)
                {
                    this.game_status.addSatiety(this.item_root.getRegainSatiety(this.carried_item));                            // status

                    GameObject.Destroy(this.carried_item);
                    this.carried_item = null;
                    this.animation.CrossFade("08_eat", 0.1f);                                   //motion
                    this.sound_control.SoundPlay(Sound.SOUND.EAT);                              // sound.
                }
                break;


            case STEP.REPAIRING:
                if (this.carried_item != null)
                {
                    this.game_status.addRepairment(this.item_root.getGainRepairment(this.carried_item));                        // status

                    GameObject.Destroy(this.carried_item);
                    this.carried_item  = null;
                    this.closest_event = null;
                    this.animation.CrossFade("07_repair", 0.1f);                                //motion.
                    //this.sound_control.SoundPlay(Sound.SOUND.RESTORE);			// sound.
                }
                break;

            case STEP.FIRE:
                if (this.carried_item != null)
                {
                    this.game_status.addFire(this.item_root.getRegainFire(this.carried_item));                          // status

                    GameObject.Destroy(this.carried_item);
                    this.carried_item  = null;
                    this.closest_event = null;
                    this.animation.CrossFade("07_repair", 0.1f);                                //motion.
                    this.sound_control.SoundPlay(Sound.SOUND.BURN);                             // sound.
                }
                break;


            case STEP.PICKUP:
                this.animation.CrossFade("09_pickup", 0.1f);                            //motion.
                break;

            case STEP.THROW:
                this.animation.CrossFade("10_put", 0.1f);                               //motion.
                break;

            case STEP.PLANT:
                this.animation.CrossFade("10_put", 0.1f);                               //motion.
                break;

            case STEP.DEAD:
                this.animation.CrossFade("05_died", 0.1f);                              //motion.
                this.sound_control.SoundPlay(Sound.SOUND.VO_MISS);
                break;

            case STEP.CLEAR:
                this.animation.CrossFade("09_pickup", 0.1f);                            //motion.
                break;
            }
            this.step_timer = 0.0f;
        }


        // ---------------------------------------------------------------- //
        // 각 상태에서의 실행 처리.
        switch (this.step)
        {
        case STEP.MOVE:
            this.move_control();
            this.pick_or_drop_control();
            this.game_status.alwaysSatiety();                           // 아무것도 하지 않아도 배가 고프다.

            break;

        case STEP.REPAIRING:
            // this.rocket_model.transform.localRotation *= Quaternion.AngleAxis(360.0f/10.0f*Time.deltaTime, Vector3.up);

            // se-.
            this.se_repair_count += Time.deltaTime;
            if (this.se_repair_count > SE_REPAIR_TIMING)
            {
                this.se_repair_count = 0.0f;
                this.sound_control.SoundPlay(Sound.SOUND.RESTORE);
            }

            // effect--.
            this.count_repair_eff += Time.deltaTime;
            if (this.count_repair_eff > REPAIR_EFF_TIMING)
            {
                this.count_repair_eff = 0.0f;
                this.effect_control.repairEffect(GameObject.Find("tonkachi").transform.position);
            }

            break;

        case STEP.DEAD:
            if (this.vo_miss_flag)
            {
                if (this.step_timer >= 1.0f)
                {
                    this.sound_control.SoundPlay(Sound.SOUND.MISS_JINGLE);
                    this.vo_miss_flag = false;
                    Debug.Log("miss");
                }
            }
            break;
        }

        // 멋대로 빙글빙들 돌지 않도록 회전 속도를 강제로 0으로 한다.
        this.rigidbody.angularVelocity = Vector3.zero;
    }
    // 입력 정보를 가져오고 상태에 변화가 있을 때의 처리를 거쳐 각 상태별로 실행.
    void Update()
    {
        this.get_input(); // 상호작용 키 입력 정보 취득.
        playerMove.MoveUpdate();

        this.step_timer += Time.deltaTime;
        float eat_time    = 2.0f; // 사과는 2초에 걸쳐 먹는다.
        float repair_time = 2.0f; // 수리에 걸리는 시간도 2초.

        // 상태를 변화시킨다---------------------.
        if (this.next_step == STEP.NONE)
        { // 다음 예정이 없으면.
            switch (this.step)
            {
            case STEP.MOVE:     // '이동 중' 상태의 처리.
                do
                {
                    if (!this.key.action)
                    {          // 액션 키가 눌려있지 않다.
                        break; // 루프 탈출.
                    }
                    // 주목하는 이벤트가 있을 때.
                    if (this.closest_event != null)
                    {
                        if (!this.is_event_ignitable())
                        {          // 이벤트를 시작할 수 없으면.
                            break; // 아무 것도 하지 않는다.
                        }
                        // 이벤트 종류를 가져온다.
                        Event.TYPE ignitable_event = this.event_root.getEventType(this.closest_event);
                        switch (ignitable_event)
                        {
                        case Event.TYPE.ROCKET:         // 이벤트의 종류가 ROCKET이면.
                                                        // REPAIRING(수리) 상태로 이행.
                            this.next_step = STEP.REPAIRING;
                            break;
                        }
                        break;
                    }

                    if (this.carried_item != null)
                    {
                        // 가지고 있는 아이템 판별.
                        TYPE carried_item_type = this.item_root.getItemType(this.carried_item);
                        switch (carried_item_type)
                        {
                        case TYPE.APPLE:         // 사과라면.
                        case TYPE.PLANT:         // 식물이라면.
                                                 // '식사 중' 상태로 이행.
                            this.next_step = STEP.EATING;
                            break;
                        }
                    }
                } while (false);
                break;

            case STEP.EATING:     // '식사 중' 상태의 처리.
                if (this.step_timer > eat_time)
                {
                    // 2초 대기.
                    this.next_step = STEP.MOVE;     // '이동' 상태로 이행.
                }
                break;
            }
        }
        // 상태가 변화했을 때------------.
        while (this.next_step != STEP.NONE)
        {
            this.step      = this.next_step;
            this.next_step = STEP.NONE;
            switch (this.step)
            {
            case STEP.MOVE:
                break;

            case STEP.EATING:     // '식사 중' 상태의 처리.
                if (this.carried_item != null)
                {
                    // 가지고 있던 아이템을 폐기.
                    GameObject.Destroy(this.carried_item);
                    this.carried_item = null;
                }
                break;
            }
            this.step_timer = 0.0f;
        }

        // 각 상황에서 반복할 것----------.
        switch (this.step)
        {
        case STEP.MOVE:
            playerMove.MoveFixedUpdate();
            this.pick_or_drop_control();
            Sell();
            Seed();     // ui 버튼으로
            Harvest();
            SaveLumber();
            Sleep();
            Watering();

            // 이동 가능한 경우는 항상 배가 고파진다.
            //this.game_status.alwaysSatiety();
            break;
        }
    }