/// Add any missing systems: private void InitSystems() { registerTile = GetComponent <RegisterTile>(); //Always include blood for living entities: bloodSystem = GetComponent <BloodSystem>(); if (bloodSystem == null) { bloodSystem = gameObject.AddComponent <BloodSystem>(); } //Always include respiratory for living entities: respiratorySystem = GetComponent <RespiratorySystem>(); if (respiratorySystem == null) { respiratorySystem = gameObject.AddComponent <RespiratorySystem>(); } var tryGetHead = FindBodyPart(BodyPartType.Head); if (tryGetHead != null && brainSystem == null) { if (tryGetHead.Type != BodyPartType.Chest) { //Head exists, install a brain system brainSystem = gameObject.AddComponent <BrainSystem>(); } } }
void InitSystem() { playerScript = GetComponent <PlayerScript>(); bloodSystem = GetComponent <BloodSystem>(); respiratorySystem = GetComponent <RespiratorySystem>(); livingHealthBehaviour = GetComponent <LivingHealthBehaviour>(); //Server only if (CustomNetworkManager.Instance._isServer) { //Spawn a brain and connect the brain to this living entity brain = new Brain(); brain.ConnectBrainToBody(gameObject); if (playerScript != null) { //TODO: See https://github.com/unitystation/unitystation/issues/1429 } init = true; } }
public Chest(Bone[] chestBoneStructure = null, Heart heart = null, RespiratorySystem lungs = null) { Bones = chestBoneStructure ?? DefaultBoneStructures.DefaultChestBones; Heart = heart ?? new Heart(); Lungs = lungs ?? new RespiratorySystem(); }