string RulesInterface.action() { string[] possibleAttacks = AnimationStates.GetGroundAttacks(); int randomAttack = Random.Range(0, possibleAttacks.Length - 1); return(possibleAttacks[randomAttack]); }
string RulesInterface.action() { string animationToPlay = ""; float randomValue = Random.value; if (randomValue < 0.6) { string[] possibleAttacks = AnimationStates.GetGroundAttacks(); int randomAttack = Random.Range(0, possibleAttacks.Length - 1); animationToPlay = possibleAttacks[randomAttack]; } else if (randomValue > 0.6 && randomValue < 0.8) { animationToPlay = AnimationStates.WALK_BACKWARDS; } else if (randomValue > 0.8 && randomValue < 0.9) { animationToPlay = AnimationStates.JUMPING_BACKWARDS; } else { animationToPlay = AnimationStates.JUMPING_UP; } return(animationToPlay); }