Exemple #1
0
    void Start()
    {
        GameObject go = FindObjectOfType <FollowingCamera>().gameObject;

        Destroy(go.GetComponent <FollowingCamera>());
        DroneCamera dc = go.AddComponent <DroneCamera>();

        dc.targetFirst  = objective;
        dc.targetFollow = gameObject;
        Destroy(this);
    }
Exemple #2
0
 /// <summary>
 /// Switch camera to
 /// </summary>
 /// <param name="camera"></param>
 private void setCameraTo(DroneCamera camera)
 {
     if (camera == DroneCamera.Front)
     {
         switchCamera(VideoChannelType.Horizontal);
     }
     else
     {
         switchCamera(VideoChannelType.Vertical);
     }
 }
Exemple #3
0
    void Start()
    {
        dronePositionControl = GetComponent <PositionControl>();
        droneVelocityControl = GetComponent <VelocityControl>();

        dronePositionControl.controlYaw = false;

        // This one is optional, thus cameraPosition can be null
        cameraPosition     = GetComponent <DroneCamera>();
        cameraViewRotation = 0.0f;
        if (cameraPosition != null)
        {
            cameraViewRotation    = cameraPosition.transform.eulerAngles.y;
            oldCameraViewRotation = cameraViewRotation;
        }

        // Instantiate hand target
        handTarget = new GameObject("Hand Target");
        handTarget.transform.localScale = 2.0f * SimulationData.DroneSize * Vector3.one;
        handTarget.transform.position   = dronePositionControl.transform.position;
    }
 // Use this for initialization
 void Start()
 {
     droneCam = drone.GetComponent <DroneCamera>();
 }