Beispiel #1
0
    public override bool Execute()
    {
//        if (IsEnabled)
        {
            //刷新怪物
            //SM.ActorRefresh.RefreshCondDict.Add(mConditionID, true);
            SM.SceneRoom room = SM.RandomRoomLevel.Singleton.LookupRoom(RoomGUID);
            foreach (var refreshData in mRefreshMosterDataList)
            {
                SM.ActorRefresh actorRefuresh = room.GetActorRefreshById(refreshData.mMonsterId);
                if (actorRefuresh == null)
                {
                    continue;
                }
                actorRefuresh.SpawnMe();

                Actor sourceActor = null;
                switch (refreshData.mSwapPosType)
                {
                case ENSwapPosType.PlayerPositionOffset:
                    sourceActor = ActorManager.Singleton.MainActor;
                    break;

                case ENSwapPosType.triggerPositionOffset:
                    sourceActor = BattleArena.Singleton.m_blackBoard.GetBlackBoardActor("CurActor");
                    break;

                case ENSwapPosType.TargetActorOfTriggeringActor:
                    sourceActor = BattleArena.Singleton.m_blackBoard.GetBlackBoardActor("TargetActor");
                    break;

                case ENSwapPosType.CustomBlackboardStr:
                    sourceActor = BattleArena.Singleton.m_blackBoard.GetBlackBoardActor(refreshData.mBlackBoardActorStr);
                    break;

                case ENSwapPosType.ObjectPositionOffset:
                    sourceActor = room.GetMonsterByID(refreshData.mSwapActorId);
                    break;

                default:
                    break;
                }
                //Vector3 basePos = sourceActor.RealPos;// GetSwapBasePos(refreshData.mSwapPosType, refreshData.mSwapActorId, refreshData.mBlackBoardActorStr);
                if (sourceActor != null)
                {
                    Vector3 movePos = Vector3.zero;
                    movePos = sourceActor.RealPos + new Vector3(refreshData.mSwapPosX, 0, refreshData.mSwapPosZ);
                    actorRefuresh.m_curMonsterObj.ForceMoveToPosition(movePos);
                }
            }
        }
        return(base.Execute());
    }
Beispiel #2
0
    public Actor GetSpecialNPC(int actorId)
    {
        SM.SceneRoom curRoom = SM.RandomRoomLevel.Singleton.LookupRoom(RoomId);
        if (curRoom == null)
        {
            return(null);
        }
        Actor sourceActor = curRoom.GetMonsterByID(actorId);

        if (sourceActor == null)
        {
            return(null);
        }
        return(sourceActor);
    }