コード例 #1
0
 public void OnPropCreated(Prop prop)
 {
     //shows an example of how you could get a handle on the prop game objects to perform different game logic
     if (mReconstructionBehaviour)
     {
         mReconstructionBehaviour.AssociateProp(PropTemplate, prop);
         PropAbstractBehaviour behaviour;
         if (mReconstructionBehaviour.TryGetPropBehaviour(prop, out behaviour))
         {
             behaviour.gameObject.name = "Prop " + prop.ID;
         }
     }
 }
コード例 #2
0
 //对边塔的生成进行监听回调
 public void OnPropCreated(Prop prop)
 {
     //此处可以根据prop相关信息为其挂载不同的游戏逻辑
     //同时对于prop数量进行监控
     if (mReconstructionBehaviour && num < maxProp)
     {
         mReconstructionBehaviour.AssociateProp(PropTemplate, prop);
         PropAbstractBehaviour behaviour;
         if (mReconstructionBehaviour.TryGetPropBehaviour(prop, out behaviour))
         {
             behaviour.gameObject.name = "Prop " + prop.ID;
         }
         //增加边塔数量
         num++;
     }
 }