using System.Collections; using System.Collections.Generic; using UnityEngine; public class UseEnumTest : MonoBehaviour { // Start is called before the first frame update void Start() { Debug.Log(LayerMask.NameToLayer("UI")); NetActionType netAction = NetActionType.yeildCtrl | NetActionType.unGrabbedOnFree; if ((NetActionType.getCtrl & netAction) == NetActionType.getCtrl) { Debug.Log("获取操作权限"); } if ((NetActionType.yeildCtrl & netAction) == NetActionType.yeildCtrl) { Debug.Log("放弃操作权限"); } if ((NetActionType.unGrabbedOnFree & netAction) == NetActionType.unGrabbedOnFree) { Debug.Log("放在自由位置"); } if ((NetActionType.unGrabbedOnFixed & netAction) == NetActionType.unGrabbedOnFixed) { Debug.Log("放在固定位置"); } } // Update is called once per frame void Update() { } }