Example #1
0
        // Saves the mapdata
        public static MapData QueryMapData()
        {
            MapData curMapData = new MapData();

            curMapData.mapCams = new CamInstance[CameraManager.CameraRefs.Length];
            for (int i = 0; i < curMapData.mapCams.Length; i++)
            {
                curMapData.mapCams[i]     = new CamInstance();
                curMapData.mapCams[i].pos = MapDataConverter.Vector3ToV3(CameraManager.CameraRefs[i].transform.position);
                curMapData.mapCams[i].rot = MapDataConverter.QuaternionToV3(CameraManager.CurrentRenderCamera.transform.rotation);
            }

            return(curMapData);
        }
Example #2
0
 public override void ToolPrimaryUse()
 {
     if (onToolPrimaryUse != null)
     {
         onToolPrimaryUse.Invoke();
     }
     toolPrimaryTargetPosition   = CameraManager.curCamera.ScreenToWorldPoint(Input.mousePosition);
     toolPrimaryTargetPosition.x = (float)System.Math.Round(toolPrimaryTargetPosition.x, 3);
     toolPrimaryTargetPosition.z = (float)System.Math.Round(toolPrimaryTargetPosition.z, 3);
     //toolPrimaryTargetPosition.z += 0.3f;
     toolPrimaryTargetPosition.y = 0.4f;
     Icon.transform.position     = toolPrimaryTargetPosition;
     Icon.sortingOrder           = SessionManager.SpriteSortByPos(Icon);
     XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[MapDataManager.mapDataCurrentLayer].layerSpawn = MapDataConverter.Vector3ToV3(toolPrimaryTargetPosition);
 }