Exemple #1
0
    public void E_Chest(S_A_Chest Ch_)
    {
        if (_Task != null)
        {
            S_Task_Element SE = _Task.GetSubTask(_Task.CouldSubTask() - 1);
            if (Ch_._ID == SE._Chest._ID)
            {
                SE._Could--;
            }
            else
            {
                _Task.Failed();
            }

            if (SE._Could <= 0)
            {
                _Task.DeleteTask(_Task.CouldSubTask() - 1);
            }
        }
    }
Exemple #2
0
    IEnumerator IE_TASK()
    {
        _IS_IE_TASK = true;

        yield return(new WaitForSeconds(Random.Range(1, 5)));

        _Task = S_Task.GetRandomTask();

        if (_ControllContainer != null)
        {
            _ControllContainer.StartWork();
        }

        yield return(new WaitForSeconds(1));

        while (_Task.CouldSubTask() > 0 && !_Task.IsFailed() && !_Room.IS_FINISH())
        {
            _Task.TimerAdd(-0.5f);
            if (_Task.GetTimer() <= 0)
            {
                _Task.Failed();
            }


            yield return(new WaitForSeconds(0.5f));
        }

        yield return(new WaitForSeconds(0.5f));

        if (_ControllContainer != null)
        {
            _ControllContainer.PreEndWork();
        }

        if (!_Room.IS_FINISH())
        {
            _Room.ScoreEvent().Event_Task_Finish(_Task.IsFailed(), _Task.GetReward());
        }

        _Task = null;
        yield return(new WaitForSeconds(2f));

        if (_ControllContainer != null)
        {
            _ControllContainer.EndWork();
        }

        yield return(new WaitForSeconds(Random.Range(1, 10)));


        _IS_IE_TASK = false;
    }
Exemple #3
0
    private void Update()
    {
        if (_TaskSource_M != null)
        {
            S_Task ST = _TaskSource_M.GetTask();
            if (ST != null)
            {
                if (ST.TimeEnding())
                {
                    SET_CONT_ACT(true);
                    _Sprite_Timer.fillAmount = ST.TimerEndingStatus();
                }
                else
                {
                    SET_CONT_ACT(false);
                }


                _Anim.SetBool(ANIM_ID_Failed, ST.IsFailed());

                int CouldSub = ST.CouldSubTask();
                _Anim.SetInteger(ANIM_ID_COULD, CouldSub);

                if (CouldSub > 0)
                {
                    _Task_E1.SetTask(ST.GetSubTask(0));
                }
                if (CouldSub > 1)
                {
                    _Task_E2.SetTask(ST.GetSubTask(1));
                }
                if (CouldSub > 2)
                {
                    _Task_E3.SetTask(ST.GetSubTask(2));
                }

                return;
            }

            _Anim.SetInteger(ANIM_ID_COULD, 0);
            SET_CONT_ACT(false);
            return;
        }



        _Anim.SetInteger(ANIM_ID_COULD, 0);
        SET_CONT_ACT(false);
    }