示例#1
0
    // Use this for initialization
    void Start()
    {
        // initialize shooter
        _gun = GetComponent <Gun>();
        _circleShootHelper = GetComponent <CircleShootingAI>();

        _playerHealth = GetComponent <DestoriableTarget>();

        StartCoroutine(DelayUpdateLifeInfo());
    }
    private void OnSceneGUI()
    {
        _targ = target as CircleShootingAI;

        _handleTransform = _targ.transform;
        _handleRotation  = Tools.pivotRotation == PivotRotation.Local ? _handleTransform.rotation : Quaternion.identity;


        Vector3 circleNormal = _handleTransform.TransformDirection(Vector3.up);

        _arcFrom = _targ.ShootDirection;
        _arcFrom = Quaternion.Euler(0f, -_targ.radio * 0.5f, 0) * _arcFrom;

        // draw range
        Handles.color = Color.red;
        Handles.DrawSolidArc(_handleTransform.position, circleNormal, _arcFrom, _targ.radio, _targ.radius);

        DrawBulletHoles();
    }