You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

242 lines
7.7 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
//using DG.Tweening;
// code disassembled from version 3.17.1
namespace Illusion
{
[Serializable]
public class weaponMaterialType
{
// Token: 0x06009E4E RID: 40526 RVA: 0x00002053 File Offset: 0x00000253
//[Token(Token = "0x6007965")]
//[Address(RVA = "0x3429360", Offset = "0x3429360", VA = "0x3429360")]
public weaponMaterialType()
{
;
}
// Token: 0x04005EB1 RID: 24241
//[Token(Token = "0x4003D49")]
//[FieldOffset(Offset = "0x10")]
public int colorIndex;
// Token: 0x04005EB2 RID: 24242
//[Token(Token = "0x4003D4A")]
//[FieldOffset(Offset = "0x18")]
public Material colorMat;
}
[Serializable]
public class SpecialEffectType
{
// Token: 0x06009E4F RID: 40527 RVA: 0x00002053 File Offset: 0x00000253
//[Token(Token = "0x6007966")]
//[Address(RVA = "0x2F3C290", Offset = "0x2F3C290", VA = "0x2F3C290")]
public SpecialEffectType()
{
;
}
// Token: 0x04005EB3 RID: 24243
//[Token(Token = "0x4003D4B")]
//[FieldOffset(Offset = "0x10")]
public int id;
// Token: 0x04005EB4 RID: 24244
//[Token(Token = "0x4003D4C")]
//[FieldOffset(Offset = "0x18")]
public GameObject effect;
}
//[Token(Token = "0x2000AE4")]
public enum WeaponMode
{
// Token: 0x04004FD6 RID: 20438
//[Token(Token = "0x4003349")]
WeaponTypeA = 1,
// Token: 0x04004FD7 RID: 20439
//[Token(Token = "0x400334A")]
WeaponTypeB
}
public class WeaponController : MonoBehaviour // TypeDefIndex: 10711
{
// Fields
public Animator weapon; // 0x18
[SerializeField] // RVA: 0x16333E0 Offset: 0x16333E0 VA: 0x16333E0
private SkinnedMeshRenderer meshRenderer; // 0x20
[SerializeField] // RVA: 0x16333F0 Offset: 0x16333F0 VA: 0x16333F0
//private weaponMaterialType[] weaponMaterialList; // 0x28
public weaponMaterialType[] weaponMaterialList; // 0x28
[SerializeField] // RVA: 0x1633400 Offset: 0x1633400 VA: 0x1633400
private Transform[] weaponCenterPos; // 0x30
[SerializeField] // RVA: 0x1633410 Offset: 0x1633410 VA: 0x1633410
private GameObject[] weaponEffects1; // 0x38
[SerializeField] // RVA: 0x1633420 Offset: 0x1633420 VA: 0x1633420
private GameObject[] weaponEffects2; // 0x40
[SerializeField] // RVA: 0x1633430 Offset: 0x1633430 VA: 0x1633430
private GameObject[] weaponEffects3; // 0x48
[SerializeField] // RVA: 0x1633440 Offset: 0x1633440 VA: 0x1633440
//private SpecialEffectType[] specialEffectList; // 0x50
public SpecialEffectType[] specialEffectList; // 0x50
private int weaponRarity; // 0x58
// Methods
// RVA: 0x327B8BC Offset: 0x327B8BC VA: 0x327B8BC
private void Start()
{
;
}
// RVA: 0x327B8C0 Offset: 0x327B8C0 VA: 0x327B8C0
public void SetRarerity(int rarityValue)
{
weaponRarity = rarityValue;
for (int i = 0; i < weaponEffects1.Length; i++)
weaponEffects1[i].SetActive(false);
for (int i = 0; i < weaponEffects2.Length; i++)
weaponEffects2[i].SetActive(false);
for (int i = 0; i < weaponEffects3.Length; i++)
weaponEffects3[i].SetActive(false);
if (weaponRarity == 6)
{
for (int i = 0; i < weaponEffects3.Length; i++)
weaponEffects3[i].SetActive(true);
}
else if (weaponRarity == 3)
{
for (int i = 0; i < weaponEffects2.Length; i++)
weaponEffects2[i].SetActive(true);
}
else
{
for (int i = 0; i < weaponEffects1.Length; i++)
weaponEffects1[i].SetActive(true);
}
}
// RVA: 0x327BB74 Offset: 0x327BB74 VA: 0x327BB74
public Vector3 CurrentCenterPosionCheck(int type)
{
// ?
return weaponCenterPos[type].transform.localPosition;
}
// RVA: 0x327BBDC Offset: 0x327BBDC VA: 0x327BBDC
public bool IsPlayingAnimation()
{
// ?
return weapon.GetCurrentAnimatorStateInfo(0).normalizedTime < 1.0;
}
// RVA: 0x327BC58 Offset: 0x327BC58 VA: 0x327BC58
public void ChangeWeaponStyle(int colorIndex)
{
// ?
for (int i = 0; i < weaponMaterialList.Length; i++)
{
if (weaponMaterialList[i].colorIndex == colorIndex)
{
//Material[] t = meshRenderer.materials;
//t[0] = weaponMaterialList[i].colorMat;
//meshRenderer.materials = t;
meshRenderer.material = weaponMaterialList[i].colorMat;
break;
}
}
}
// RVA: 0x327BE28 Offset: 0x327BE28 VA: 0x327BE28
public void WeaponChangeOnly(WeaponMode weaponMode)
{
weapon.SetInteger("Type", (int)weaponMode);
}
// RVA: 0x327BE9C Offset: 0x327BE9C VA: 0x327BE9
public void SetChange(Animator targetAnim, WeaponMode weaponMode)
{
targetAnim.SetTrigger("Change");
WeaponChangeOnly(weaponMode);
}
// RVA: 0x327BF18 Offset: 0x327BF18 VA: 0x327BF18
public void SetAnimeSpeed(float time)
{
weapon.speed = time;
}
// RVA: 0x327BF58 Offset: 0x327BF58 VA: 0x327BF58
public void SetAnimState(float value)
{
weapon.speed = 0.0F;
weapon.Play("Weapon001AnimAB", 0, value);
}
// RVA: 0x327BFF0 Offset: 0x327BFF0 VA: 0x327BFF0
public void SetWeaponMode(int weaponMode)
{
weapon.speed = 0.0F;
if (weaponMode == 1)
{
weapon.Play("Weapon001AnimALoop", 0, 0.0F);
}
else if (weaponMode == 2)
{
weapon.Play("Weapon001AnimBLoop", 0, 0.0F);
}
}
// RVA: 0x327C0C4 Offset: 0x327C0C4 VA: 0x327C0C4
public void WeaponCustomDeform(float time)
{
// ?
weapon.SetInteger("Deform", 2);
/*DOVirtual.DelayedCall(time, () =>
{
weapon.SetInteger("Deform", 1);
}
, true);*/
}
// RVA: 0x327C178 Offset: 0x327C178 VA: 0x327C178
public Material GetWeaponCloneMaterialNeunwelt()
{
return (Material)meshRenderer.materials[0];
}
// RVA: 0x327C2BC Offset: 0x327C2BC VA: 0x327C2BC
public void SetSpecialEffect(int id)
{
// if (id >= 1) // modify
//{
for (int i = 0; i < specialEffectList.Length; i++)
{
specialEffectList[i].effect.SetActive(false); // modify
if (specialEffectList[i].id == id)
specialEffectList[i].effect.SetActive(true);
}
//}
}
// RVA: 0x327C384 Offset: 0x327C384 VA: 0x327C384
//public void .ctor() { }
public WeaponController()
{
weaponRarity = 1;
}
//[CompilerGeneratedAttribute] // RVA: 0x16ADEA8 Offset: 0x16ADEA8 VA: 0x16ADEA8
// RVA: 0x327C394 Offset: 0x327C394 VA: 0x327C394
//private void _<WeaponCustomDeform>b__19_0() { }
}
}