예제 #1
0
        private void Awake()
        {
            _voxelObject = GetComponent <VoxelObject>();

            // Generate tasks
            var allFurniture = new List <Furniture>();

            foreach (var furniture in FurniturePool)
            {
                for (var i = 0; i < furniture.Amount; i++)
                {
                    allFurniture.Add(furniture.Furniture);
                }
            }

            allFurniture = allFurniture.OrderBy(x => Random.value).ToList();
            foreach (var f in allFurniture)
            {
                FurnitureStack.Push(f);
            }
        }
예제 #2
0
        private void Start()
        {
            _voxelObject = GetComponent <VoxelObject>();

            if (Representation != null)
            {
                _startLocalPosition = Representation.transform.localPosition;
                _startLocalRotation = Representation.transform.localRotation;

                _targetLocalPosition = Representation.transform.localPosition;
                _targetLocalRotation = Representation.transform.localRotation;
            }

            _target = transform.position;

            if (PlaceOnStart)
            {
                if (Room.Instance != null)
                {
                    Room.Instance.PlaceFurniture(this);
                }
            }
        }