public override void speak(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
     if (mAnimating)
     {
         return;
     }
     shake();
 }
示例#2
0
 public override bool canReply(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
     if (mSpeakDefault != "")
     {
         return(true);
     }
     return(getAnswerKey(aCharacter) != "");
 }
示例#3
0
    public override void speak(MapCharacter aCharacter, MapEventSystem aEventSystem)
    {
        string mAnswerKey = getAnswerKey(aCharacter);

        if (mAnswerKey == "")
        {
            return;
        }
        aEventSystem.addEvent(mAnswerKey, aCharacter, mBehaviour, mCollider);
    }
 /// <summary>trigger内で移動した</summary>
 public override void moved(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
     if (!isTriggerCharacter(aCharacter))
     {
         return;
     }
     if (mMovedKey == "" || mMovedKey == null)
     {
         return;
     }
     aEventSystem.addEvent(mMovedKey, aCharacter, mBehaviour, mCollider);
 }
 /// <summary>話しかけるor調べる処理</summary>
 static public void speak(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
     foreach (MapSpeaker tSpeaker in getTargetSpeakers(aCharacter))
     {
         //応答不可
         if (!tSpeaker.canReply(aCharacter, aEventSystem))
         {
             continue;
         }
         tSpeaker.speak(aCharacter, aEventSystem);
         return;
     }
 }
    /// <summary>衝突したtriggerを発火させる</summary>
    static public void trigger(MapCharacter aEntity, MapEventSystem aEventSystem)
    {
        bool tMoved = aEntity.mMovingData.mPrePosition != aEntity.mMapPosition;
        List <MapTrigger> tCollidedTriggers = getCollidedTriggers(aEntity);

        foreach (MapTrigger tTrigger in tCollidedTriggers)
        {
            int  tCount = aEntity.mMovingData.mCollidedTriggers.Count;
            bool tFind  = false;
            for (int i = 0; i < tCount; ++i)
            {
                if (aEntity.mMovingData.mCollidedTriggers[i] != tTrigger)
                {
                    continue;
                }

                if (tMoved)
                {
                    tTrigger.moved(aEntity, aEventSystem);        //内部移動
                }
                else
                {
                    tTrigger.stay(aEntity, aEventSystem); //内部停止
                }
                aEntity.mMovingData.mCollidedTriggers.RemoveAt(i);
                tFind = true;
                break;
            }
            if (tFind)
            {
                continue;
            }
            tTrigger.enter(aEntity, aEventSystem);//侵入
        }
        foreach (MapTrigger tTrigger in aEntity.mMovingData.mCollidedTriggers)
        {
            tTrigger.exit(aEntity, aEventSystem);//撤退
        }
        aEntity.mMovingData.mCollidedTriggers = tCollidedTriggers;
    }
 public override bool canReply(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
     return(!mAnimating);
 }
示例#8
0
 /// <summary>
 /// 話かけた
 /// </summary>
 /// <param name="aCharacter">このbehaviourに話かけるキャラ</param>
 public virtual void speak(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
 }
示例#9
0
 /// <summary>
 /// 話かけられた時に返答できるか
 /// </summary>
 /// <returns>trueなら返答可能</returns>
 /// <param name="aCharacter">このbehaviourに話かけるキャラ</param>
 public virtual bool canReply(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
     return(true);
 }
 public override void enter(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
     mTarget.rotateZBy(360, 1.5f);
 }
示例#11
0
 /// <summary>triggerから出て行った</summary>
 public virtual void exit(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
 }
示例#12
0
 /// <summary>trigger内で移動した</summary>
 public virtual void moved(MapCharacter aCharacter, MapEventSystem aEventSystem)
 {
 }
示例#13
0
 public void RegisterMapEvent()
 {
     m_mapEventSys  = new MapEventSystem(m_map);
     m_normalSystem = new MapNormalSystem(m_map);
 }
 public Operator(MapEventSystem aParent, MapEvent aEvent)
 {
     parent     = aParent;
     mRootEvent = aEvent;
 }