VZ/Assets/Scripts/ZombieUnit.cs
Samuel 5837a7f2c9 - Added Tag manager
- Added Class ZombieUnit (extends the Unit class)
- Added class VampireUnit (extends the Unit class)
2015-08-11 12:09:17 -04:00

37 lines
750 B
C#

using System;
using UnityEngine;
using System.Collections;
public class ZombieUnit : Unit
{
// Use this for initialization
void Start()
{
InitializeDefaultTag();
}
// Update is called once per frame
void Update()
{
}
private void InitializeDefaultTag()
{
try
{
this.Tag = TagManager.ZombiePlayer; // set the tag to Zombie
}
catch (IndexOutOfRangeException ex)
{
Debug.LogError("Please set a zombie Tag, check the Tag & layers in the inspector!\n" + ex);
}
// set the tag of the gameObject to zombie
if (this.gameObject.tag != Tag)
{
this.gameObject.tag = Tag;
}
}
}