public RopeType GetRopeType() { int anchorAmount = 0; foreach (GameObject piece in ropePieces) { if (piece != null) { RopePiece currentRope = piece.GetComponent <RopePiece>(); if (currentRope.isAnchor) { anchorAmount++; } else if (piece.GetComponent <HingeJoint2D>().connectedBody == null) { anchorAmount++; } } } RopeType returnThis = (RopeType)anchorAmount; foreach (GameObject piece in ropePieces) { if (piece != null) { piece.GetComponent <RopePiece>().thisType = returnThis; } } //Debug.Log(returnThis); return(returnThis); }
private void Reset() { this.rope = null; this.entity1 = null; this.entity2 = null; this.isEntity2AMapPosition = false; this.isWinding = false; this.isUnwinding = false; this.isEntity1ABalloon = false; this.isEntity2ABalloon = false; this.hookPoint1 = Vector3.Zero; this.hookPoint2 = Vector3.Zero; this.hookOffset1 = Vector3.Zero; this.hookOffset2 = Vector3.Zero; this.rope = null; this.ropeType = (RopeType)4; this.isTransportHook = false; }
public void CopyFrom(HookPair other) { this.rope = other.rope; this.entity1 = other.entity1; this.entity2 = other.entity2; this.ropeType = other.ropeType; this.isEntity2AMapPosition = other.isEntity2AMapPosition; this.isEntity1ABalloon = other.isEntity1ABalloon; this.isEntity2ABalloon = other.isEntity2ABalloon; this.isWinding = other.isWinding; this.isUnwinding = other.isUnwinding; this.hookPoint1 = other.hookPoint1; this.hookPoint2 = other.hookPoint2; this.ropeType = other.ropeType; this.hookOffset1 = other.hookOffset1; this.hookOffset2 = other.hookOffset2; this.isTransportHook = other.isTransportHook; }
public static Rope AddRope(RopeType type, Vector3 position, Vector3 rotation, float length, float minLength, bool breakable) { Function.Call(Hash.ROPE_LOAD_TEXTURES, Array.Empty <InputArgument>()); InputArgument[] arguments = new InputArgument[0x11]; arguments[0] = position.X; arguments[1] = position.Y; arguments[2] = position.Z; arguments[3] = rotation.X; arguments[4] = rotation.Y; arguments[5] = rotation.Z; arguments[6] = length; arguments[7] = type; arguments[8] = length; arguments[9] = minLength; arguments[10] = 0.5f; arguments[11] = false; arguments[12] = false; arguments[13] = true; arguments[14] = 1f; arguments[15] = breakable; arguments[0x10] = 0; return(new Rope(Function.Call <int>(Hash.ADD_ROPE, arguments))); }
public static Rope AddRope(RopeType type, Vector3 position, Vector3 rotation, float length, float minLength, bool breakable) { Function.Call(Hash.ROPE_LOAD_TEXTURES); return new Rope(Function.Call<int>(Hash.ADD_ROPE, position.X, position.Y, position.Z, rotation.X, rotation.Y, rotation.Z, length, type, length, minLength, 0.5f, false, false, true, 1.0f, breakable, 0)); }