private void ServerAccessDenied()
 {
     if (isPerformingAction == false)
     {
         DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.AccessDenied);
     }
 }
    public void ServerOpen()
    {
        if (this == null || gameObject == null)
        {
            return;                                             // probably destroyed by a shuttle crash
        }
        if (Time.time < delayStartTime + inputDelay)
        {
            return;
        }

        delayStartTime = Time.time;

        ResetWaiting();
        IsClosed = false;

        if (isHackable && hackingLoaded)
        {
            HackingNode onDoorOpened = hackingProcess.GetNodeWithInternalIdentifier("OnDoorOpened");
            onDoorOpened.SendOutputToConnectedNodes();
        }

        if (!isPerformingAction)
        {
            DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Open);
        }
    }
        public void Close()
        {
            // Check if this is null... it is possible for this to be null in Unity - gameObject reference can generate an NRE.
            if (this == null || gameObject == null)
            {
                return;                                                 // probably destroyed by a shuttle crash
            }
            if (Time.time < delayStartTime + inputDelay)
            {
                return;
            }

            delayStartTime = Time.time;

            IsClosed = true;
            OnDoorClose?.Invoke();
            if (isPerformingAction == false)
            {
                DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Close);
                if (damageOnClose)
                {
                    ServerDamageOnClose();
                }
            }
        }
Beispiel #4
0
 private void AccessDenied()
 {
     if (!isPerformingAction)
     {
         DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.AccessDenied);
     }
 }
Beispiel #5
0
 private void Close()
 {
     IsOpened = false;
     if (!isPerformingAction)
     {
         DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Close);
     }
 }
Beispiel #6
0
    public static DoorUpdateMessage SendToAll(GameObject door, DoorUpdateType type)
    {
        var msg = new DoorUpdateMessage {
            Door = door.NetId(),
            Type = type,
        };

        msg.SendToAll();
        return(msg);
    }
Beispiel #7
0
    public void Open()
    {
        ResetWaiting();
        IsOpened = true;

        if (!isPerformingAction)
        {
            DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Open);
        }
    }
Beispiel #8
0
 public void Close()
 {
     IsOpened = false;
     if (!isPerformingAction)
     {
         DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Close);
         if (damageOnClose)
         {
             DamageOnClose();
         }
     }
 }
Beispiel #9
0
    public void ServerOpen()
    {
        if (this == null || gameObject == null)
        {
            return;                                                     // probably destroyed by a shuttle crash
        }
        ResetWaiting();
        IsClosed = false;

        if (!isPerformingAction)
        {
            DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Open);
        }
    }
Beispiel #10
0
 public void ServerClose()
 {
     if (gameObject == null)
     {
         return;                                     // probably destroyed by a shuttle crash
     }
     IsClosed = true;
     if (!isPerformingAction)
     {
         DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Close);
         if (damageOnClose)
         {
             ServerDamageOnClose();
         }
     }
 }
        public void Open(bool blockClosing = false)
        {
            if (this == null || gameObject == null)
            {
                return;                                                 // probably destroyed by a shuttle crash
            }
            if (Time.time < delayStartTime + inputDelay)
            {
                return;
            }

            delayStartTime = Time.time;
            if (blockClosing == false)
            {
                ResetWaiting();
            }
            IsClosed = false;
            OnDoorOpen?.Invoke();
            if (isPerformingAction == false)
            {
                DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Open);
            }
        }
        public void Close()
        {
            if (gameObject == null)
            {
                return;                                 // probably destroyed by a shuttle crash
            }
            if (Time.time < delayStartTime + inputDelay)
            {
                return;
            }

            delayStartTime = Time.time;

            IsClosed = true;

            if (!isPerformingAction)
            {
                DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.Close);
                if (damageOnClose)
                {
                    ServerDamageOnClose();
                }
            }
        }
 private void ServerPressureWarn()
 {
     DoorUpdateMessage.SendToAll(gameObject, DoorUpdateType.PressureWarn);
     pressureWarnActive = true;
     StartCoroutine(PressureWarnDelay());
 }