public Data(ResourceSource source) { this.prefabName = source.savedPrefabName; this.position = source.transform.position; this.type = (int)source.type; this.amount = source.amount; }
private Data(Building building) { this.prefabName = building.savedPrefabName; this.position = building.transform.position; this.isFinished = building.IsFinished; this.requiredResources = building.requiredResources; }
public NavigationMapInfo(Vector3 mapSize, Vector3 tileSize) { this.mapSize = mapSize; this.tileSize = tileSize; _tileCountX = Mathf.CeilToInt(mapSize.x / tileSize.x); _tileCountZ = Mathf.CeilToInt(mapSize.z / tileSize.z); }
public Box3i(Vector3 min, Vector3 max) { minP = min; maxP = max; xRange = (float)max.x - min.x; yRange = (float)max.y - min.y; zRange = (float)max.z - min.z; }
public Data(Person person) { this.prefabName = person.savedPrefabName; this.displayName = person.GetComponent <Selectable>().menuName; this.position = person.transform.position; this.carryingResource = person.CarryingResource; this.resourceToBeGathered = person.resourceToBeGathered; this.shouldConstructBuilding = person.shouldContructBuilding; }
void Update() { SerializableVec3 pos = follow.position + offset; transform.position = pos; return; rotationX += Input.GetAxis("Mouse X") * cameraSensitivity * Time.deltaTime; rotationY += Input.GetAxis("Mouse Y") * cameraSensitivity * Time.deltaTime; rotationY = Mathf.Clamp(rotationY, -90, 90); transform.localRotation = Quaternion.AngleAxis(rotationX, Vector3.up); transform.localRotation *= Quaternion.AngleAxis(rotationY, Vector3.left); if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) { transform.position += transform.forward * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Vertical") * Time.deltaTime; transform.position += transform.right * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Horizontal") * Time.deltaTime; } else if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) { transform.position += transform.forward * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Vertical") * Time.deltaTime; transform.position += transform.right * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Horizontal") * Time.deltaTime; } else { transform.position += transform.forward * normalMoveSpeed * Input.GetAxis("Vertical") * Time.deltaTime; transform.position += transform.right * normalMoveSpeed * Input.GetAxis("Horizontal") * Time.deltaTime; } if (Input.GetKey(KeyCode.Q)) { transform.position += transform.up * climbSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.E)) { transform.position -= transform.up * climbSpeed * Time.deltaTime; } if (Input.GetKeyDown(KeyCode.End)) { Screen.lockCursor = (Screen.lockCursor == false) ? true : false; } }