#pragma warning disable 618 public void Start() { if (!slotLibrary) { slotLibrary = GameObject.Find("SlotLibrary").GetComponent <SlotLibraryBase>(); } if (!raceLibrary) { raceLibrary = GameObject.Find("RaceLibrary").GetComponent <RaceLibraryBase>(); } if (!overlayLibrary) { overlayLibrary = GameObject.Find("OverlayLibrary").GetComponent <OverlayLibraryBase>(); } if (Instance == null) { Instance = this; } }
#pragma warning disable 618 public void Start() { if (!slotLibrary) { slotLibrary = GameObject.Find("SlotLibrary").GetComponent <SlotLibraryBase>(); } if (!raceLibrary) { raceLibrary = GameObject.Find("RaceLibrary").GetComponent <RaceLibraryBase>(); } if (!overlayLibrary) { overlayLibrary = GameObject.Find("OverlayLibrary").GetComponent <OverlayLibraryBase>(); } // Note: Removed null check so that this is always assigned if you have a UMAContext in your scene // This will avoid those occasions where someone drops in a bogus context in a test scene, and then // later loads a valid scene (and everything breaks) Instance = this; }
void GenerateUMA() { umaDynamicAvatar = avatarGOFactory.Create(); GameObject player = umaDynamicAvatar.gameObject; player.name = "MyUMA"; this.slotLibrary = umaDynamicAvatar.context.slotLibrary; this.overlayLibrary = umaDynamicAvatar.context.overlayLibrary; this.raceLibrary = umaDynamicAvatar.context.raceLibrary; umaData = player.AddComponent <UMAData> (); umaDynamicAvatar.umaData = umaData; umaData.umaRecipe = CreateMaleRecipe(); // Generate UMA umaDynamicAvatar.UpdateNewRace(); Animator animator = player.GetComponent <Animator>(); // controller.m_Animator = animator; }