Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Crafting System and Building placement for unity3D

License

NotificationsYou must be signed in to change notification settings

RaulMrSouza/Unity-Crafting-System

Repository files navigation

Crafting System and First Person Object placement for Unity

Playable WebGL:http://RaulMrSouza.github.io/SimpleCraftWebGL

Package:https://github.com/RaulMrSouza/SimpleCraft/blob/master/SimpleCraft.unitypackage

Asset Store(old version):https://assetstore.unity.com/packages/templates/systems/simple-craft-system-107967

Video:https://www.youtube.com/watch?v=V9Pm6ZkJ0Yc

The gameplay idea is that the player will use Tools to gather Resources in orderto build Craftable Items or more Tools.

The project purpose is to be simplistic and easy to be expanded. In other words, easyto add more resources, tools and craftable items.

It is not required to know scripting to use and expand this asset.

The Demo scene is a good way to see how it works

Now some information about the project:

To properly run the Simple Craft system on a scene it is required to have thefollowing prefabs:

  • Resources;
  • Craftable Items;
  • Tools;
  • a Settlement Manager;
  • a Character;

About Items

Items are the base prefabs in the crafting system, they can be grabbed intothe inventory and used for other purposes.

To create a new item just create an Item scriptableObject using Create->SimpleCraft->Itemand set a Prefab with a Collider and an Item Refence script to be the physical object ofthe Item.

About Resources

Each Resource has a amount of a certain Item. when gathered with a tool the Itemswill be transferred to the player's inventory.

About Craftable Items

It must have a cost in Items to be crafted. For instance, a table costs planks to becrafted, and the plank cost woods.

Each possible craftable item in the scene must be on the Manager's Items structure,so that it can be instantiated.

The process of creating a new Craftable Item is equal to create a new item plusfilling the craft cost, one thing that can be tricky it's the position, the object'spivot should be right bellow the object components while the detection collidershould be placed where it can validates where the object can be crafted, look atthe already existing craftable Items to have an example.

About Tools

A tool is a craftable item.

Each tool has a GatherFactor which is used to define which resources the toolis good or bad to use at. For example, in the default tools, the axe is betterto gather wood, the pickaxe better at gold and stone and the hammer is neutral.

The tool requires that the main object or one of its children has a triggercollider, which will be used to detect collisions between the tool and resources.

About the Settlement Manager

It is responsible for the instantiation of craftable Items, therefore theinstantiation of tools.

Each craftable item, including tools, must be on the Manager's Items structure.

They must be separated in categories, the default are furniture, tools, buildingsand materials, more can be added in the editor.

The Manager also can be used to check the goal of the scene with the prpertyobjectiveItem. Check the Demo scene to better understand this feature.

About the Character

The default character has a Player.cs script in the camera, already set to work with a tool handler and a fps style character controlerand the canvas objects.

The Player has an Inventory of Items that can be used to build new CraftableItems and can equipa tool.

About

Crafting System and Building placement for unity3D

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp