Ejemplo n.º 1
0
        protected override void OnEnter(NodeData wData)
        {
            EntityWorkData workData  = wData as EntityWorkData;
            MapSensorData  mapSensor = ECSLayerLocate.Info.GetWorldInfo <MapSensorData>(WorldInfoKey.MapInfo);

            //发送请求
            ParamData paramData = workData.GetReqParam(EntityReqId.EnemySeekPlayer);

            paramData.SetVect2Int(mapSensor.PlayerMapPos);
            ECSLayerLocate.Request.PushEntityRequest(workData.MEntity.GetHashCode(), EntityReqId.EnemySeekPlayer);
        }
Ejemplo n.º 2
0
        public override bool OnMakeTrue(NodeData wData)
        {
            EntityWorkData workData    = wData as EntityWorkData;
            EnemyCom       enemyCom    = workData.MEntity.GetCom <EnemyCom>();
            SeekPathCom    seekPathCom = workData.MEntity.GetCom <SeekPathCom>();

            MapSensorData mapSensor = ECSLayerLocate.Info.GetWorldInfo <MapSensorData>(WorldInfoKey.MapInfo);

            bool value = MapHelp.CheckPointInArea(seekPathCom.CurrPos, enemyCom.GuardArea, mapSensor.PlayerMapPos);

            return(value);
        }