Exemplo n.º 1
0
 private void Start()
 {
     Main = GameObject.FindGameObjectWithTag("MainGo").GetComponent <MainScripts>();
     if (tupeOF != Type.Default)
     {
         Main.Metall.Add(this.gameObject);
     }
 }
Exemplo n.º 2
0
 protected void StartParametrs() // Параметры задаваемые при старте
 {
     Main = GameObject.FindGameObjectWithTag("MainGo").GetComponent <MainScripts>();
     Menu = GameObject.FindGameObjectWithTag("MainGo").GetComponent <BuildMenu>();
     HP   = maxHP;
     if (gameObject.tag == "Complete" && Main != null)
     {
         Main.Building.Add(this);
     }
 }
Exemplo n.º 3
0
 void Start()
 {
     Main  = GameObject.FindGameObjectWithTag("MainGo").GetComponent <MainScripts>();
     agent = GetComponent <NavMeshAgent>();
     anim  = GetComponent <Animator>();
     Main.Char.Add(this);
     IntHair = Random.Range(0, 3);
     hair.GetComponent <Renderer>().material   = ColorHair[IntHair];
     boroda.GetComponent <Renderer>().material = ColorHair[IntHair];
 }
Exemplo n.º 4
0
 void Start()
 {
     res          = this;
     Nalog        = 3;
     _money.text  = ((int)Money).ToString();
     _stone.text  = stone.ToString();
     _aples.text  = ((int)aples).ToString();
     _lumber.text = ((int)Lumber).ToString();
     _gems.text   = gems.ToString();
     StartCoroutine(SetLevel(0));
     main = GetComponent <MainScripts>();
     Happines();
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     Main = GameObject.FindGameObjectWithTag("MainGo").GetComponent <MainScripts>();
     if (typeOf == Type.lumber)
     {
         if (Main.UpdateSelection(transform.position.x, transform.position.z))
         {
             Main.Tree.Add(gameObject);
         }
     }
     if (typeOf == Type.aple)
     {
         if (Main.UpdateSelection(transform.position.x, transform.position.z))
         {
             Main.TreeA.Add(gameObject);
         }
     }
 }
Exemplo n.º 6
0
    public void ZonPosition(int x, int z, Transform pos, List <int> checkX, List <int> checkZ) // Назначить вектор положения зонам
    {
        float i, j;

        X = x + 10;
        Z = z + 10;
        i = 25 + 50 * x;
        j = 25 + 50 * z;
        transform.position = new Vector3(i, 0, j);
        main            = pos.GetComponent <MainScripts>();
        gameObject.name = "(" + X.ToString() + " | " + Z.ToString() + ")";
        for (int f = 0; f < checkX.Count; f++)
        {
            if (X == checkX[f] && Z == checkZ[f])
            {
                Buy = true;
                break;
            }
        }
        transform.SetParent(pos);
    }
Exemplo n.º 7
0
 private void Start()
 {
     Main = GetComponent <MainScripts>();
 }