示例#1
0
    protected override void MStart()
    {
        base.MStart();
        m_agent.enabled = true;
        NextTarget();

        LogicManager.Instance.RegisterStateChange(delegate(LogicManager.GameState fromState, LogicManager.GameState toState) {
            if (toState == LogicManager.GameState.BeginShip && shipTalkTotal < 5)
            {
                Vector3 toward = (MainCharacter.Instance.transform.position - transform.position);
                if (toward.magnitude < 20f && Vector3.Dot(toward, Camera.main.transform.forward) > 0.1f)
                {
                    NarrativePlotScriptableObject shipCome = (NarrativePlotScriptableObject)Resources.Load("NarrativeDyn/ShipComes");
                    Sequence seq = DOTween.Sequence();
                    seq.AppendInterval(Random.Range(0, 5f));
                    seq.OnComplete(delegate() {
                        DisplayDialog(shipCome);
                    });
                }
                shipTalkTotal++;
            }

//			if ( toState == LogicManager.GameState.BeginShip && m_AISetting.type == Type.Unfriendly)
//			{
//				NarrativePlotScriptableObject plot1 = (NarrativePlotScriptableObject)Resources.Load("NarrativeDyn/FindGrilNarrative1");
//				NarrativePlotScriptableObject plot2 = (NarrativePlotScriptableObject)Resources.Load("NarrativeDyn/FindGrilNarrative2");
//				subPlots = new NarrativePlotScriptableObject[2];
//				subPlots[0] = plot1;
//				subPlots[1] = plot2;
//			}
        });
    }
示例#2
0
 public DisplayPlot(NarrativePlotScriptableObject _plot, AudioSource _other, TalkableCharacter _char)
 {
     index        = 0;
     plot         = _plot;
     otherSpeaker = _other;
     character    = _char;
 }
示例#3
0
    void OnDisplayDialog(LogicArg arg)
    {
        NarrativePlotScriptableObject tem_Plot = (NarrativePlotScriptableObject)arg.GetMessage(M_Event.EVENT_DISPLAY_DIALOG_PLOT);
        MonoBehaviour     other        = (MonoBehaviour)arg.sender;
        AudioSource       otherSpeaker = AddSpeaker(other.gameObject);
        TalkableCharacter sender       = (TalkableCharacter)arg.sender;

        if (tem_Plot != null)
        {
            if (!tem_Plot.important)
            {
                if (tem_Plot.dialogs != null && tem_Plot.dialogs.Count > 0)
                {
                    DisplayUnimportantDialog(tem_Plot.dialogs [0], new DisplayPlot(tem_Plot, otherSpeaker, sender));
                }
            }
            else
            {
                PlotArray.Add(new DisplayPlot(tem_Plot, otherSpeaker, sender));
                if (!IsDisplaying)
                {
                    NextDialog();
                }
            }
        }
    }
示例#4
0
    void OnDisplay(LogicArg arg)
    {
        TalkableCharacter             character = (TalkableCharacter)arg.sender;
        NarrativePlotScriptableObject plot      = (NarrativePlotScriptableObject)arg.GetMessage(M_Event.EVENT_DISPLAY_DIALOG_PLOT);

        if (plot.important)
        {
            if (character != null && character.NeedMoveCamera())
            {
                character.MoveCamera(m_MainCamera);
                cameraBot.enabled = false;
                Moveable          = false;
                m_isDisplay       = true;
            }
            else
            {
                if (plot != null && plot.lockCamera)
                {
                    Moveable               = false;
                    m_isDisplay            = true;
                    CameraNarrativeSensity = 0.03f;
                }
            }
        }
//		m_UseHeadBob = false;
//		m_Move = false;
//		m_CanJump = false;
    }
示例#5
0
    protected override void DisplayDialog(NarrativePlotScriptableObject plot)
    {
        base.DisplayDialog(plot);

        if (plot != null && plot.important)
        {
            LockMove();
        }
    }
示例#6
0
 protected override void DisplayDialog(NarrativePlotScriptableObject plot)
 {
     base.DisplayDialog(plot);
     if (plot != null)
     {
         if (plot.important)
         {
             m_realTalking = true;
         }
     }
 }
    virtual protected void DisplayDialog(NarrativePlotScriptableObject plot)
    {
        if (plot != null && plot.dialogs != null && plot.dialogs.Count > 0)
        {
            if (plot.dialogs.Count > 1)
            {
                plot.important = true;
            }

            // display dialog
            LogicArg arg = new LogicArg(this);
            arg.AddMessage(M_Event.EVENT_DISPLAY_DIALOG_PLOT, plot);
            M_Event.FireLogicEvent(LogicEvents.DisplayDialog, arg);

            // switch to talking if the plot is important
            if (plot.important)
            {
                IsTalking = true;
            }
        }
    }