113 lines
2.5 KiB
C#
113 lines
2.5 KiB
C#
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
using UnityEngine.Events;
|
|||
|
|
using UnityEngine.UI;
|
|||
|
|
|
|||
|
|
public class BaseController : MonoBehaviour
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>Ƿ<EFBFBD><C7B7>ڼ<EFBFBD><DABC>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
private static bool isKeyOnControl;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public static bool IsMouseOnControl;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>Ƿ<EFBFBD><C7B7>Զ<EFBFBD>Ѱ·<D1B0><C2B7>
|
|||
|
|
/// </summary>
|
|||
|
|
private static bool isNavOnControl;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>Ƿ<EFBFBD><C7B7>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
private static bool isTouchOnControl;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>Ƿ<EFBFBD><C7B7>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
private static bool isJoyStickOnControl;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>Ƿ<EFBFBD>UI<55><49><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public static bool IsUIClicked;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public static bool CanControl = false;
|
|||
|
|
|
|||
|
|
public static bool IsAnimatorOnControl;
|
|||
|
|
|
|||
|
|
public static bool IsAutoNavigating;
|
|||
|
|
|
|||
|
|
public static bool IsKeyOnControl
|
|||
|
|
{
|
|||
|
|
get => isKeyOnControl;
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
if (isKeyOnControl != value)
|
|||
|
|
{
|
|||
|
|
isKeyOnControl = value;
|
|||
|
|
if (!isKeyOnControl) OnStatusChanged();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
public static bool IsNavOnControl
|
|||
|
|
{
|
|||
|
|
get => isNavOnControl; set
|
|||
|
|
{
|
|||
|
|
if (isNavOnControl != value)
|
|||
|
|
{
|
|||
|
|
isNavOnControl = value;
|
|||
|
|
if (!isNavOnControl) OnStatusChanged();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
public static bool IsTouchOnControl
|
|||
|
|
{
|
|||
|
|
get => isTouchOnControl; set
|
|||
|
|
{
|
|||
|
|
if (isTouchOnControl != value)
|
|||
|
|
{
|
|||
|
|
isTouchOnControl = value;
|
|||
|
|
if (!isTouchOnControl) OnStatusChanged();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
public static bool IsJoyStickOnControl
|
|||
|
|
{
|
|||
|
|
get => isJoyStickOnControl; set
|
|||
|
|
{
|
|||
|
|
if (isJoyStickOnControl != value)
|
|||
|
|
{
|
|||
|
|
isJoyStickOnControl = value;
|
|||
|
|
if (!isJoyStickOnControl) OnStatusChanged();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public static void HideView()
|
|||
|
|
{
|
|||
|
|
CanControl = true;
|
|||
|
|
if (AudioManager.Instance != null)
|
|||
|
|
{
|
|||
|
|
AudioManager.Instance.ResumeBackgroundMusic();
|
|||
|
|
}
|
|||
|
|
CommonData.ReleaseMemory();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
static void OnStatusChanged()
|
|||
|
|
{
|
|||
|
|
if(StatusChanged != null)
|
|||
|
|
{
|
|||
|
|
StatusChanged();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public static event UnityAction StatusChanged;
|
|||
|
|
}
|