GithubHelp home page GithubHelp logo

2d-techdemos's Introduction

2d-techdemos

2d-techdemos is a repository containing helpful examples of 2D features with scenes and assets. It contains the asset implementations of the scripts available in its sister repository, 2d-extras.

All items in the repository are grouped by use for a feature and are listed below.

How to use this

This repository is a Unity project which you can open using Unity. To view the examples in an existing Unity project, please copy the contents in the Assets folder to the Assets folder of your existing project as well as the manifest.json file in the Packages folder.

As this repository contains the scripts from 2d-extras as a package, you do not need to include the files from the 2d-extras repository to this.

Features

Tilemap

  • Brick - A Breakout style game using Tilemap and Physics 2D. This example makes use of the Physics2D collision contacts to determine which cell in the Tilemap is hit when there is a collision. Open the scene Brick to get started. Run this example to start playing.

  • Destructible - A demo using Tilemap and Scripted Tiles showing how Tilemaps can changed in the Runtime. Open the scene Destructible to get started. Run this example by playing it and click on a location to cause an explosion and watch the after-effects.

  • Brushes - The Scripted Brushes can be selected from the dropdown at the bottom of the Tile Palette. Choose the Brush you want to paint with and start painting. Pull up the Brush dropdown bar to view additional parameters for the chosen Brush.

  • Tiles - Tile Palettes have been set up for each of the different types of Scripted Tiles. Choose the Tile Palette containing the Tile asset that you want. To find out more on how the Tile asset is set up:

    • Select the Tile in the Tile Palette
    • Right-click on the Tile Palette
    • Click on Select Tile Asset
  • Palette Swap - A demo using Tilemap showing how Tiles in a Tilemap can be swapped between different Palette Prefabs. Open the scene Palette Swap to get started. Run this example by playing it and using the A and D keys to swap between palettes.

For use with Unity 2021.1.0f1 onwards. For prior Unity versions, the appropriate Unity Packages should be used for those versions.

2d-techdemos's People

Contributors

chuanxin-unity avatar foobraco avatar johnsoncodehk avatar juhaunity avatar ryotamurohoshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

2d-techdemos's Issues

Doesn't work on 2019.2

I know 2019.2 is on beta(i dont test on 2019.1)

but, is good to see what change to fix earlier... I think is change of package name.

Normal Mapping does not work with Unity 2021.1.27f1

I tried to import the files into my project, however the scene example's tilemap appears purple. In the "Normal Mapped Tile" shader, there is an annotation that says: "Material property is found in another cbuffer than "UnityPerMaterial"(_MainText_ST)".

Whatever happened to 2d-extras?

whenever I attempted to access the official 2d extras repository, nothing shows up. Did someone delete the file on accident? If not, why? If so, can it be fixed? If it can, is it being actively fixed? If it isn't, why? Transparency on such a popular asset package would be much appreciated.

Error after import

version: Unity 2020.3.18f1
url: https://github.com/Unity-Technologies/2d-extras.git
When I use Package Manager to import, one error is reported in the console.
Library/PackageCache/com.unity.2d.tilemap.extras@acb3c5a884/Editor/Tiles/RuleTile/RuleTileEditor.cs(327,26): error CS1061: 'ReorderableList' does not contain a definition for 'IsSelected' and no accessible extension method 'IsSelected' accepting a first argument of type 'ReorderableList' could be found (are you missing a using directive or an assembly reference?)

Change active brush in Tile Palette with GridPaintingState.gridBrush

I need change active brush in Tile Palette when active tilemap change in Tile Palette. I subscribe to scenePaintTargetChanged event.

GridPaintingState.scenePaintTargetChanged += GridPaintingState_scenePaintTargetChanged;

....

private void GridPaintingState_scenePaintTargetChanged(GameObject obj)
{
Debug.Log("Active Tilemap is " + obj);
if (obj.name == "Foo" )
{
// how Can I change GridPaintingState.gridBrush to one of the available brushes in drop-down list
}
}

Thanks!

Compile error when select Rule Override Tile in Tile Palette

Error ocurred when i was using 2018.2 branch with 2018.2.16f1.
Need help, Thanks!

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorUtility.InitInstantiatedPreviewRecursive (UnityEngine.GameObject go) (at C:/buildslave/unity/build/Editor/Mono/EditorUtility.cs:319)
UnityEditor.GridPaintPaletteWindow.ResetPreviewInstance () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:407)
UnityEditor.GridPaintPaletteClipboard.ResetPreviewInstance () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteClipboard.cs:276)
UnityEditor.GridPaintPaletteClipboard.OnAfterPaletteSelectionChanged () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteClipboard.cs:237)
UnityEditor.GridPaintPaletteWindow.set_palette (UnityEngine.GameObject value) (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:267)
UnityEditor.GridPaintPaletteWindow.SelectPalette (Int32 i, System.Object o) (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:840)
UnityEditor.FlexibleMenu.SelectItem (Int32 index) (at C:/buildslave/unity/build/Editor/Mono/GUI/FlexibleMenu/FlexibleMenu.cs:188)
UnityEditor.FlexibleMenu.OnGUI (Rect rect) (at C:/buildslave/unity/build/Editor/Mono/GUI/FlexibleMenu/FlexibleMenu.cs:129)
UnityEditor.PopupWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/PopupWindow.cs:92)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:104)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:216)
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.GridPaintPaletteClipboard.ScreenToGrid (Vector2 screenPosition) (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteClipboard.cs:903)
UnityEditor.PaintableGrid.UpdateMouseGridPosition () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/PaintableGrid.cs:106)
UnityEditor.GridPaintPaletteClipboard.OnGUI () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteClipboard.cs:355)
UnityEditor.GridPaintPaletteWindow.OnClipboardGUI (Rect position) (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:894)
UnityEditor.GridPaintPaletteWindow.OnGUI () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:356)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorUtility.InitInstantiatedPreviewRecursive (UnityEngine.GameObject go) (at C:/buildslave/unity/build/Editor/Mono/EditorUtility.cs:319)
UnityEditor.GridPaintPaletteWindow.ResetPreviewInstance () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:407)
UnityEditor.GridPaintPaletteClipboard.ResetPreviewInstance () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteClipboard.cs:276)
UnityEditor.GridPaintPaletteClipboard.Render () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteClipboard.cs:581)
UnityEditor.GridPaintPaletteClipboard.OnGUI () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteClipboard.cs:379)
UnityEditor.GridPaintPaletteWindow.OnClipboardGUI (Rect position) (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:894)
UnityEditor.GridPaintPaletteWindow.OnGUI () (at C:/buildslave/unity/build/Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs:356)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)

Not working on Unity 2020.3.10f1

Hello. I used this asset a few months ago when I was learning Unity and it worked just fine. I have attempted to use it now, and I receive the same error every time.

Assets\Tilemap\Rule Tiles\Rule Override Tile\ExampleSiblingRuleTile.cs(5,39): error CS0246: The type or namespace name 'RuleTile' could not be found (are you missing a using directive or an assembly reference?)

There are a few others of the same ilk. I have attempted to manually add it by the package manager, and when I have attempted that I receive either
"[Package Manager] Please select a valid package.json file in a package folder.
UnityEditor.GenericMenu:CatchMenu (object,string[],int)"

Or

"[Package Manager Window] Unable to add package [https://github.com/Unity-Technologies/2d-techdemos.git]:
[https://github.com/Unity-Technologies/2d-techdemos.git] does not point to a valid package repository. No package manifest was found. Verify the repository URL and make sure the package is located in the root folder of the repository.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()"

Please assist.

How do I use this in Unity?

I'm trying use the assets, but I can't seem to use it in the Tile Palette. I'm following the instructions:
To view the examples in an existing Unity project, please copy the contents in the Assets folder to the Assets folder of your existing project.

I do that, but then it doesn't show anything in the Tile Palette. I try to right click and then check the "Select Tile Asset" but.. it doesn't work.

Missing Asset

Upon loading the project the following error is observed.
Hexagonal rule tile asset may be missing from the project.

Removing Assets/Tilemap/Rule Tiles/Hexagonal Tile because the asset does not exist

Read.me

Hi, this is not a proper issue, but I'd like to complete the Read.me file for other people that will come in the futura. The problem is that me myself don't have a clue about how to use the tools in the project. Would anyone mind to give me some help? Thanks in advance.

Add Hexagonal Tilemap example

How about add Hexagonal Tilemap example assets and scene?

This project is so useful to describe Tilemap feature and Hexagonal Tilemap is one of the important feature for tilemap.

I think it is so good to add Hexagonal Tilemap example to 2d-techdemos.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.