using System;
using MSCLoader;
using UnityEngine;
using Object = System.Object;
namespace NSR50
{
public class NSR50 : Mod
{
public override string ID => "g_NSR50"; //Your mod ID (unique)
public override string Name => "g_NSR50"; //You mod name
public override string Author => "gosuke"; //Your Username
public override string Version => "1.0"; //Version
// Set this to true if you will be load custom assets from Assets folder.
// This will create subfolder in Assets folder for your mod.
public override bool UseAssetsFolder
{
get
{
return true;
}
}
public override void OnNewGame()
{
// Called once, when starting a New Game, you can reset your saves here
}
public override void OnLoad()
{
// Called once, when mod is loading after game is fully loaded
//アセットの読み込み
this.ab = LoadAssets.LoadBundle(this, "nsr50.unity3d");
//メッシュの読み込み
this.frame = this.ab.LoadAsset("frame.fbx") as GameObject;
//マテリアルの読み込み
this.nsrMat = this.ab.LoadAsset("nsrMat.mat") as Material;
this.ab.Unload(false);
this.frame = UnityEngine.Object.Instantiate<GameObject>(this.frame);
UnityEngine.Object.Destroy(this.frame);
//メッシュの置き換え
GameObject.Find("JONNEZ ES(Clone)/MESH/frame").GetComponent<MeshFilter>().sharedMesh = this.frame.GetComponentInChildren<MeshFilter>().sharedMesh;
//マテリアルの置き換え
GameObject.Find("JONNEZ ES(Clone)/MESH/frame").GetComponent<MeshRenderer>().sharedMaterial = this.nsrMat;
//位置・向き・スケールの設定
GameObject.Find("JONNEZ ES(Clone)/MESH/frame").transform.localPosition = new Vector3(0f, 0f, 0f);
GameObject.Find("JONNEZ ES(Clone)/MESH/frame").transform.localEulerAngles = new Vector3(0f, 0f, 0f);
GameObject.Find("JONNEZ ES(Clone)/MESH/frame").transform.localScale = new Vector3(1f, 1f, 1f);
}
private AssetBundle ab;
private GameObject frame;
private Material nsrMat;
}
}