private void clickGoToBuilding(UIComponent component, UIMouseEventParameter eventParam)
        {
            ushort   buildingId = Convert.ToUInt16(_goToField.text);
            Building building   = Singleton <BuildingManager> .instance.m_buildings.m_buffer[buildingId];

            if ((building.m_flags & Building.Flags.Created) != 0)
            {
                CameraCtrl.GoToBuilding(buildingId, new Vector3(building.m_position.x, Camera.main.transform.position.y, building.m_position.z));

                for (int index = 0; index < BuildingManager.BUILDINGGRID_RESOLUTION * BuildingManager.BUILDINGGRID_RESOLUTION; ++index)
                {
                    ushort bid = Singleton <BuildingManager> .instance.m_buildingGrid[index];
                    while (bid != 0)
                    {
                        if (bid == buildingId)
                        {
                            int i = index / BuildingManager.BUILDINGGRID_RESOLUTION;
                            int j = index % BuildingManager.BUILDINGGRID_RESOLUTION;
                            Log._Debug($"Found building {buildingId} in building grid @ {index}. i={i}, j={j}");
                        }
                        bid = Singleton <BuildingManager> .instance.m_buildings.m_buffer[bid].m_nextGridBuilding;
                    }
                }
            }
        }
示例#2
0
        private void clickGoToNode(UIComponent component, UIMouseEventParameter eventParam)
        {
            ushort nodeId = Convert.ToUInt16(_goToField.text);

            if ((Singleton <NetManager> .instance.m_nodes.m_buffer[nodeId].m_flags & NetNode.Flags.Created) != NetNode.Flags.None)
            {
                CameraCtrl.GoToNode(nodeId, new Vector3(Singleton <NetManager> .instance.m_nodes.m_buffer[nodeId].m_position.x, Camera.main.transform.position.y, Singleton <NetManager> .instance.m_nodes.m_buffer[nodeId].m_position.z));
            }
        }
示例#3
0
        private void clickGoToSegment(UIComponent component, UIMouseEventParameter eventParam)
        {
            ushort segmentId = Convert.ToUInt16(_goToField.text);

            if ((Singleton <NetManager> .instance.m_segments.m_buffer[segmentId].m_flags & NetSegment.Flags.Created) != NetSegment.Flags.None)
            {
                CameraCtrl.GoToSegment(segmentId, new Vector3(Singleton <NetManager> .instance.m_segments.m_buffer[segmentId].m_bounds.center.x, Camera.main.transform.position.y, Singleton <NetManager> .instance.m_segments.m_buffer[segmentId].m_bounds.center.z));
            }
        }
        private void clickGoToVehicle(UIComponent component, UIMouseEventParameter eventParam)
        {
            ushort  vehicleId = Convert.ToUInt16(_goToField.text);
            Vehicle vehicle   = Singleton <VehicleManager> .instance.m_vehicles.m_buffer[vehicleId];

            if ((vehicle.m_flags & Vehicle.Flags.Created) != 0)
            {
                CameraCtrl.GoToVehicle(vehicleId, new Vector3(vehicle.GetLastFramePosition().x, Camera.main.transform.position.y, vehicle.GetLastFramePosition().z));
            }
        }
        private void clickGoToCitizenInstance(UIComponent component, UIMouseEventParameter eventParam)
        {
            ushort          citizenInstanceId = Convert.ToUInt16(_goToField.text);
            CitizenInstance citizenInstance   = Singleton <CitizenManager> .instance.m_instances.m_buffer[citizenInstanceId];

            if ((citizenInstance.m_flags & CitizenInstance.Flags.Created) != 0)
            {
                CameraCtrl.GoToCitizenInstance(citizenInstanceId, new Vector3(citizenInstance.GetLastFramePosition().x, Camera.main.transform.position.y, citizenInstance.GetLastFramePosition().z));
            }
        }
示例#6
0
        private void clickGoToBuilding(UIComponent component, UIMouseEventParameter eventParam)
        {
            ushort   buildingId = Convert.ToUInt16(_goToField.text);
            Building building   = Singleton <BuildingManager> .instance.m_buildings.m_buffer[buildingId];

            if ((building.m_flags & Building.Flags.Created) != 0)
            {
                CameraCtrl.GoToBuilding(buildingId, new Vector3(building.m_position.x, Camera.main.transform.position.y, building.m_position.z));
            }
        }
示例#7
0
        private void clickGoToParkedVehicle(UIComponent component, UIMouseEventParameter eventParam)
        {
            ushort        parkedVehicleId = Convert.ToUInt16(_goToField.text);
            VehicleParked parkedVehicle   = Singleton <VehicleManager> .instance.m_parkedVehicles.m_buffer[parkedVehicleId];

            if ((parkedVehicle.m_flags & (ushort)VehicleParked.Flags.Created) != 0)
            {
                CameraCtrl.GoToParkedVehicle(parkedVehicleId, new Vector3(parkedVehicle.m_position.x, Camera.main.transform.position.y, parkedVehicle.m_position.z));
            }
        }
示例#8
0
        private void clickGoToPos(UIComponent component, UIMouseEventParameter eventParam)
        {
            string[] vectorElms = _goToField.text.Split(',');
            if (vectorElms.Length < 2)
            {
                return;
            }

            CameraCtrl.GoToPos(new Vector3(float.Parse(vectorElms[0]), Camera.main.transform.position.y, float.Parse(vectorElms[1])));
        }
        private void clickGoToPos(UIComponent component, UIMouseEventParameter eventParam)
        {
            string[] vectorElms = _goToField.text.Split(',');
            if (vectorElms.Length < 2)
            {
                return;
            }

            ushort segmentId = Convert.ToUInt16(_goToField.text);

            if ((Singleton <NetManager> .instance.m_segments.m_buffer[segmentId].m_flags & NetSegment.Flags.Created) != NetSegment.Flags.None)
            {
                CameraCtrl.GoToPos(new Vector3(float.Parse(vectorElms[0]), Camera.main.transform.position.y, float.Parse(vectorElms[1])));
            }
        }
示例#10
0
        private void clickGoToVehicle(UIComponent component, UIMouseEventParameter eventParam)
        {
#if DEBUG
            if (title != null)
            {
                if (CustomPathManager._replacementPathFinds != null && CustomPathManager._replacementPathFinds.Length >= 1)
                {
                    title.text = CustomPathManager._replacementPathFinds[0].m_queuedPathFindCount.ToString();
                }
                else
                {
                    title.text = "n/a";
                }
            }
#endif

            ushort  vehicleId = Convert.ToUInt16(_goToField.text);
            Vehicle vehicle   = Singleton <VehicleManager> .instance.m_vehicles.m_buffer[vehicleId];
            if ((vehicle.m_flags & Vehicle.Flags.Created) != Vehicle.Flags.None)
            {
                CameraCtrl.GoToVehicle(vehicleId, new Vector3(vehicle.GetLastFramePosition().x, Camera.main.transform.position.y, vehicle.GetLastFramePosition().z));
            }
        }
 private void clickClearPos(UIComponent component, UIMouseEventParameter eventParam)
 {
     CameraCtrl.ClearPos();
 }