public void onTransition(Dictionary <string, object> parameters) { // clear existing entity list entities.Clear(); // pull input objects from parameters and initialize players from them for (int i = 0; i < 4; i++) { string key = "player" + (i + 1); if (!parameters.ContainsKey(key)) { continue; } PlayerSelection selection = (PlayerSelection)(parameters[key]); if (selection == null) { continue; } } }
public void SetSelection(PlayerSelection selection, int direction) { string selectedName; Texture2D selectedSprite; if (animationDirection == -1) { selectedName = previousName; selectedSprite = previousSprite; } else { selectedName = currentName; selectedSprite = currentSprite; } if (direction == -1) { currentName = selectedName; currentSprite = selectedSprite; // come in from the right previousName = PlayerCostume.playerCostumes[selection.playerSpriteId].name; previousSprite = PlayerCostume.playerCostumes[selection.playerSpriteId].texture; } else { // come in from the left previousName = selectedName; previousSprite = selectedSprite; currentName = PlayerCostume.playerCostumes[selection.playerSpriteId].name; currentSprite = PlayerCostume.playerCostumes[selection.playerSpriteId].texture; } animationDirection = direction; animationTime = 0; }