using UnityEngine;
using System.Collections;
using Framework.Entities;
using Framework.Extensions;
using Framework.Debugging;

//namespace Framework.ActorComponents
//{
//    public class ThirdPersonCameraBoom : CoreBehaviour
//    {
//        public Camera camera;
//        public float rotateSpeed = 100f;
//        public float tilt = 45f;
//        public float cameraFocusDistance = 10f;

//        private float distance = 14f;
//        private GameObject forwardReference;

//        protected override void InnerStart()
//        {
//            this.forwardReference = new GameObject();
//            //Vector3 projectedCameraForward = camera.forward.ProjectRelative(this.transform, new Vector3(1, 0, 1)).normalized;
//            //Draw.Line(this.transform.position, this.transform.position + projectedCameraForward * 3f, Color.magenta);
//            SelfInteract(new ExposeForwardReference(this, forwardReference.transform));
//        }

//        protected override void InnerUpdate()
//        {
//            if (this.forwardReference != null)
//            {
//                float rotateInput = Input.GetAxis("Mouse X");
//                this.forwardReference.transform.position = this.transform.position;

//                this.forwardReference.transform.localEulerAngles = this.forwardReference.transform.localEulerAngles + (new Vector3(0, rotateInput, 0) * this.rotateSpeed * Time.deltaTime);
//                Draw.Line(this.transform.position, this.transform.position + (this.forwardReference.transform.forward * 5f), Color.blue);

//                if (this.camera != null)
//                {
//                    this.camera.transform.position = this.forwardReference.transform.position - 
//                        ((Quaternion.AngleAxis(this.tilt, this.forwardReference.transform.right) * this.forwardReference.transform.forward) * this.distance);
//                    this.camera.transform.LookAt(this.forwardReference.transform.position + (this.forwardReference.transform.forward * this.cameraFocusDistance));    
//                }
//            }
//        }
//    }
//}