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.
65 lines
2.6 KiB
65 lines
2.6 KiB
using System;
|
|
using UnityEngine;
|
|
|
|
namespace FX
|
|
{
|
|
// Token: 0x02000749 RID: 1865
|
|
public class FX_RotationAdd : MonoBehaviour
|
|
{
|
|
// Token: 0x06002FFD RID: 12285 RVA: 0x0010121C File Offset: 0x0010121C
|
|
private void Start()
|
|
{
|
|
this.rotStartRandom_Rate = new Vector3(UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f));
|
|
base.transform.Rotate(this.rotStart[0] + this.rotStartRandom[0] * this.rotStartRandom_Rate[0], this.rotStart[1] + this.rotStartRandom[1] * this.rotStartRandom_Rate[1], this.rotStart[2] + this.rotStartRandom[2] * this.rotStartRandom_Rate[2]);
|
|
this.rotAddRandom_Rate = new Vector3(UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f), UnityEngine.Random.Range(-1f, 1f));
|
|
}
|
|
|
|
// Token: 0x06002FFE RID: 12286 RVA: 0x00101318 File Offset: 0x00101318
|
|
private void Update()
|
|
{
|
|
float num = Time.deltaTime * 60f;
|
|
if (!this._individualXYZ)
|
|
{
|
|
base.transform.Rotate(this.rotAdd[0] * num + this.rotAddRandom[0] * this.rotAddRandom_Rate[0] * num, this.rotAdd[1] * num + this.rotAddRandom[1] * this.rotAddRandom_Rate[1] * num, this.rotAdd[2] * num + this.rotAddRandom[2] * this.rotAddRandom_Rate[2] * num);
|
|
}
|
|
else
|
|
{
|
|
float x = this.rotStart[0] + this.rotStartRandom[0] * this.rotStartRandom_Rate[0] + (this.rotAdd[0] * this._timeCount + this.rotAddRandom[0] * this.rotAddRandom_Rate[0] * this._timeCount);
|
|
float y = this.rotStart[1] + this.rotStartRandom[1] * this.rotStartRandom_Rate[1] + (this.rotAdd[1] * this._timeCount + this.rotAddRandom[1] * this.rotAddRandom_Rate[1] * this._timeCount);
|
|
float z = this.rotStart[2] + this.rotStartRandom[2] * this.rotStartRandom_Rate[2] + (this.rotAdd[2] * this._timeCount + this.rotAddRandom[2] * this.rotAddRandom_Rate[2] * this._timeCount);
|
|
base.transform.localEulerAngles = new Vector3(x, y, z);
|
|
this._timeCount += num;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0400559A RID: 21914
|
|
[SerializeField]
|
|
private Vector3 rotStart = new Vector3(0f, 0f, 0f);
|
|
|
|
// Token: 0x0400559B RID: 21915
|
|
[SerializeField]
|
|
private Vector3 rotStartRandom = new Vector3(0f, 0f, 0f);
|
|
|
|
// Token: 0x0400559C RID: 21916
|
|
[SerializeField]
|
|
private Vector3 rotAdd = new Vector3(0f, 0f, 0f);
|
|
|
|
// Token: 0x0400559D RID: 21917
|
|
[SerializeField]
|
|
private Vector3 rotAddRandom = new Vector3(0f, 0f, 0f);
|
|
|
|
// Token: 0x0400559E RID: 21918
|
|
private Vector3 rotStartRandom_Rate = default(Vector3);
|
|
|
|
// Token: 0x0400559F RID: 21919
|
|
private Vector3 rotAddRandom_Rate = default(Vector3);
|
|
|
|
// Token: 0x040055A0 RID: 21920
|
|
[SerializeField]
|
|
private bool _individualXYZ;
|
|
|
|
// Token: 0x040055A1 RID: 21921
|
|
private float _timeCount;
|
|
}
|
|
}
|