void Update() { if (carriage.GetLockedStatus()) { lockImage.SetActive(true); unlockImage.SetActive(false); } else if (!carriage.GetLockedStatus()) { lockImage.SetActive(false); unlockImage.SetActive(true); } }
void GenerateUIPos() { carriageUI.transform.position = new Vector3(gameObject.transform.position.x, carriageUI.transform.position.y, gameObject.transform.position.z); isLocked = cScript.GetLockedStatus(); if (!isLocked) { detectCollider.SetActive(false); carriageUI.transform.GetChild(1).gameObject.SetActive(true); carriageUI.transform.GetChild(0).gameObject.SetActive(false); } else if (isLocked) { detectCollider.SetActive(true); carriageUI.transform.GetChild(1).gameObject.SetActive(false); carriageUI.transform.GetChild(0).gameObject.SetActive(true); } }