Created
February 9, 2012 18:16
-
-
Save jakevsrobots/1781746 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
#pragma strict | |
#pragma downcast | |
class SpeakingCharacter extends MonoBehaviour { | |
// ------------------------------------------ | |
// Properties | |
// ------------------------------------------ | |
public var characterName : String; | |
public var conversationXMLFile : TextAsset; | |
// ------------------------------------------ | |
// Unity callbacks | |
// ------------------------------------------ | |
public function Start() : void { | |
if(conversationXMLFile == null || characterName == null) { | |
throw "The SpeakingCharacter object " + gameObject.name + " is missing a conversation file or character name."; | |
} | |
//StageManager.RegisterComponent(this, GameState.exploring); | |
} | |
// Just for testing, probably: | |
public function OnMouseUp() : void { | |
// So, only Update() and OnGUI() care about 'MonoBehaviour.enabled' I guess | |
if(this.enabled) { | |
StartConversation(); | |
} | |
} | |
// ------------------------------------------ | |
// Private methods | |
// ------------------------------------------ | |
private function StartConversation():void { | |
StageManager.StartConversationWithCharacter(gameObject); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment