123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using UnityEngine;
- public class NoteBase : UI_ScreenFitBase
- {
- protected override void Start()
- {
- if (Application.isPlaying && GameMain.Instance.VRMode)
- {
- this.m_CheckFirstOnly = true;
- }
- base.Start();
- }
- protected override void FitAction()
- {
- Vector3 zero = Vector3.zero;
- Vector2 zero2 = Vector2.zero;
- if (Application.isPlaying)
- {
- if (GameMain.Instance.VRMode)
- {
- zero2.x = (float)Note_Mgr.Instance.UIRootWidth / (float)Note_Mgr.Instance.CellX;
- zero2.y = (float)Note_Mgr.Instance.UIRootHeight / (float)Note_Mgr.Instance.CellY;
- zero = new Vector3((float)(this.m_MyDotX - (Note_Mgr.Instance.CellX + 1) / 2) * zero2.x, (float)(this.m_MyDotY - (Note_Mgr.Instance.CellY + 1) / 2) * -zero2.y);
- base.transform.localPosition = zero;
- }
- else
- {
- zero2.x = (float)Screen.width / (float)Note_Mgr.Instance.CellX;
- zero2.y = (float)Screen.height / (float)Note_Mgr.Instance.CellY;
- zero.x = zero2.x * (float)(this.m_MyDotX - 1) + zero2.x / 2f;
- zero.y = (float)Screen.height - (zero2.y * (float)(this.m_MyDotY - 1) + zero2.y / 2f);
- base.transform.localPosition = UI_ScreenFitBase.PointToScreenPos(zero);
- }
- }
- }
- protected int m_MyDotX;
- protected int m_MyDotY;
- }
|