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.
38 lines
981 B
38 lines
981 B
using AX.MessageSystem; |
|
using AX.NetworkSystem; |
|
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
public class EditorRight : MonoBehaviour |
|
{ |
|
|
|
private Toggle toggle; |
|
// Use this for initialization |
|
void Start() |
|
{ |
|
toggle = GetComponent<Toggle>(); |
|
toggle.onValueChanged.AddListener(SetEditorRight); |
|
} |
|
|
|
private void SetEditorRight(bool isOn) |
|
{ |
|
DisasterManager.editorRight = isOn; |
|
MessageDispatcher.SendMessage("PlayStatusChanged"); |
|
//NetworkManager.Default.SendAsync("DISASTER_EDITOR_RIGHT_SYNC", new EditorRightStruct { controlRight= isOn , disasterID= DisasterManager.disaster.Id });//单机版注释 |
|
GetComponent<DISASTER_EDITOR_RIGHT_SYNC>().SetInteractable(isOn); |
|
} |
|
|
|
// Update is called once per frame |
|
void Update() |
|
{ |
|
|
|
} |
|
} |
|
public struct EditorRightStruct |
|
{ |
|
public bool controlRight; |
|
public int disasterID; |
|
} |