コード例 #1
0
ファイル: DynamicPattern.cs プロジェクト: Quick4time/2DUnity
 // On Startup, assign jobs to the worker, note this is configurable instead of fixed
 void Start()
 {
     // Peons get lots of work to do
     if (WorkerType == "Peon")
     {
         ActionToDo += DoJob1;
         ActionToDo += DoJob2;
     }
     else
     {
         ActionToDo += DoJob3;
     }
 }
コード例 #2
0
ファイル: Delegates.cs プロジェクト: Quick4time/2DUnity
 //On Startup, assign jobs to the worker, note this is configurable instead of fixed
 void Start()
 {
     //Peons get lots of work to do
     if (WorkerType == "Peon")
     {
         ActionsToDo += DoJob1;
         ActionsToDo += DoJob2;
     }
     //Everyone else plays golf
     else
     {
         ActionsToDo += DoJob3;
     }
 }