public void SetSelection(LevelBuilderAsset asset, GamepadPoll gamepad) { foreach (var child in gameObject.GetComponentsInChildren <LevelEditorSpawnButtonGroup>()) { if (child.IsMyModkeyPressed(gamepad)) { child.SetResourceSelection(asset, gamepad); } } }
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); }
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); }
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); } } }