Unity - A计划(一年有效期) 扫二维码继续学习 二维码时效为半小时

(61评价)
价格: 2208.00元
Stealth案例中,在添加游戏控制器中,在进行遍历后,进行if判断时,代码过时
赵哒哒发起了问答2018-07-20
3
回复
552
浏览

public bool isAlarmOn = false;

private GameObject[] alarmsSound;

private AlarmLight alarmlight;

private void Awake()

{

isAlarmOn = false; alarmsSound = GameObject.FindGameObjectsWithTag("alarm");

alarmlight = GameObject.Find("AlarmLight").GetComponent<AlarmLight>();

}

void Update ()

{ alarmlight.isAlarmOn = this.isAlarmOn;

}

private void PlayAlarm()

{

foreach (GameObject go in alarmsSound)

{

if (!go.audio.isplaying) //出问题的代码

{

}

}

}

}

所有回复
发表回复
你还没有登录,请先 登录或 注册!