Beispiel #1
0
 //从黑板上Actor数据的字典中获取Actor数据
 public Actor GetBlackBoardActor(string actorStr)
 {
     SM.BlackBoardActorData blackBoardActorData = mDicBlackActor[actorStr];
     SM.SceneRoom           room = SM.RandomRoomLevel.Singleton.LookupRoom(blackBoardActorData.roomID);
     if (null != room)
     {
         if (blackBoardActorData.mBlackActorType == BlackActorType.enNPC)
         {
             return(room.GetMonster(blackBoardActorData.actorID));
         }
         else if (blackBoardActorData.mBlackActorType == BlackActorType.enBox)
         {
             return(room.GetTreatureByID(blackBoardActorData.actorID));
         }
     }
     return(null);
 }
Beispiel #2
0
    public override void Tick()
    {
        base.Tick();
        SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
        if (null != room)
        {
            bool tmpIsEnabled = true;
            foreach (var mosterData in mDeadMonsterList)
            {
//                 if (!room.IsMonsterDead(mosterData.actorId))
//                 {
//                     return;
//                 }
                Actor tmpActor = null;// room.GetMonsterByID(mosterData.actorId);
                switch (mosterData.actorType)
                {
                case ENDeadActorType.enMainPlayer:
                    tmpActor = ActorManager.Singleton.MainActor;
                    break;

                case ENDeadActorType.enSpicalNpc:
                    tmpActor = room.GetMonster(mosterData.actorId);
                    break;

                default:
                    break;
                }

                bool tmpActorIsDead = false;
                if (tmpActor == null)
                {
                    SM.ActorRefresh actorRefuresh = room.GetActorRefreshById(mosterData.actorId);
                    if (actorRefuresh == null)
                    {
                        tmpActorIsDead = true;
                    }
                }
                else if (tmpActor.IsRealDead)
                {
                    tmpActorIsDead = true;
                }
                if (tmpActorIsDead)
                {
                    if (!mDeadOrderList.Contains(mosterData.actorId))
                    {
                        mDeadOrderList.Add(mosterData.actorId);
                    }
                }
                else
                {
                    tmpIsEnabled = false;
                    break;
                }
            }
            if (tmpIsEnabled)
            {
                SM.BlackBoardActorData tmpActorData = new SM.BlackBoardActorData();
                tmpActorData.roomID          = RoomId;
                tmpActorData.actorID         = mDeadOrderList[mDeadOrderList.Count - 1];
                tmpActorData.mBlackActorType = LevelBlackboard.BlackActorType.enNPC;
                mCurActor = tmpActorData;// mDeadOrderList[mDeadOrderList.Count - 1];
                IsEnabled = true;
            }
        }
    }