コード例 #1
0
ファイル: ObjectManager.cs プロジェクト: Kelicia91/Sugarism
    //
    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);
    }
コード例 #2
0
ファイル: StoryMode.cs プロジェクト: Kelicia91/Sugarism
        // constructor
        public Mode(TargetCharacter targetCharacter)
        {
            // json settings
            JSON_SETTINGS = new Newtonsoft.Json.JsonSerializerSettings();
            JSON_SETTINGS.TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Auto;

            //
            _targetCharacter = targetCharacter;

            _scenario = null;
            _caseKey = -1;

            // events
            _cmdLinesEvent = new CmdLinesEvent();
            _cmdTextEvent = new CmdTextEvent();
            _cmdAppearEvent = new CmdAppearEvent();
            _cmdBackgroundEvent = new CmdBackgroundEvent();
            _cmdMiniPictureEvent = new CmdMiniPictureEvent();
            _cmdPictureEvent = new CmdPictureEvent();
            _cmdFilterEvent = new CmdFilterEvent();
            _cmdSEEvent = new CmdSEEvent();
            _cmdFeelingEvent = new CmdFeelingEvent();
            _cmdSwitchEvent = new CmdSwitchEvent();
            _cmdTargetAppearEvent = new CmdTargetAppearEvent();
            _cmdDisappearEvent = new CmdDisappearEvent();

            _scenarioStartEvent = new ScenarioStartEvent();
            _scenarioEndEvent = new ScenarioEndEvent();

            _selectTargetEvent = new SelectTargetEvent();

            //
            if (null != TargetCharacter)
                TargetCharacter.AttachTo(CmdFeelingEvent);
        }
コード例 #3
0
ファイル: ObjectManager.cs プロジェクト: Kelicia91/Sugarism
    private Story.TargetCharacter loadTargetCharacter()
    {
        int targetId = CustomPlayerPrefs.GetInt(PlayerPrefsKey.TARGET, -1);

        if (-1 == targetId)
        {
            Log.Debug("not found target -> startPrologue.");
            return(null);
        }

        int feeling = CustomPlayerPrefs.GetInt(PlayerPrefsKey.FEELING, -1);

        if (feeling < 0)
        {
            Log.Error(string.Format("not found '{0}'", PlayerPrefsKey.FEELING));
            return(null);
        }

        int lastOpenedScenarioNo = CustomPlayerPrefs.GetInt(PlayerPrefsKey.LAST_OPENED_SCENARIO_NO, -10);

        if (-10 == lastOpenedScenarioNo)
        {
            Log.Error(string.Format("not found '{0}'", PlayerPrefsKey.LAST_OPENED_SCENARIO_NO));
            return(null);
        }

        Story.TargetCharacter tc = new Story.TargetCharacter(targetId, feeling, lastOpenedScenarioNo);
        return(tc);
    }
コード例 #4
0
ファイル: ObjectManager.cs プロジェクト: Kelicia91/Sugarism
    private void startTargetPrologue(Story.TargetCharacter targetCharacter)
    {
        string path = string.Format("{0}{1}", targetCharacter.ScenarioDirPath, RsrcLoader.PROLOGUE_FILENAME);

        StoryMode.LoadScenario(path);
        StoryMode.ScenarioEndEvent.Attach(onTargetPrologueEnd);
    }
コード例 #5
0
ファイル: StoryMode.cs プロジェクト: Kelicia91/Sugarism
        public void Set(TargetCharacter targetCharacter)
        {
            if (null == targetCharacter)
            {
                Log.Error("not found target character");
                return;
            }

            _targetCharacter = targetCharacter;
            _targetCharacter.AttachTo(CmdFeelingEvent);
        }
コード例 #6
0
ファイル: ObjectManager.cs プロジェクト: Kelicia91/Sugarism
    private void startNextScenario()
    {
        Story.TargetCharacter target = StoryMode.TargetCharacter;

        bool isLoaded = StoryMode.LoadScenario(target.NextScenarioPath);

        if (false == isLoaded)
        {
            return;
        }
    }
コード例 #7
0
ファイル: ObjectManager.cs プロジェクト: Kelicia91/Sugarism
    public void CreateTargetCharacter(int targetId)
    {
        if (false == ExtTarget.isValid(targetId))
        {
            Log.Error(string.Format("invalid target id; {0}", targetId));
            return;
        }

        CustomPlayerPrefs.SetInt(PlayerPrefsKey.TARGET, targetId);
        Story.TargetCharacter tc = loadTargetCharacter();
        StoryMode.Set(tc);

        startTargetPrologue(tc);
    }
コード例 #8
0
ファイル: ObjectManager.cs プロジェクト: Kelicia91/Sugarism
    private void onScenarioEnd()
    {
        if (false == _isStartTargetScenario)
        {
            return;
        }

        _isStartTargetScenario = false;

        Story.TargetCharacter target = StoryMode.TargetCharacter;
        target.NextScenarioNo();

        CustomPlayerPrefs.SetInt(PlayerPrefsKey.FEELING, target.Feeling);
        CustomPlayerPrefs.SetInt(PlayerPrefsKey.LAST_OPENED_SCENARIO_NO, target.LastOpenedScenarioNo);
    }
コード例 #9
0
    //
    void Start()
    {
        const int PERCENT_MIN = 0;
        const int PERCENT_MAX = 100;

        FeelingPanel.SetMinMax(PERCENT_MIN, PERCENT_MAX);
        FeelingPanel.SetNameText(Def.CMD_FEELING_CHECK);

        ProgressPanel.SetMinMax(PERCENT_MIN, PERCENT_MAX);
        ProgressPanel.SetNameText(Def.PROGRESS);

        Story.TargetCharacter tc = Manager.Instance.Object.StoryMode.TargetCharacter;

        Target t = Manager.Instance.DT.Target[tc.Id];

        TargetPanel.Set(tc.Id, false, Sugarism.EFace.Default, Sugarism.ECostume.Default, Sugarism.EPosition.Middle);

        setFeeling(tc.Feeling);
        setProgress(tc.LastOpenedScenarioNo);

        tc.FeelingChangeEvent.Attach(onFeelingChanged);
        tc.LastOpenedScenarioNoChangeEvent.Attach(onLastOpenedScenarioNoChanged);
    }