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.
36 lines
802 B
36 lines
802 B
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.UI; |
|
|
|
public class PaperPageMessage : MonoBehaviour { |
|
|
|
// Use this for initialization |
|
public int page; |
|
protected void Start() |
|
{ |
|
GetComponent<Toggle>().onValueChanged.AddListener(selectPage); |
|
} |
|
|
|
protected void OnDestroy() |
|
{ |
|
GetComponent<Toggle>().onValueChanged.RemoveListener(selectPage); |
|
} |
|
|
|
// Update is called once per frame |
|
void Update() |
|
{ |
|
|
|
} |
|
public void setPage(int page) |
|
{ |
|
this.page = page; |
|
transform.Find("Label").GetComponent<Text>().text = page.ToString(); |
|
} |
|
public virtual void selectPage(bool isOn) |
|
{ |
|
if (isOn) |
|
{ |
|
transform.parent.GetComponent<PaperPageControl>().selectPage(page); |
|
} |
|
} |
|
}
|
|
|