Created
August 25, 2016 20:12
-
-
Save CloudyWater/ed3d82a7ed6170ab0104a0290a305e26 to your computer and use it in GitHub Desktop.
Basic Menagerie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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