Ejemplo n.º 1
0
        /// <summary>
        /// Установить свойства мяча по-умолчанию
        /// </summary>
        private void SetParametersBall()
        {
            int x = Convert.ToInt32(CountBall.text);

            if (x > 0)
            {
                GameObject ob = Instantiate(paternBall, background.transform);
                ob.AddComponent <Shoot>();
                ob.GetComponent <Shoot>().treject             = lineRenderer;
                ob.GetComponent <MovePlayerBall>().Background = background;
                ob.GetComponent <MovePlayerBall>().Handle     = ob.GetComponent <RectTransform>();
                ob.GetComponent <Image>().color = ColorFromText.GetRandomColor();
                ob.GetComponent <Shoot>().end  += EndShoot;
                CountCreateball++;
                CountBall.text = (x - 1).ToString();
            }
            else
            {
                EndGamePlay();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Установить цвет из файла
 /// </summary>
 /// <param name="im">Ссылка на компонент изображения</param>
 /// <param name="xml">Элемент для чтени яцвета</param>
 private void SetColorOb(Image im, XmlElement xml)
 {
     im.color = ColorFromText.GetColorFromText(xml.GetAttribute("color"));
 }