コード例 #1
0
 private DivingGameController getDivingController()
 {
     if (divingController == null)
     {
         divingController = getPlayerGO().GetComponent <DivingGameController>();
     }
     return(divingController);
 }
コード例 #2
0
 private void RemoveDivingGameController()
 {
     if (!IsUnderWater)
     {
         DivingGameController component = base.gameObject.GetComponent <DivingGameController>();
         component.RemoveLocalPlayerAirBubbleData();
         Object.Destroy(component);
         Object.Destroy(base.gameObject.GetComponent <DivingGameObserver>());
     }
 }
コード例 #3
0
 private void checkForDivingGameController(SwimControllerData data = null)
 {
     if (!base.gameObject.GetComponent <DivingGameController>())
     {
         DivingGameController divingGameController = base.gameObject.AddComponent <DivingGameController>();
         if (data != null)
         {
             divingGameController.SetData(data);
         }
     }
 }
コード例 #4
0
        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);
                }
            }
        }
コード例 #5
0
 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);
         }
     }
 }
コード例 #6
0
        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);
                }
            }
        }
コード例 #7
0
 private void Start()
 {
     divingController = getDivingController();
     trayInputButton  = GetComponentInParent <TrayInputButton>();
 }