37239732ac
- Globe Asset - Spatial Anchors - Photon Implementation - Scripts for Globe Control and Initial Country Colorizing - Script for Reading csv file
30 lines
701 B
C#
30 lines
701 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
namespace WPM {
|
|
|
|
public class ConstraintArea : MonoBehaviour {
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
WorldMapGlobe map = WorldMapGlobe.instance;
|
|
|
|
// Gets France center in sphere coordinates
|
|
int countryIndex = map.GetCountryIndex("France");
|
|
Vector3 countryCenter = map.countries[countryIndex].localPosition;
|
|
|
|
// Center on France and set constraint around country center
|
|
map.FlyToLocation(countryCenter, 0);
|
|
map.constraintPosition = countryCenter;
|
|
map.constraintPositionAngle = 5f;
|
|
map.constraintPositionEnabled = true;
|
|
|
|
// Set zoom level and stop rotation
|
|
map.SetZoomLevel(0.1f);
|
|
map.autoRotationSpeed = 0f;
|
|
|
|
}
|
|
|
|
}
|
|
}
|