Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        var angle = -transform.rotation.eulerAngles.y * Mathf.PI / 180.0f;
        var lefts = (from vl in Left
                     let pnt = new Regulus.CustomType.Vector2(vl.x, vl.y)
                               select Regulus.CustomType.Polygon.RotatePoint(pnt, new Regulus.CustomType.Vector2(), angle)).ToArray();
        var right = (from vr in Right
                     let pnt = new Regulus.CustomType.Vector2(vr.x, vr.y)
                               select Regulus.CustomType.Polygon.RotatePoint(pnt, new Regulus.CustomType.Vector2(), angle)).ToArray();

        var center = new Regulus.CustomType.Vector2(transform.position.x, transform.position.z);


#if UNITY_EDITOR
        Regulus.Project.ItIsNotAGame1.Game.Play.BattleCasterStatus._DrawAll(lefts, right, transform.position, AllLineColor);
#endif
        //_DrawAll();

        var delta = UnityEngine.Time.deltaTime;
        Regulus.CustomType.Polygon result = _Determination.Find(_LastPart, delta);
        if (result != null)
        {
            result.Rotation(angle, new Regulus.CustomType.Vector2());
            result.Offset(center);
#if UNITY_EDITOR
            Regulus.Project.ItIsNotAGame1.Game.Play.BattleCasterStatus._Draw(result, transform.position.y, LineColor);
#endif
            //_Draw(result);3
        }
        _LastPart += delta;

        if (_LastPart > Total)
        {
            _LastPart -= Total;
        }
    }
    // Update is called once per frame
    void Update()
    {
        var angle =- transform.rotation.eulerAngles.y * Mathf.PI / 180.0f;
        var lefts = (from vl in Left
                     let pnt = new Regulus.CustomType.Vector2(vl.x, vl.y)
                     select Regulus.CustomType.Polygon.RotatePoint(pnt, new Regulus.CustomType.Vector2(), angle )).ToArray();
        var right = (from vr in Right
                     let pnt = new Regulus.CustomType.Vector2(vr.x, vr.y)
                     select Regulus.CustomType.Polygon.RotatePoint(pnt, new Regulus.CustomType.Vector2(), angle)).ToArray();

        var center = new Regulus.CustomType.Vector2(transform.position.x, transform.position.z);

        #if UNITY_EDITOR
        Regulus.Project.ItIsNotAGame1.Game.Play.BattleCasterStatus._DrawAll(lefts , right , transform.position, AllLineColor);
        #endif
        //_DrawAll();

        var delta  = UnityEngine.Time.deltaTime;
        Regulus.CustomType.Polygon result = _Determination.Find(_LastPart , delta );
        if (result != null)
        {

            result.Rotation(angle , new Regulus.CustomType.Vector2());
            result.Offset(center);
        #if UNITY_EDITOR
            Regulus.Project.ItIsNotAGame1.Game.Play.BattleCasterStatus._Draw(result, transform.position.y, LineColor);
        #endif
            //_Draw(result);3
        }
        _LastPart += delta;

        if (_LastPart > Total)
        {
            _LastPart -= Total;
        }
    }