void Start() { transform.GetChild(0).GetComponent <Text> ().text = task.TaskName; transform.GetChild(1).GetChild(0).GetComponent <Image> ().sprite = task.TaskIcon; transform.GetChild(4).GetComponent <Image> ().sprite = DoneImage; DoneImageSprite.SetActive(task.TaskCompleted); GoButton.SetActive(!task.TaskCompleted); GoButton.GetComponent <Button> ().onClick.AddListener(() => SelectTask()); }
public void clearwalls() { #region foreach (Transform child in maze) { Destroy(child.gameObject); } foreach (Transform child in upperWall) { Destroy(child.gameObject); } foreach (Transform child in lowerWall) { Destroy(child.gameObject); } foreach (Transform child in leftWall) { Destroy(child.gameObject); } foreach (Transform child in rightWall) { Destroy(child.gameObject); } #endregion generatebutton.interactable = true; GoButton.GetComponent <Button>().interactable = true; GoButton.SetActive(false); SpawnButton.interactable = false; PlayerPrefab.SetActive(false); FollowButton.interactable = false; followtext1.text = "Follow"; followtext1.color = new Color(255f, 255f, 255f, 10f); CharacterMovement.won = false; if (CameraMovement.startfollowing || followed) { CameraMovement.startfollowing = false; Vector3 oldrot = GetComponent <CameraMovement>().oldrotation; //Vector3 oldpos = GetComponent<CameraMovement>().oldpos; CameraMovement.unfollow = true; // Vector3 smoothed = Vector3.Lerp(transform.position, oldpos, 0.125f); // Camera.main.transform.position = smoothed; Camera.main.transform.rotation = Quaternion.Euler(oldrot); followed = false; } }