Beispiel #1
0
    //
    void Awake()
    {
        // load
        Nurture.Calendar calendar = loadCalendar();

        _mainCharacter = loadMainCharacter(calendar);
        loadAllStat(_mainCharacter);

        Story.TargetCharacter targetCharacter = loadTargetCharacter();

        // story
        _storyMode = new Story.Mode(targetCharacter);

        // nurture
        _nurtureMode = new Nurture.Mode(calendar, _mainCharacter);

        // board game
        _boardGameMode = new BoardGame.BoardGameMode();

        // combat
        _combatMode = new Combat.CombatMode();

        // events
        _endNurtureEvent = new EndNurtureEvent();

        // attach handler
        NurtureMode.Schedule.EndEvent.Attach(onScheduleEnd);
    }
Beispiel #2
0
    void Awake()
    {
        if (null != PrefCalendarPanel)
        {
            GameObject o = Instantiate(PrefCalendarPanel);
            o.transform.SetParent(transform, false);
            o.transform.SetAsFirstSibling();
        }
        else
        {
            Log.Error("not found prefab calendar panel");
        }

        _statPanelList = new List <StatPanel>();
        for (int i = 0; i < DEFAULT_NUM_STAT_PANEL; ++i)
        {
            GameObject o = Instantiate(PrefStatPanel);
            o.transform.SetParent(StatsPanel.transform, false);

            StatPanel p = o.GetComponent <StatPanel>();
            _statPanelList.Add(p);
        }

        _backgroundImage = GetComponent <Image>();
        _animController  = AnimImage.GetComponent <RunScheduleAnimController>();

        _schedule = Manager.Instance.Object.NurtureMode.Schedule;
        _schedule.ActionCancelEvent.Attach(onActionCancel);
        _schedule.ActionStartEvent.Attach(onActionStart);
        _schedule.ActionFirstEvent.Attach(onActionFirst);
        _schedule.ActionFirstEvent.Attach(onActionFirstNPC);
        _schedule.ActionDoEvent.Attach(onActionDo);
        _schedule.ActionDoEvent.Attach(onActionDoResult);
        _schedule.ActionBeforeEndEvent.Attach(onActionBeforeEnd);
        _schedule.ActionBeforeEndEvent.Attach(onActionBeforeEndExam);
        _schedule.ActionEndEvent.Attach(onActionEnd);
        _schedule.ActionEndEvent.Attach(onActionEndAchievement);

        Nurture.Mode nurtureMode = Manager.Instance.Object.NurtureMode;
        nurtureMode.Schedule.StartEvent.Attach(onScheduleStart);
        nurtureMode.Schedule.EndEvent.Attach(onScheduleEnd);
    }