Esempio n. 1
0
        /// <summary>
        /// Called on Start
        /// </summary>
        protected override void Start()
        {
            base.Start();

            _scanner = this.GetComponent <SteeringScanner>();
            if (_scanner == null)
            {
                Debug.LogError(this.gameObject.name + " is missing its SteeringScanner component");
            }
        }
        /// <summary>
        /// Called on Start
        /// </summary>
        protected override void Start()
        {
            base.Start();

            _scanner = this.GetComponent<SteeringScanner>();
            if (_scanner == null)
            {
                Debug.LogError(this.gameObject.name + " is missing its SteeringScanner component");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Called on Start
        /// </summary>
        protected override void Start()
        {
            base.Start();

            _scanner = this.GetComponent <SteeringScanner>();
            if (_scanner == null)
            {
                Debug.LogError(this.gameObject.name + " is missing its SteeringScanner component");
            }

            _unitData = this.GetUnitFacade();

            float deg2Rad = Mathf.Deg2Rad;

            _fovReverseAngleCos = Mathf.Cos(((360f - _unitData.fieldOfView) / 2f) * deg2Rad);
            _omniAwareRadius    = _unitData.radius * 2f;
            _cosAvoidAngle      = Mathf.Cos(this.headOnCollisionAngle * deg2Rad);
        }
        /// <summary>
        /// Called on Start
        /// </summary>
        protected override void Start()
        {
            base.Start();

            _scanner = this.GetComponent<SteeringScanner>();
            if (_scanner == null)
            {
                Debug.LogError(this.gameObject.name + " is missing its SteeringScanner component");
            }

            _unitData = this.GetUnitFacade();

            float deg2Rad = Mathf.Deg2Rad;
            _fovReverseAngleCos = Mathf.Cos(((360f - _unitData.fieldOfView) / 2f) * deg2Rad);
            _omniAwareRadius = _unitData.radius * 2f;
            _cosAvoidAngle = Mathf.Cos(this.headOnCollisionAngle * deg2Rad);
        }