private void Start() { Main = GameObject.FindGameObjectWithTag("MainGo").GetComponent <MainScripts>(); if (tupeOF != Type.Default) { Main.Metall.Add(this.gameObject); } }
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); } }
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]; }
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(); }
// 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); } } }
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); }
private void Start() { Main = GetComponent <MainScripts>(); }