add toolbar and function

master
wlt233 2 years ago
parent 2951321e24
commit 348838508b

@ -216,15 +216,15 @@ namespace Illusion
// RVA: 0x327C2BC Offset: 0x327C2BC VA: 0x327C2BC // RVA: 0x327C2BC Offset: 0x327C2BC VA: 0x327C2BC
public void SetSpecialEffect(int id) public void SetSpecialEffect(int id)
{ {
if (id >= 1) // if (id >= 1) // modify
{ //{
for (int i = 0; i < specialEffectList.Length; i++) for (int i = 0; i < specialEffectList.Length; i++)
{ {
specialEffectList[i].effect.SetActive(false); // modify specialEffectList[i].effect.SetActive(false); // modify
if (specialEffectList[i].id == id) if (specialEffectList[i].id == id)
specialEffectList[i].effect.SetActive(true); specialEffectList[i].effect.SetActive(true);
} }
} //}
} }
// RVA: 0x327C384 Offset: 0x327C384 VA: 0x327C384 // RVA: 0x327C384 Offset: 0x327C384 VA: 0x327C384

@ -11,13 +11,13 @@ public class Main : MonoBehaviour
private string abDir; private string abDir;
private List<string> abNameList = new List<string>(); private List<string> abNameList = new List<string>();
private int idx = 0; private int idx = 0;
private int count;
private GameObject charm; private GameObject charm;
private WeaponController controller; private WeaponController controller;
private AssetBundle bundle;
public List<int> styleId; public List<int> styleId;
private int style = -1; private int style = 0;
public List<int> effectId; public List<int> effectId;
private int effect = -1; private int effect = -1;
private int mode = 0; private int mode = 0;
@ -42,8 +42,7 @@ public class Main : MonoBehaviour
} }
t++; t++;
} }
count = abNameList.Count; LoadAb(abDir + '\\' +abNameList[idx % abNameList.Count]);
LoadAb(abDir + '\\' +abNameList[idx % count]);
} }
@ -58,7 +57,7 @@ public class Main : MonoBehaviour
void LoadAb(string abPath) void LoadAb(string abPath)
{ {
var bundle = AssetBundle.LoadFromFile(abPath); bundle = AssetBundle.LoadFromFile(abPath);
foreach (var name in bundle.GetAllAssetNames()) foreach (var name in bundle.GetAllAssetNames())
{ {
Debug.Log(name); Debug.Log(name);
@ -68,13 +67,14 @@ public class Main : MonoBehaviour
controller = charm.GetComponent<WeaponController>(); controller = charm.GetComponent<WeaponController>();
charm.AddComponent<MouseControlModel>(); charm.AddComponent<MouseControlModel>();
styleId.Clear(); styleId.Clear();
style = -1; style = 0;
for (int i = 0; i < controller.weaponMaterialList.Length; i++) for (int i = 0; i < controller.weaponMaterialList.Length; i++)
{ {
styleId.Add(controller.weaponMaterialList[i].colorIndex); styleId.Add(controller.weaponMaterialList[i].colorIndex);
} }
effectId.Clear(); effectId.Clear();
effect = -1; effect = 0;
effectId.Add(-1);
for (int i = 0; i < controller.specialEffectList.Length; i++) for (int i = 0; i < controller.specialEffectList.Length; i++)
{ {
effectId.Add(controller.specialEffectList[i].id); effectId.Add(controller.specialEffectList[i].id);
@ -83,7 +83,7 @@ public class Main : MonoBehaviour
} }
void ChangeMode() public void ChangeMode()
{ {
mode++; mode++;
controller.SetAnimeSpeed(.5f); controller.SetAnimeSpeed(.5f);
@ -93,4 +93,24 @@ public class Main : MonoBehaviour
controller.WeaponChangeOnly(WeaponMode.WeaponTypeB); controller.WeaponChangeOnly(WeaponMode.WeaponTypeB);
} }
public void ChangeSkin()
{
style++;
controller.ChangeWeaponStyle(styleId[style % styleId.Count]);
}
public void ChangeEffect()
{
effect++;
controller.SetSpecialEffect(effectId[effect % effectId.Count]);
}
public void NextAb()
{
idx++;
if (charm) Destroy(charm);
if (bundle) bundle.Unload(true);
Camera.main.fieldOfView = 50;
LoadAb(abDir + '\\' +abNameList[idx % abNameList.Count]);
}
} }

File diff suppressed because it is too large Load Diff

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Toolbar : MonoBehaviour
{
private CanvasGroup bar;
void Start()
{
bar = this.GetComponent<CanvasGroup>();
}
public void EnterUIShow()
{
bar.alpha = 1;
}
public void ExitUIHide()
{
bar.alpha = 0;
}
void Update()
{
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 72bc915e322253842b5077e9efbc84f4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save