Changeset 8304 in orxonox.OLD for branches/script_engine/src/world_entities
- Timestamp:
- Jun 10, 2006, 8:51:17 AM (19 years ago)
- Location:
- branches/script_engine/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/world_entities/script_trigger.cc
r8289 r8304 6 6 7 7 #include "state.h" 8 9 10 8 9 10 11 11 ScriptTrigger::ScriptTrigger(const TiXmlElement* root) 12 12 { 13 13 this->setClassID(CL_SCRIPT_TRIGGER, "ScriptTrigger"); 14 14 this->toList(OM_COMMON); 15 15 16 debugDraw = false; 16 17 scriptCalled = false; 17 18 scriptIsOk = false; … … 55 56 .describe("True if the script shoul only be called once") 56 57 .defaultValues(""); 58 LoadParam(root, "debugdraw", this, ScriptTrigger, setDebugDraw) 59 .describe("True if the script shoul only be called once") 60 .defaultValues(""); 57 61 } 58 62 … … 91 95 void ScriptTrigger::tick(float timestep) 92 96 { 93 97 94 98 if( this->distance(target) < radius) 95 99 { … … 125 129 void ScriptTrigger::setScript(const std::string& file) 126 130 { 127 131 128 132 ScriptManager* scriptManager = State::getScriptManager(); 129 133 if (scriptManager != NULL) 130 134 { 131 135 132 136 script = scriptManager->getScriptByFile(file); 133 137 if(script != NULL) -
branches/script_engine/src/world_entities/script_trigger.h
r8271 r8304 34 34 void setScript(const std::string& file); 35 35 void setFunction(const std::string& function){ this->functionName = function; } 36 36 void setDebugDraw(const bool draw) { this->debugDraw = draw; } 37 37 38 ///DRAWING 38 void draw()const{ this->debugDraw();};39 void draw()const{if(debugDraw)this->debugDraw();}; 39 40 40 41 private: … … 46 47 Script* script; 47 48 std::string functionName; 49 bool debugDraw; 48 50 49 51 //for internal use
Note: See TracChangeset
for help on using the changeset viewer.