@@ -25,17 +25,17 @@ public class LIPhysicsObject(IntPtr intPtr) : MonoBehaviour(intPtr)
2525 private static uint _objectCounter ;
2626 private uint _objectID ;
2727
28- public Rigidbody2D ? rb ;
29- public MapObjectData ? liObject ;
28+ [ HideFromIl2Cpp ] public LIElement ? Element { get ; private set ; }
29+ [ HideFromIl2Cpp ] public Rigidbody2D ? Rigidbody { get ; private set ; }
3030
3131 public void Awake ( )
3232 {
3333 _objectID = _objectCounter ++ ;
3434
3535 AllObjects . Add ( _objectID , this ) ;
36-
37- rb = GetComponent < Rigidbody2D > ( ) ;
38- liObject = gameObject . GetLIData ( ) ;
36+
37+ Element = MapObjectDB . Get ( gameObject ) ;
38+ Rigidbody = GetComponent < Rigidbody2D > ( ) ;
3939 }
4040
4141 public void Start ( )
@@ -83,7 +83,7 @@ private IEnumerator CoUpdatePosAsHost()
8383
8484 private void UpdateObjectPosOverRPC ( )
8585 {
86- if ( rb == null )
86+ if ( Rigidbody == null )
8787 throw new Exception ( "Rigidbody2D is null" ) ;
8888
8989 Rpc < PhysicsObjectRPC > . Instance . Send ( PlayerControl . LocalPlayer , new RPCPhysicsObjectPacket
@@ -92,9 +92,9 @@ private void UpdateObjectPosOverRPC()
9292 X = transform . position . x ,
9393 Y = transform . position . y ,
9494 Rotation = transform . rotation . eulerAngles . z ,
95- VelocityX = rb . velocity . x ,
96- VelocityY = rb . velocity . y ,
97- AngularVelocity = rb . angularVelocity
95+ VelocityX = Rigidbody . velocity . x ,
96+ VelocityY = Rigidbody . velocity . y ,
97+ AngularVelocity = Rigidbody . angularVelocity
9898 } ) ;
9999 }
100100}
0 commit comments