Exemple #1
0
        private void AddObstacle(Collider other, ObstacleConfig obstacleConfig)
        {
            Log($"AddObstacle | {other.name} | ObstacleConfig {obstacleConfig.name}", false);

            var activeObstacle = new ActiveWarningObstacle
            {
                obstacle       = other,
                obstacleConfig = obstacleConfig
            };

            activeObstacles.Add(activeObstacle);
        }
Exemple #2
0
        private bool GetObstacleConfig(GameObject other, out ObstacleConfig config)
        {
            foreach (var obstacleConfig in obstacleConfigs)
            {
                if ((obstacleConfig.layerMask.value & (1 << other.layer)) > 0)
                {
                    config = obstacleConfig;
                    return(true);
                }
            }

            config = null;
            return(false);
        }