// Use this for initialization void Start() { // Zugriff auf Animator beim Start initialisieren anim = GetComponent <Animator>(); // Zugriff auf den RigidBody rb = GetComponent <Rigidbody>(); camBehaviour = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CamBehaviour> (); }
// Use this for initialization void Awake() { if (singleton == null) { singleton = this; } GetComponent <Camera>().transparencySortMode = TransparencySortMode.CustomAxis; GetComponent <Camera>().transparencySortAxis = Vector3.forward; }
void Start() { camBehaviour = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CamBehaviour> (); // RigidBody der Zahlen von 1 bis 9 abspeichern; for (float numbers = 1; numbers <= 9; numbers++) { // Pfad in der Spielehierarchie festlegen string name = numbers.ToString(); string path = numberPath + name; // Zuordnung des RigidBody der jeweiligen Zahl Rigidbody numberRB = GameObject.Find(path).GetComponent <Rigidbody>(); numberRB.useGravity = false; numbersRB.Add(numberRB); } }
void Start() { if (!instance) { instance = this; DontDestroyOnLoad(this); bulletFlights = new List <BulletWay>(); playerPos = new Vector2[4]; mainCam = Camera.main.GetComponent <CamBehaviour>(); if (!mainCam) { hasMainCam = false; Debug.LogError("No moveable mainCamera found. Please add camera with CamBehaviour as main"); } GetComponent <AudioSource>().Play(); } }
void InitGameScripts() { playerScript = FindPlayerInstance(); camBehaviour = Camera.main.GetComponent <CamBehaviour>(); defaultData = camBehaviour.GetCamData(); }
private void Awake() { main = Camera.main.GetComponent <CamBehaviour>(); }