Exemple #1
0
 private void SpawnPart(EffigyArchitect.Part part)
 {
     if (BoltNetwork.isRunning)
     {
         AddEffigyPart addEffigyPart = AddEffigyPart.Create(GlobalTargets.OnlyServer);
         addEffigyPart.Effigy   = base.GetComponentInParent <BoltEntity>();
         addEffigyPart.ItemId   = part._itemId;
         addEffigyPart.Position = part._position;
         addEffigyPart.Rotation = part._rotation;
         addEffigyPart.Send();
     }
     else
     {
         this.SpawnPartReal(part, false);
     }
 }
Exemple #2
0
 public override void OnEvent(AddEffigyPart evnt)
 {
     if (evnt.Effigy)
     {
         Component[] componentsInChildren = evnt.Effigy.GetComponentsInChildren(typeof(EffigyArchitect), true);
         if (componentsInChildren.Length > 0)
         {
             (componentsInChildren[0] as EffigyArchitect).SpawnPartReal(new EffigyArchitect.Part
             {
                 _itemId   = evnt.ItemId,
                 _position = evnt.Position,
                 _rotation = evnt.Rotation
             }, true);
         }
     }
 }
 public override void OnEvent(AddEffigyPart evnt)
 {
     if (evnt.Effigy)
     {
         Component[] componentsInChildren = evnt.Effigy.GetComponentsInChildren(typeof(EffigyArchitect), true);
         if (componentsInChildren.Length > 0)
         {
             (componentsInChildren[0] as EffigyArchitect).SpawnPartReal(new EffigyArchitect.Part
             {
                 _itemId = evnt.ItemId,
                 _position = evnt.Position,
                 _rotation = evnt.Rotation
             }, true);
         }
     }
 }