バグフィックス
@@ -77,14 +77,14 @@ | ||
77 | 77 | Player.JumpPower = 6; |
78 | 78 | */ |
79 | 79 | |
80 | - #region プレーヤー自身に対するActionイベント | |
81 | - Player.Sprite.Shape.Stepped += ( sender , e ) => { | |
82 | - // if( Player.Attacking == AttackTypes.DivineBuster ) { | |
83 | - // Player.RunAttack( Player.Attacking ).Start(); | |
84 | - // Player.Attacking = AttackTypes.None; | |
85 | - // } | |
86 | - }; | |
87 | - #endregion | |
80 | + //#region プレーヤー自身に対するActionイベント | |
81 | + //Player.Sprite.Shape.Stepped += ( sender , e ) => { | |
82 | + //// if( Player.Attacking == AttackTypes.DivineBuster ) { | |
83 | + //// Player.RunAttack( Player.Attacking ).Start(); | |
84 | + //// Player.Attacking = AttackTypes.None; | |
85 | + //// } | |
86 | + //}; | |
87 | + //#endregion | |
88 | 88 | |
89 | 89 | /* |
90 | 90 | //--------- |
@@ -75,6 +75,20 @@ | ||
75 | 75 | CanActDefault = true; |
76 | 76 | startTick = Stage.TickCount; |
77 | 77 | steppedEventArgs = new SpriteSteppedEventArgs( this.Owner ); |
78 | + if( layerType != LayerType.Character ) { | |
79 | + this.Body = Stage.World.CreateSpriteBody( false , position ); | |
80 | + this.Shape = this.Body.CreatePolygonSpriteShape( new SpriteShapeFilter( 0x5555 , 0xAAAA ) , new Polygon( new Vector[] { | |
81 | + new Vector( -chipSize.X / 2.0f , -chipSize.Y / 2.0f ), | |
82 | + new Vector( +chipSize.X / 2.0f , -chipSize.Y / 2.0f ), | |
83 | + new Vector( +chipSize.X / 2.0f , +chipSize.Y / 2.0f ), | |
84 | + new Vector( -chipSize.X / 2.0f , +chipSize.Y / 2.0f ), | |
85 | + } ) ); | |
86 | + } | |
87 | + else { | |
88 | + this.Body = Stage.World.CreateSpriteBody( true , position ); | |
89 | + this.Shape = this.Body.CreateCircleSpriteShape( new SpriteShapeFilter( 0xAAAA , 0x5555 ) , new Circle( Vector.Zero , Math.Min( chipSize.X , chipSize.Y ) ) ); | |
90 | + } | |
91 | + this.Body.Load(); | |
78 | 92 | } |
79 | 93 | } |
80 | 94 |
@@ -129,7 +143,7 @@ | ||
129 | 143 | /// <summary> |
130 | 144 | /// スプライトの位置、サイズを取得または、設定します。 |
131 | 145 | /// </summary> |
132 | - public IPolygonSpriteShape Shape { | |
146 | + public ISpriteShape Shape { | |
133 | 147 | get; |
134 | 148 | private set; |
135 | 149 | } |
@@ -20,6 +20,7 @@ | ||
20 | 20 | Sprite sprite; |
21 | 21 | //Unloadで削除する |
22 | 22 | // |
23 | + bool isMovable; | |
23 | 24 | |
24 | 25 | |
25 | 26 | float liniervelocity = 0.5f, angulervelocity = 0, friction = 0f, restitution = 0, density = 0.1f; |
@@ -42,10 +43,6 @@ | ||
42 | 43 | { |
43 | 44 | |
44 | 45 | chara = new DynamicRigid(position, 0, liniervelocity, angulervelocity); |
45 | - chara.Massdata = new MassData | |
46 | - { | |
47 | - Mass = 1, | |
48 | - }; | |
49 | 46 | } |
50 | 47 | else |
51 | 48 | { |
@@ -53,6 +50,7 @@ | ||
53 | 50 | } |
54 | 51 | |
55 | 52 | |
53 | + this.isMovable = isMovable; | |
56 | 54 | } |
57 | 55 | |
58 | 56 |
@@ -60,7 +58,8 @@ | ||
60 | 58 | { |
61 | 59 | |
62 | 60 | Polygondef2 pd = new Polygondef2(friction, restitution, density, new SpriteUserData(new PolygonSpriteShape(area,this,filter))); |
63 | - pd.Vertices = area.Vertices.Cast<Vec2>().ToArray<Vec2>(); | |
61 | + pd.Vertices = area.ToVerticesAsVec2(); | |
62 | + pd.VertexCount = pd.Vertices.Length; | |
64 | 63 | chara.Addtolist(pd); |
65 | 64 | return (IPolygonSpriteShape)((SpriteUserData)pd.User).SpriteShape; |
66 | 65 | } |
@@ -86,6 +85,10 @@ | ||
86 | 85 | public void Load() |
87 | 86 | { |
88 | 87 | chara.MakeBody(Stage.World); |
88 | + chara.Massdata = new MassData | |
89 | + { | |
90 | + Mass = 1, | |
91 | + }; | |
89 | 92 | } |
90 | 93 | |
91 | 94 | public void Unload() |
@@ -19,7 +19,7 @@ | ||
19 | 19 | |
20 | 20 | internal Vec2[] ToVerticesAsVec2() |
21 | 21 | { |
22 | - return this.Vertices.Cast<Vec2>().ToArray(); | |
22 | + return this.Vertices.Select(vector => (Vec2)(vector)).ToArray(); | |
23 | 23 | } |
24 | 24 | |
25 | 25 | public Vector[] Vertices; |
@@ -47,8 +47,8 @@ | ||
47 | 47 | if (DoubledCheck(s1, s2)) return; |
48 | 48 | shape1s.Add(s1); shape2s.Add(s2); |
49 | 49 | contactPoints.Add(cp); |
50 | - SpriteUserData nud1 = cp.Shape1.GetBody().GetUserData() as SpriteUserData; | |
51 | - SpriteUserData nud2 = cp.Shape2.GetBody().GetUserData() as SpriteUserData; | |
50 | + SpriteUserData nud1 = cp.Shape1.UserData as SpriteUserData; | |
51 | + SpriteUserData nud2 = cp.Shape2.UserData as SpriteUserData; | |
52 | 52 | |
53 | 53 | nud1.SpriteShape.PointRaise(cp.Shape1, cp.Position); |
54 | 54 | nud2.SpriteShape.PointRaise(cp.Shape2, cp.Position); |
@@ -54,16 +54,15 @@ | ||
54 | 54 | this.Filter = f; |
55 | 55 | User.filter=f; |
56 | 56 | } |
57 | - myUserData user; | |
58 | 57 | public myUserData User |
59 | 58 | { |
60 | 59 | get |
61 | 60 | { |
62 | - return user; | |
61 | + return (myUserData)(this.UserData); | |
63 | 62 | } |
64 | 63 | set |
65 | 64 | { |
66 | - user = value; | |
65 | + this.UserData = value; | |
67 | 66 | } |
68 | 67 | } |
69 | 68 | /// <summary> |
@@ -29,16 +29,15 @@ | ||
29 | 29 | Filter = u.filter; |
30 | 30 | } |
31 | 31 | |
32 | - myUserData user; | |
33 | 32 | public myUserData User |
34 | 33 | { |
35 | 34 | get |
36 | 35 | { |
37 | - return user; | |
36 | + return (myUserData)(this.UserData); | |
38 | 37 | } |
39 | 38 | set |
40 | 39 | { |
41 | - user = value; | |
40 | + this.UserData = value; | |
42 | 41 | } |
43 | 42 | } |
44 | 43 | } |