public virtual void setLadderData(LadderInfo ladderInfo) { // rotate by init angle initAngle = ladderInfo.initAngle; transform.Rotate(0, 0, -initAngle); initPosition = ladderInfo.initPosition.GetV3(); type = ladderInfo.type; timeout = ladderInfo.timeout; if (ladderInfo.movement == null || ladderInfo.movement.speed <= 0) { GetComponent <LadderMovement>().enabled = false; } else { GetComponent <LadderMovement>().enabled = true; GetComponent <LadderMovement>().SetMovementData(ladderInfo.movement); } if (ladderInfo.rotate == null || ladderInfo.rotate.speed <= 0) { GetComponent <LadderRotate>().enabled = false; } else { GetComponent <LadderRotate>().enabled = true; GetComponent <LadderRotate>().SetRotateData(ladderInfo.rotate); } }
public LadderInfo(Constants.LadderType type, MyVector3 initPosition, float initAngle, float timeout, LadderMovementData movement, LadderRotateData rotate) { this.type = type; this.initPosition = initPosition; this.initAngle = initAngle; this.timeout = timeout; this.movement = movement; this.rotate = rotate; }
public LadderInfo(LadderInfo other) { this.type = other.type; this.initPosition = other.initPosition; this.initAngle = other.initAngle; this.timeout = other.timeout; this.movement = other.movement; this.rotate = other.rotate; }
public Ladder(ContentManager content, Constants.LadderType type, Vector2 position) { this.type = type; this.position = position; TAG = "Ladder"; IsActive = true; this.BoundingBoxOffset = 10; Initialize(content); }