Advertisement
Guest User

Untitled

a guest
Jun 16th, 2018
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. public void ToggleDoor(TriggerArgs args)
  2. {
  3.     if (args.Caller != null)
  4.     {
  5.         IObject buttonTrigger = (IObject)args.Caller;
  6.         if (buttonTrigger.CustomId == "ToggleDoor01A")
  7.         {
  8.             ToggleDoor("Door01");
  9.         }
  10.     }
  11. }
  12.  
  13. private void ToggleDoor(string elevatorAttachmentJointId)
  14. {
  15.         IObject objEleJoint = Game.GetSingleObjectByCustomId("Door01");
  16.         IObjectElevatorAttachmentJoint eleJoint = (IObjectElevatorAttachmentJoint)objEleJoint;
  17.         eleJoint.SetMotorSpeed(-eleJoint.GetMotorSpeed());
  18.         eleJoint.SetElevatorPathJoint(eleJoint.GetElevatorPathJoint()); //Reinitialize elevator
  19.  
  20. }
  21. public void ToggleDoor1(TriggerArgs args)
  22. {
  23.     if (args.Caller != null)
  24.     {
  25.         IObject buttonTrigger1 = (IObject)args.Caller;
  26.         if (buttonTrigger1.CustomId == "ToggleDoor01A1")
  27.         {
  28.             ToggleDoor1("Door011");
  29.         }
  30.     }
  31. }
  32.  
  33. private void ToggleDoor1(string elevatorAttachmentJointId)
  34. {
  35.         IObject objEleJoint1 = Game.GetSingleObjectByCustomId("Door011");
  36.         IObjectElevatorAttachmentJoint eleJoint1 = (IObjectElevatorAttachmentJoint)objEleJoint1;
  37.         eleJoint1.SetMotorSpeed(-eleJoint1.GetMotorSpeed());
  38.         eleJoint1.SetElevatorPathJoint(eleJoint1.GetElevatorPathJoint()); //Reinitialize elevator
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement