Created
April 14, 2013 02:48
-
-
Save kovek/5381171 to your computer and use it in GitHub Desktop.
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
// BaseObj.cs | |
using UnityEngine; | |
using System.Collections; | |
public class BaseObj : MonoBehaviour { | |
public TextMesh template; | |
public float health; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} | |
public interface IInteractive{ | |
void clicked(); | |
} | |
// Building.sc | |
using UnityEngine; | |
using System.Collections; | |
public class Building : BaseObj, IInteractive { | |
private float money; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
public void clicked(){ | |
HUDisplay.displayInfo( this ); | |
} | |
} | |
// HUDisplay.cs | |
using UnityEngine; | |
using System.Collections; | |
public class HUDisplay : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
public void displayInfo(BaseObj theObject){ | |
Debug.Log (theObject.health); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment