public override void speak(MapCharacter aCharacter, MapEventSystem aEventSystem) { if (mAnimating) { return; } shake(); }
public override bool canReply(MapCharacter aCharacter, MapEventSystem aEventSystem) { if (mSpeakDefault != "") { return(true); } return(getAnswerKey(aCharacter) != ""); }
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); }
/// <summary> /// 話かけた /// </summary> /// <param name="aCharacter">このbehaviourに話かけるキャラ</param> public virtual void speak(MapCharacter aCharacter, MapEventSystem aEventSystem) { }
/// <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); }
/// <summary>triggerから出て行った</summary> public virtual void exit(MapCharacter aCharacter, MapEventSystem aEventSystem) { }
/// <summary>trigger内で移動した</summary> public virtual void moved(MapCharacter aCharacter, MapEventSystem aEventSystem) { }
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; }