예제 #1
0
 public static void Accept(PlayerController player, GameObject npc)
 {
     npc.GetComponent <tk2dSpriteAnimator>().PlayForDuration("doEffect", -1, "idle");
     CharacterBuilder.StripPlayer(player);
     HandleLoadout(player);
     HandleStats(player);
     storedPlayer = player;
 }
예제 #2
0
        public static void Init()
        {
            try
            {
                if (!Directory.Exists(CharacterDirectory))
                {
                    DirectoryInfo dir = Directory.CreateDirectory(CharacterDirectory);
                    ETGModConsole.Log("Created directory: " + dir.FullName);
                }
            }
            catch (Exception e)
            {
                Tools.PrintError("Error creating custom character directory");
                Tools.PrintException(e);
            }

            LoadCharacterData();
            foreach (CustomCharacterData data in characterData)
            {
                bool success = true;
                try
                {
                    CharacterBuilder.BuildCharacter(data);
                }
                catch (Exception e)
                {
                    success = false;
                    Tools.PrintError("An error occured while creating the character: " + data.name);
                    Tools.PrintException(e);
                }
                if (success)
                {
                    Tools.Print("Built prefab for: " + data.name);
                }
            }
        }