Esempio n. 1
0
        protected void generateAutomaticLayers()
        {
            _interactionLayer          = -1;
            _interactionNoContactLayer = -1;
            _contactBoneLayer          = -1;
            for (int i = 8; i < 32; i++)
            {
                string layerName = LayerMask.LayerToName(i);
                if (string.IsNullOrEmpty(layerName))
                {
                    if (_interactionLayer == -1)
                    {
                        _interactionLayer = i;
                    }
                    else if (_interactionNoContactLayer == -1)
                    {
                        _interactionNoContactLayer = i;
                    }
                    else if (_contactBoneLayer == -1)
                    {
                        _contactBoneLayer = i;
                        break;
                    }
                }
            }

            if (_interactionLayer == -1 || _interactionNoContactLayer == -1 || _contactBoneLayer == -1)
            {
                if (Application.isPlaying)
                {
                    enabled = false;
                }
                Debug.LogError("InteractionManager Could not find enough free layers for "
                               + "auto-setup; manual setup is required.", this.gameObject);
                _autoGenerateLayers = false;
                return;
            }
        }
Esempio n. 2
0
        protected void autoGenerateLayers()
        {
            _interactionLayer       = -1;
            _interactionNoClipLayer = -1;
            _brushLayer             = -1;
            for (int i = 8; i < 32; i++)
            {
                string layerName = LayerMask.LayerToName(i);
                if (string.IsNullOrEmpty(layerName))
                {
                    if (_interactionLayer == -1)
                    {
                        _interactionLayer = i;
                    }
                    else if (_interactionNoClipLayer == -1)
                    {
                        _interactionNoClipLayer = i;
                    }
                    else if (_brushLayer == -1)
                    {
                        _brushLayer = i;
                        break;
                    }
                }
            }

            if (_interactionLayer == -1 || _interactionNoClipLayer == -1 || _brushLayer == -1)
            {
                if (Application.isPlaying)
                {
                    enabled = false;
                }
                Debug.LogError("InteractionManager Could not find enough free layers for auto-setup, manual setup required.");
                _autoGenerateLayers = false;
                return;
            }
        }
Esempio n. 3
0
    protected void autoGenerateLayers() {
      _interactionLayer = -1;
      _interactionNoClipLayer = -1;
      _brushLayer = -1;
      for (int i = 8; i < 32; i++) {
        string layerName = LayerMask.LayerToName(i);
        if (string.IsNullOrEmpty(layerName)) {
          if (_interactionLayer == -1) {
            _interactionLayer = i;
          } else if (_interactionNoClipLayer == -1) {
            _interactionNoClipLayer = i;
          } else if (_brushLayer == -1) {
            _brushLayer = i;
            break;
          }
        }
      }

      if (_interactionLayer == -1 || _interactionNoClipLayer == -1 || _brushLayer == -1) {
        if (Application.isPlaying) {
          enabled = false;
        }
        Debug.LogError("InteractionManager Could not find enough free layers for auto-setup, manual setup required.");
        _autoGenerateLayers = false;
        return;
      }
    }