// Start is called before the first frame update // Use this for initialization void Start() { currentMovementState = movementState_t.idle; startPosition = transform.localPosition; clawHinges = new List <HingeJoint>(); //ok grab all mandible and chuck them into vector foreach (var iter in GetComponentsInChildren <HingeJoint>()) { clawHinges.Add(iter); } currentGrabState = grabState.open; Grab(); //SetupCallbacks(); }
public virtual void ChangeState(movementState_t newState) { currentMovementState = newState; switch (currentMovementState) { case movementState_t.idle: case movementState_t.forwards: case movementState_t.horizontally: case movementState_t.descending: { break; } case movementState_t.grabbing: { //open the crane, wait one second then start ascending currentGrabState = grabState.closed; Grab(); //onGrab(); break; } case movementState_t.ascending: { break; } case movementState_t.return_horizontally: { currentGrabState = grabState.open; Grab(); break; } case movementState_t.return_backwards: { OnReturnProc(System.EventArgs.Empty); break; } } }