public Mood() { maxValue = 100; colorMood = new ColorMood(Color.green, Color.yellow, Color.red, maxValue); moodOriginal = maxValue; status = true; }
void Start() { maxTime = 6; color = new ColorMood(Color.green, Color.yellow, Color.red, maxTime); canvas = Instantiate(canvas); canvas.transform.SetParent(transform); slider = canvas.transform.Find("Slider").gameObject; slider.GetComponent <Slider>().maxValue = maxTime; Vector2 coordinateBox; GameObject pos = transform.Find("PositionProcess").gameObject; coordinateBox = Camera.main.WorldToScreenPoint(new Vector3(pos.transform.position.x, pos.transform.position.y, pos.transform.position.z)); slider.transform.position = new Vector2(coordinateBox.x, coordinateBox.y); }