private DivingGameController getDivingController() { if (divingController == null) { divingController = getPlayerGO().GetComponent <DivingGameController>(); } return(divingController); }
private void RemoveDivingGameController() { if (!IsUnderWater) { DivingGameController component = base.gameObject.GetComponent <DivingGameController>(); component.RemoveLocalPlayerAirBubbleData(); Object.Destroy(component); Object.Destroy(base.gameObject.GetComponent <DivingGameObserver>()); } }
private void checkForDivingGameController(SwimControllerData data = null) { if (!base.gameObject.GetComponent <DivingGameController>()) { DivingGameController divingGameController = base.gameObject.AddComponent <DivingGameController>(); if (data != null) { divingGameController.SetData(data); } } }
private void OnTriggerExit(Collider other) { if (isLocalPlayer && other.gameObject != base.gameObject && !other.transform.IsChildOf(base.transform) && (bool)other.gameObject.GetComponent <FreeAirZone>()) { turnPlentifulAreaTriggerLightsOn(other.gameObject.GetComponent <FreeAirZone>(), isOn: false); setBubbleColor(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); State = DivingState.HoldingBreath; logEnterNoAirBI(); } ShareBubble component = other.gameObject.GetComponent <ShareBubble>(); if (component != null && !other.transform.IsChildOf(base.transform)) { DivingGameController componentInParent = other.gameObject.GetComponentInParent <DivingGameController>(); if (componentInParent != null) { overlappingBubbles.Remove(componentInParent); } } }
public void RemotePlayerRemoved(DivingGameController controller) { if (!isLocalPlayer) { return; } if (controller != null) { overlappingBubbles.Remove(controller); } if (overlappingBubbles.Count == 0) { State = DivingState.HoldingBreath; Service.Get <INetworkServicesManager>().PlayerStateService.SetAirBubble(AirSupply, (int)State); dispatcher.DispatchEvent(new DivingEvents.FreeAirEffects(enabled: false, base.gameObject.tag)); FreeAirZone componentInChildren = base.gameObject.GetComponentInChildren <FreeAirZone>(); if (componentInChildren != null) { UnityEngine.Object.Destroy(componentInChildren); } } }
private void OnTriggerEnter(Collider other) { if (isLocalPlayer) { if (other.gameObject != base.gameObject && !other.transform.IsChildOf(base.transform) && (bool)other.gameObject.GetComponent <FreeAirZone>()) { handleEnteringFreeAirZone(other); } else if (other.gameObject.CompareTag("TutorialTrigger") && Service.Get <TutorialManager>().TryStartTutorial(FindingAirTutorialDefinition.Id)) { State = DivingState.PlentifulAir; } } ShareBubble component = other.gameObject.GetComponent <ShareBubble>(); if (component != null && !other.transform.IsChildOf(base.transform)) { DivingGameController componentInParent = other.gameObject.GetComponentInParent <DivingGameController>(); if (componentInParent != null) { overlappingBubbles.Add(componentInParent); } } }
private void Start() { divingController = getDivingController(); trayInputButton = GetComponentInParent <TrayInputButton>(); }