static void Postfix(Peeper __instance) { if (rechargeIntervalInitial == 0) { rechargeIntervalInitial = __instance.rechargeInterval; } __instance.rechargeInterval = rechargeIntervalInitial * Main.config.dayNightSpeed; }
static void Postfix(Peeper __instance) { var gameObject = __instance.gameObject; var texture = Main.LoadTexture(@"./QMods/Geeper/Geeper.png"); var model = gameObject.FindChild("model").FindChild("peeper").FindChild("aqua_bird").FindChild("peeper"); var skinnedRenderer = model.GetComponent <SkinnedMeshRenderer>(); skinnedRenderer.sharedMaterial.mainTexture = texture; }
public static GameObject Find_peeper(Peeper __instance) { var gameObject = __instance.gameObject; try { Console.WriteLine("utils succes"); return(gameObject.FindChild("model").FindChild("peeper").FindChild("aqua_bird").FindChild("peeper"));//.FindChild("Stalker_02").FindChild("snout_shark_geo"); ; } catch { Console.WriteLine("utils fail"); return(gameObject); } }
static void Postfix(Peeper __instance) { try { var model = Findpeeper.Find_peeper(__instance); Console.WriteLine("[PeeperCamo]gameobject loaded succesfully"); if (model != null) { var skinnedRenderer = model.GetComponent <SkinnedMeshRenderer>(); var texture = TextureUtils.LoadTexture(@"./QMods/PeeperCamo/sandsharkCamoDiff.png", "Peeper"); skinnedRenderer.sharedMaterial.mainTexture = texture; Console.WriteLine("[peeperCamo] Running as intended![this is a message to see if the peeper creature gets called properly]"); } else { Console.WriteLine("[PeeperCamo slot1] Error: Model is null"); } } catch (Exception e) { string naam = "beeber"; Console.WriteLine("[" + naam + "]" + e.Message); } }
protected bool TryEat(GameObject preyGameObject, bool holdingByPlayer = false) { bool result = false; BehaviourType behaviourType = BehaviourData.GetBehaviourType(preyGameObject); if (this.CanEat(behaviourType, holdingByPlayer)) { base.SendMessage("OnFishEat", preyGameObject, SendMessageOptions.DontRequireReceiver); float num = 1f; if (behaviourType == BehaviourType.MediumFish) { num = 1.5f; } if (behaviourType == BehaviourType.Shark) { num = 3f; } if (preyGameObject.GetComponent <Creature>() != null) { UnityEngine.Object.Destroy(preyGameObject); } this.creature.Hunger.Add(-this.eatHungerDecrement * num); this.creature.Happy.Add(this.eatHappyIncrement * num); Peeper component = preyGameObject.GetComponent <Peeper>(); if (component != null && component.isHero) { InfectedMixin component2 = base.GetComponent <InfectedMixin>(); if (component2 != null) { component2.Heal(0.5f); } } result = true; } return(result); }