コード例 #1
0
 public void SetSelection(LevelBuilderAsset asset, GamepadPoll gamepad)
 {
     foreach (var child in gameObject.GetComponentsInChildren <LevelEditorSpawnButtonGroup>())
     {
         if (child.IsMyModkeyPressed(gamepad))
         {
             child.SetResourceSelection(asset, gamepad);
         }
     }
 }
コード例 #2
0
 public bool ShouldSpawn(GamepadPoll gamepad, out LevelBuilderAsset targetToSpawn)
 {
     targetToSpawn = null;
     foreach (var child in gameObject.GetComponentsInChildren <LevelEditorSpawnButtonGroup>())
     {
         if (child.ShouldSpawn(gamepad, out targetToSpawn))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
 public bool ShouldSpawn(GamepadPoll gamepad, out LevelBuilderAsset objectToSpawn)
 {
     objectToSpawn = null;
     if (IsMyModkeyPressed(gamepad))
     {
         if (gamepad.GetButtonDown(Gamepad.Button.X))
         {
             objectToSpawn = xObject;
         }
         if (gamepad.GetButtonDown(Gamepad.Button.Y))
         {
             objectToSpawn = yObject;
         }
         if (gamepad.GetButtonDown(Gamepad.Button.B))
         {
             objectToSpawn = bObject;
         }
     }
     return(objectToSpawn != null);
 }
コード例 #4
0
 public void SetResourceSelection(LevelBuilderAsset asset, GamepadPoll gamepad)
 {
     if (IsMyModkeyPressed(gamepad))
     {
         if (gamepad.GetButtonDown(Gamepad.Button.X))
         {
             xObject = asset;
             SetThumbnail("X_Thumbnail", asset.icon);
         }
         else if (gamepad.GetButtonDown(Gamepad.Button.Y))
         {
             yObject = asset;
             SetThumbnail("Y_Thumbnail", asset.icon);
         }
         else if (gamepad.GetButtonDown(Gamepad.Button.B))
         {
             bObject = asset;
             SetThumbnail("B_Thumbnail", asset.icon);
         }
     }
 }