Skip to content

Instantly share code, notes, and snippets.

@CloudyWater
Created August 25, 2016 20:12
Show Gist options
  • Save CloudyWater/ed3d82a7ed6170ab0104a0290a305e26 to your computer and use it in GitHub Desktop.
Save CloudyWater/ed3d82a7ed6170ab0104a0290a305e26 to your computer and use it in GitHub Desktop.
Basic Menagerie
public class Menagerie : MonoBehaviour
{
public abstract class Animal
{
public int mNumLegs;
public string mName;
public abstract string Cry ();
}
public class Dog : Animal
{
public override string Cry ()
{
return "woof";
}
}
public class Cat : Animal
{
public override string Cry ()
{
return "meow";
}
}
public Cat mCat;
public Dog mDog;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment