// Use this for initialization void Start() { charPhys = GameObject.Find("MannFall").GetComponent <RungeKutta3>(); buttonText = GameObject.Find("Text").GetComponent <Text>(); heightText = GameObject.Find("HeightText").GetComponent <Text>(); speedText = GameObject.Find("SpeedText").GetComponent <Text>(); timeText = GameObject.Find("TimeText").GetComponent <Text>(); pointsText = GameObject.Find("PointsText").GetComponent <Text>(); Control = GameObject.Find("ControlObject").GetComponent <GlobalGameControl>(); }
public void InitializationPlayer(GameObject selectedCharacter) { GameObject oldPlayer = GameObject.FindGameObjectWithTag("Player"); Transform startPoint = GameObject.FindGameObjectWithTag("StartPoint").transform; Interface Interface = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Interface>(); GlobalGameControl globalGameControl = GetComponent <GlobalGameControl>(); if (oldPlayer != null) { Destroy(oldPlayer); } GameObject newPlayer = Instantiate(selectedCharacter, startPoint.position, Quaternion.identity); Interface.Player = newPlayer; Interface.PlayerScript = newPlayer.GetComponent <Player>(); Interface.Start(); globalGameControl.Players[0] = newPlayer; // Запись в массив игрока }
private void Start() { opponent = GetComponent <Opponent>(); globalGameControl = GetComponent <GlobalGameControl>(); }
// Use this for initialization void Start() { mycollider = GetComponent <CircleCollider2D>(); phys = GetComponent <PhysicsVariables>(); Control = GameObject.Find("ControlObject").GetComponent <GlobalGameControl>(); }
private void Start() { globalGameControl = GetComponent <GlobalGameControl>(); }