Rotate() protected method

Helper function that copies the contents of the array, rotated by the specified offset.
protected Rotate ( Vector2 v, int offset ) : void
v Vector2
offset int
return void
示例#1
0
        private void CreateCharacter()
        {
            _characterContainer = this.Container(new UIContainerSettings());

            _body = _characterContainer.Sprite(new UISpriteSettings {
                Sprite = Game.GetSprite("mp_bar_buttons")
            });
            _body.SetColor(Color.black);

            _head = _characterContainer.Sprite(new UISpriteSettings {
                Sprite = Game.GetSprite("notif_cancel")
            });
            _head.SortingOrder(1);
            _head.Scale(3f);
            _head.Translate(0f, 2.22f);

            _leftHand = _characterContainer.Sprite(new UISpriteSettings {
                Sprite = Game.GetSprite("test_hand")
            });
            _leftHand.SortingOrder(2);
            _leftHand.Scale(0.2f, 0.32f);
            _leftHand.Translate(-0.87f, 0.36f);
            _leftHand.Flip(true, false);
            _leftHand.name = "Left Hand";
            _leftHand.SetColor(Color.black);

            _rightHand = _characterContainer.Sprite(new UISpriteSettings {
                Sprite = Game.GetSprite("test_hand")
            });
            _rightHand.SortingOrder(2);
            _rightHand.Scale(0.2f, 0.32f);
            _rightHand.Translate(0.87f, 0.36f);
            _rightHand.name = "Right Hand";
            _rightHand.SetColor(Color.black);

            _leftLeg = _characterContainer.Sprite(new UISpriteSettings {
                Sprite = Game.GetSprite("test_hand")
            });
            _leftLeg.SortingOrder(2);
            _leftLeg.Scale(0.2f, 0.32f);
            _leftLeg.Translate(-0.64f, -2.14f);
            _leftLeg.Rotate(-113.808f);
            _leftLeg.SetColor(Color.black);

            _rightLeg = _characterContainer.Sprite(new UISpriteSettings {
                Sprite = Game.GetSprite("test_hand")
            });
            _rightLeg.SortingOrder(2);
            _rightLeg.Scale(0.2f, 0.32f);
            _rightLeg.Translate(0.64f, -2.14f);
            _rightLeg.Rotate(113.808f);
            _rightLeg.SetColor(Color.black);
            _rightLeg.Flip(true, false);

            _characterContainer.Scale(0.5f);
        }