void FixedUpdate() { fixedUpdateCalled = true; if (currentProp == lastProp) { return; } // Dropping current prop if (currentProp == null) { puppetMaster.RemoveMuscleRecursive(lastProp.muscle, true); lastProp.Drop(); } // Picking up to an empty slot if (lastProp == null) { AttachProp(currentProp); } // Switching props if (lastProp != null && currentProp != null) { puppetMaster.RemoveMuscleRecursive(lastProp.muscle, true); AttachProp(currentProp); } lastProp = currentProp; }
/// <summary> /// Dropping/Picking up normally works in the fixed update cycle where joints can be properly connected. Use this to drop a prop immediatelly. /// </summary> public void DropImmediate() { if (lastProp == null) { return; } puppetMaster.RemoveMuscleRecursive(lastProp.muscle, true, false, MuscleRemoveMode.Sever); lastProp.Drop(); currentProp = null; lastProp = null; }
void OnJointBreak() { if (!enabled) { return; } puppetMaster.RemoveMuscleRecursive(puppetMaster.muscles[muscleIndex].joint, true, true, MuscleRemoveMode.Numb); }
protected void RemoveMusclesOfGroup(Muscle.Group group) { while (MusclesContainsGroup(group)) { for (int i = 0; i < puppetMaster.muscles.Length; i++) { if (puppetMaster.muscles[i].props.group == group) { puppetMaster.RemoveMuscleRecursive(puppetMaster.muscles[i].joint, true); break; } } } }
protected void RemovePropMuscles() { while (ContainsRemovablePropMuscle()) { for (int i = 0; i < puppetMaster.muscles.Length; i++) { if (puppetMaster.muscles[i].props.group == Muscle.Group.Prop && !puppetMaster.muscles[i].isPropMuscle) { puppetMaster.RemoveMuscleRecursive(puppetMaster.muscles[i].joint, true); break; } } } }
void OnJointBreak() { if (!enabled) { return; } // 确认 没有其它的 joint if (GetComponent <Joint>()) { return; } puppetMaster.RemoveMuscleRecursive(puppetMaster.muscles[muscleIndex].joint, true, true, MuscleRemoveMode.Numb); }
void OnJointBreak() { puppetMaster.RemoveMuscleRecursive(puppetMaster.muscles[muscleIndex].joint, true, true, MuscleRemoveMode.Numb); }