static void Prefix(ref GameObject gordoObj) { if (!SRRandomizer.gordo_randomizeFoodRequirement) { return; } GordoEat gordoEat = gordoObj.GetComponent <GordoEat>(); gordoEat.targetCount = SRRandomizer.GetRandomizedGordoFoodTarget(); //SlimeDefinitions slimeDefinitions = SRSingleton<GameContext>.Instance.SlimeDefinitions; //gordoEat.slimeDefinition = slimeDefinitions.GetSlimeByIdentifiableId(Identifiable.Id.TABBY_SLIME); }
protected override void Build() { // Load Material ModelMat = CreateModelMat(); // Get GameObjects Prefab = PrefabUtils.CopyPrefab(BaseItem); Prefab.name = NamePrefix + Name; Prefab.transform.localScale = Scale; GameObject child = Prefab.transform.Find("Full size/slime_gordo").gameObject; // Load Components GordoEat eat = Prefab.GetComponent <GordoEat>(); GordoRewards rew = Prefab.GetComponent <GordoRewards>(); GordoDisplayOnMap disp = Prefab.GetComponent <GordoDisplayOnMap>(); GordoIdentifiable iden = Prefab.GetComponent <GordoIdentifiable>(); MeshFilter filter = Prefab.FindChild("Full size").GetComponent <MeshFilter>(); SkinnedMeshRenderer render = child.GetComponent <SkinnedMeshRenderer>(); // Setup Components filter.sharedMesh = Mesh; eat.slimeDefinition = Definition; eat.targetCount = TargetCount; List <GameObject> rews = new List <GameObject>(); if (Rewards != null) { foreach (Identifiable.Id id in Rewards) { rews.Add(GameContext.Instance.LookupDirector.GetPrefab(id)); } } rew.rewardPrefabs = rews.ToArray(); iden.id = ID; iden.nativeZones = NativeZones; disp.markerPrefab = MarkerPrefab ? MarkerPrefab : disp.markerPrefab; render.sharedMaterial = ModelMat; }