TileComponent script

A script for components that can be assigned to Tile.

Scripts can be created by inheriting TileComponent.

Script example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using UnityEngine;
using System.Collections;

namespace Nostalgia.Example
{
	[AddScriptMenu("Example/Ground")]
	public class GroundTile : TileComponent
	{
		public AudioClip footStepClip;
		public GameObject spawnObject;
	}
}

Interface

By implementing a specific interface on the TileComponent, you will be able to receive events related to the tiles of the Map component.

ITileCallbackReceiver

Called when a tile is placed / deleted.

See Script Reference: ITileCallbackReceiver for more information.

ITileCollisionReceiver

Called when a tile collides with something.

See Script Reference: ITileCollsiionReceiver for more information.

Attribute

It is an attribute that can be set in TileComponent.

AddScriptMenuAttribute

You can specify the menu name to be displayed in the TileComponent selection window.

See Script Reference: AddScriptMenuAttribute for more information.