示例#1
0
    //Returns a random sprite[]
    public RuntimeAnimatorController getSpriteController(CMoveCombatable character)
    {
        RuntimeAnimatorController[] spriteControllers;

        //If class is null
        if (character.getClass() == null)
        {
            character.chooseRandomClass();
        }

        switch (character.faction)
        {
        case (Faction.Player):
            spriteControllers = playerControllers;
            break;

        case (Faction.None):
            spriteControllers = NPCControllers;
            break;

        default:
            if (character.getClass().name == "Sharpshooter")
            {
                spriteControllers = shooterControllers;
            }
            else
            {
                spriteControllers = duelistControllers;
            }
            break;
        }


        int spriteSet = Random.Range(0, spriteControllers.Length); //Will never be 2

        return(spriteControllers[spriteSet]);
    }