Exemplo n.º 1
0
    public void RandomInit()
    {
        Attributes = new NeedsAttributes();
        Attributes.Randomize();

        ApplyAttributesToMaterial();
    }
Exemplo n.º 2
0
    public override void ForceSpawn()
    {
        var attributes = new NeedsAttributes();

        attributes.Randomize();

        attributes.Model = AllowedMeshes[Main.Instance.Rand.Next(AllowedMeshes.Length)];
        var model = attributes.GetModel();

        var entity = Instantiate(model, GetNextSpawnLocation(), Quaternion.Euler(ForcedRotation));

        var lostItem = entity.GetComponent <LostItemEntity>();

        lostItem.Attributes = attributes;
        lostItem.ApplyAttributesToMaterial();

        lostItem.DestroyCallback += OnSpawnedDestroyed;
        lostItem.tag              = "Item";

        SpawnedEntities.Add(entity);
    }