Пример #1
0
        /// <summary>
        ///
        /// </summary>
        private void Awake()
        {
            _child    = transform.GetChild(0).gameObject;
            _filter   = GetComponent <MeshFilter>();
            _renderer = GetComponent <MeshRenderer>();
            _scale    = transform.localScale;

            //added
            _rigidbody        = GetComponent <Rigidbody>();
            _height           = GetComponent <Transform>().position.y;
            _collider         = GetComponent <MeshCollider>();
            _collider.enabled = false;

            _tileTypeCounter = GetComponent <TileTypeCounter>();

            OnSetTile();
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        public override void Initialize()
        {
            _counter = GetComponent <TileTypeCounter>();

            _graph = _tileGraph.Graph;
            _verts = _tileGraph.VertexObjects;

            _map   = _tileSet.CreateMap();
            _model = TileModel.CreateFromGraph(_map, _graph, _seed);

            _model.DomainChanged += OnDomainChanged;
            _status = CollapseStatus.Incomplete;

            var selector = GetComponent <ITileSelector>();

            if (selector != null)
            {
                _model.Selector = selector;
            }

            _initializer = GetComponent <TileModelInitializer>();
            _initializer?.Initialize(_model);
        }