private void OnSceneGUI()
        {
            _cTarget = (CharacterDrunkController)target;
            if (_cTarget.ShowCone)
            {
                float   unitCircle = Mathf.Atan2(_cTarget.transform.forward.z, _cTarget.transform.forward.x) + (Mathf.Deg2Rad * (_cTarget.MaxDeviationAmount * 2) / 2f);
                Vector3 from       = new Vector3(Mathf.Cos(unitCircle), 0f, Mathf.Sin(unitCircle));

                Handles.color = Color.red;
                Handles.DrawSolidArc(_cTarget.transform.position, Vector3.up, from, _cTarget.MaxDeviationAmount * 2, 3f);
            }
        }
Example #2
0
 void Awake()
 {
     _characterController      = GetComponent <CharacterController>();
     _characterDrunkController = GetComponent <CharacterDrunkController>();
     _transform = transform;
 }