コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        float lightLevel = FindObjectOfType <GlobalLightChecker>().GetTotalLightLevel(transform);

        if ((!mCrying && lightLevel >= 1.5f) || (!mCrying && mGoCryHackSwitch))
        {
            mCrying = true;
            mMyActionList.ClearSequence();
            GetComponent <ExPathFollower>().enabled = false;
            StartCoroutine("GoCry");

            var text = "ScareAway";
            var box  = FFMessageBoard <CustomDialogOn> .Box((string)text);

            CustomDialogOn cdo;
            cdo.tag = (string)text;
            box.SendToLocal(cdo);
        }
        else if ((mCrying && GameMath.DistanceBetween(this, mCryingPlace) <= 3.0f && lightLevel >= 2.5f) || mBeCuredHackSwitch)
        {
            var text = "Rescue";
            var box  = FFMessageBoard <CustomDialogOn> .Box((string)text);

            CustomDialogOn cdo;
            cdo.tag = (string)text;
            box.SendToLocal(cdo);


            // Become human?
            Destroy(this);
        }
    }
コード例 #2
0
    void SendCustomDialogEvent(object text)
    {
        var box = FFMessageBoard <CustomDialogOn> .Box((string)text);

        CustomDialogOn cdo;

        cdo.tag = (string)text;
        box.SendToLocal(cdo);
    }
コード例 #3
0
    void AddDialog(CharacterDialog.Dialog dialog)
    {
        gameDialog.Add(dialog);

        foreach (var cond in dialog.condition)
        {
            if (cond.type == CharacterDialog.Dialog.Condition.Type.Custom)
            {
                FFMessageBoard <CustomDialogOn> .Box(cond.identifier).Connect(OnCustomDialogOn);

                FFMessageBoard <CustomDialogOff> .Box(cond.identifier).Connect(OnCustomDialogOff);
            }
        }
    }