public void Die() { if (GetComponentInParent <RSController>() == null) { return; } //player has been hit and will turn into a laborer //stop movement robotMovement.Die(); robotMovement.enabled = false; hoverBase.enabled = false; GetComponentInChildren <NavMeshAgent>().enabled = false; //stop attacking robotAttack.enabled = false; //set cameras - disable camera colliders and enable ghost traveling camera robotFollow.SetColliders(false); robotFollow.EnableFreeFly(); //set player to laborer robotLaborerControl.isFighter = false; robotLaborerControl.CallSetLaborer(); robotLaborerControl.isIdleLaborer = true; //detach robot from controlling parent GetComponentInParent <RSController>().Die(); }
public void Die() { //stop attacking robotAttack.enabled = false; //so there is still and audioListener if (audioListener != null) { if (audioListener.enabled) { FlyCamaudioListener.enabled = true; } } //player has been hit and will turn into a laborer //stop movement robotMovement.Die(); robotMovement.enabled = false; hoverBase.enabled = false; GetComponentInChildren <NavMeshAgent>().enabled = false; //set cameras - disable camera colliders and enable ghost traveling camera robotFollow.SetColliders(false); robotFollow.EnableFreeFly(); //set player to laborer robotLaborerControl.isFighter = false; robotLaborerControl.CallSetLaborer(); robotLaborerControl.isIdleLaborer = true; GetComponentInChildren <ColorRobot>().SetGrey(); //detach robot from controlling parent if (GetComponentInParent <RSController>() != null) { GetComponentInParent <RSController>().Die(); } robotFollow.enabled = false; }