示例#1
0
        private void Start()
        {
            _camera = GetComponent<Camera>();
            _lookAtTargetComponent = GetComponent<LookatTarget>();
            _lookAtTargetComponentTarget = _lookAtTargetComponent.Target;

            // !!! Will get these values from somewhere better, some time...
            _validCameraLocations[(int)CameraLocation.RowZeroColZero0] = new Vector3(0.0f, cameraHeight, 0.0f);
            _validCameraLocations[(int)CameraLocation.RowZeroColMax1] = new Vector3(0.0f, cameraHeight, 50.0f);
            _validCameraLocations[(int)CameraLocation.RowMaxColMax2] = new Vector3(50.0f, cameraHeight, 50.0f);
            _validCameraLocations[(int)CameraLocation.RowMaxColZero3] = new Vector3(50.0f, cameraHeight, 0.0f);

            _camera.transform.position = _validCameraLocations[(int)CameraLocation.RowZeroColZero0];

            _currentPosition = _camera.transform.position;
            _preferedPosition = _currentPosition;

            _currentLocation = CameraLocation.RowZeroColZero0;
            BakeCurrentLocation(_currentLocation);

            // Set prefered location to current at the start
            _preferedLocation = _currentLocation;
        }
        private void Start()
        {
            // Create at origin, looking towards the LookatTarget's target
            transform.position = new Vector3(0, DefaultHeight, 0);
            _height = transform.position.y;

            // Set up rails
            _mapRectangleRail.Set(0, CombatTerrain.terrainData.size.z, CombatTerrain.terrainData.size.x, _height);
            _lineMarkerRail = new List<Transform>();
            _radialRail.Set(CombatTerrain.terrainData.size.x / 2,
                            _height,
                            CombatTerrain.terrainData.size.z / 2,
                            Mathf.Max(CombatTerrain.terrainData.size.x, CombatTerrain.terrainData.size.z));

            _camera = GetComponent<Camera>();
            _lookatTarget = GetComponent<LookatTarget>();
        }