You are viewing a potentially older version of this package. View all versions.
Brynzananas-Freaky_Eyes-1.0.0 icon

Freaky Eyes

Date uploaded a year ago
Version 1.0.0
Download link Brynzananas-Freaky_Eyes-1.0.0.zip
Downloads 114
Dependency string Brynzananas-Freaky_Eyes-1.0.0

This mod requires the following mods to function

Brynzananas-Body_Model_Additions_API-1.4.3 icon
Brynzananas-Body_Model_Additions_API

Adds a system for developers to load custom objects onto characters in game and in lobby. Model additions can require selected skins, skills, skins and skills or custom condition.

Preferred version: 1.4.3

README

Created using https://thunderstore.io/package/Brynzananas/Body_Model_Additions_API/

All code as an example:

using R2API.Utils;
using System.Security.Permissions;
using System.Security;
using static BodyModelAdditionsAPI.Main;
using UnityEngine;
using RoR2;
using System;
using UnityEngine.AddressableAssets;
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: HG.Reflection.SearchableAttribute.OptIn]
[assembly: HG.Reflection.SearchableAttribute.OptInAttribute]
[module: UnverifiableCode]
#pragma warning disable CS0618
#pragma warning restore CS0618
namespace FreakyEyes
{
    [BepInPlugin(ModGuid, ModName, ModVer)]
    [BepInDependency(R2API.R2API.PluginGUID, R2API.R2API.PluginVersion)]
    //[R2APISubmoduleDependency(nameof(CommandHelper))]
    [System.Serializable]
    public class Main : BaseUnityPlugin
    {
        public const string ModGuid = "com.brynzananas.freakyeyes";
        public const string ModName = "Freaky Eyes";
        public const string ModVer = "1.0.0";
        public static AssetBundle assetBundle;
        public static PluginInfo PInfo { get; private set; }
        public void Awake()
        {
            PInfo = Info;
            assetBundle = AssetBundle.LoadFromFile(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(PInfo.Location), "assetbundles", "freakyeye"));
            foreach (Material material in assetBundle.LoadAllAssets<Material>())
            {
                if (!material.shader.name.StartsWith("StubbedRoR2"))
                {
                    continue;
                }
                string shaderName = material.shader.name.Replace("StubbedRoR2", "RoR2") + ".shader";
                Shader replacementShader = Addressables.LoadAssetAsync<Shader>(shaderName).WaitForCompletion();
                if (replacementShader)
                {
                    material.shader = replacementShader;
                }
            }
            new ModelPart("FlyingVerminBody", assetBundle.LoadAsset<GameObject>("Assets/CosmeticsMod/googlyeye.prefab"), "Body", inputCodeAfterApplying: PlaceIt);
            void PlaceIt(GameObject modelObject, ChildLocator childLocator, CharacterModel characterModel)
            {
                modelObject.transform.localPosition = new Vector3(-0.45f, 0.641f, .89f);
                modelObject.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
            }
            new ModelPart("FlyingVerminBody", assetBundle.LoadAsset<GameObject>("Assets/CosmeticsMod/googlyeye.prefab"), "Body", inputCodeAfterApplying: PlaceIt2);
            void PlaceIt2(GameObject modelObject, ChildLocator childLocator, CharacterModel characterModel)
            {
                modelObject.transform.localPosition = new Vector3(0.45f, 0.641f, .89f);
                modelObject.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
            }
        }

        
    }
}

CHANGELOG

1.3.1

  • Added a nullcheck to prevent log spam

  • Added configs for enabling/disabling eyes for individual body

1.3.0

  • Updated to use newer API method

  • Freaky eyes now look at their targets

1.2.0

  • Added API dependency string

  • Added eyes to Lemurian and Elder Lemurian

1.1.0

  • Updated to the new API version

  • Added eyes to Blind Vermin