楼主:
gyd (阿龙哥)
2016-11-27 00:31:11只回你的问题
ButtonUnlock中增加一个function就能call到
void Awake()
{
DontDestroyOnLoad( gameObject );
}
然而这不是你的case应该做的事
※ 引述《LitterShripm (litter_shrimp)》之铭言:
: 我在场景1图片打上
: public class ButtonUnlock : MonoBehavior{
: public Toggle touchToggle;
: public static bool unlock;
: void Start () {
: unlock = false;
: touchToggle.interactable = false;
: }
: void Update(){
: if(unlock == true && touchToggle.interactable == false)
: {
: Debug.Log ("Hello");
: touchToggle.interactable = true;
: }
: }
: }
: 在场景2写入
: public class ButtonLock : MonoBehavior{
: void Update() {
: if(Input.GetKeyDown(KeyCode.U)
: {
: ButtonUnlock.unlock = true;
: }
: }
: }
: 案U却不会运作,请问是哪里写错?
: PS:如果都放入同个场景那就能运作
: 对了我用这个方法当作成就解锁是否行的通?(网络上的太复杂。。。看不懂)