Door.Update C# (CSharp) Метод

Update() публичный Метод

public Update ( ) : void
Результат void
    void Update()
    {
        bool enemySpawnersExists = false;
        for (int i = 0; i < enemySpawnerArray.Length; i++)
        {
            GameObject enemySpawner = enemySpawnerArray[i];
            if (enemySpawner != null)
            {
                enemySpawnersExists = true;
            }
        }

        if (!enemySpawnersExists)
        {
            Destroy(this.gameObject);
        }
    }
}

Usage Example

Пример #1
0
        private Boolean TryOpenDoor(GridSlot p_slot, EDirection p_dir)
        {
            List <InteractiveObject> doors = p_slot.GetDoors();

            for (Int32 i = 0; i < doors.Count; i++)
            {
                Door door = (Door)doors[i];
                if (door.Location == p_dir && door.State == EInteractiveObjectState.DOOR_CLOSED && door.Commands.Count > 0)
                {
                    door.Execute(LegacyLogic.Instance.MapLoader.Grid);
                    door.Update();
                    return(true);
                }
            }
            GridSlot neighborSlot = p_slot.GetNeighborSlot(LegacyLogic.Instance.MapLoader.Grid, p_dir);

            doors = neighborSlot.GetDoors();
            for (Int32 j = 0; j < doors.Count; j++)
            {
                Door door2 = (Door)doors[j];
                if (door2.Location == EDirectionFunctions.GetOppositeDir(p_dir) && door2.State == EInteractiveObjectState.DOOR_CLOSED && door2.Commands.Count > 0)
                {
                    door2.Execute(LegacyLogic.Instance.MapLoader.Grid);
                    door2.Update();
                    return(true);
                }
            }
            return(false);
        }
All Usage Examples Of Door::Update