示例#1
0
    // 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> ();
    }
示例#2
0
    // Use this for initialization
    void Awake()
    {
        if (singleton == null)
        {
            singleton = this;
        }

        GetComponent <Camera>().transparencySortMode = TransparencySortMode.CustomAxis;
        GetComponent <Camera>().transparencySortAxis = Vector3.forward;
    }
示例#3
0
    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);
        }
    }
示例#4
0
    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();
        }
    }
示例#5
0
 void InitGameScripts()
 {
     playerScript = FindPlayerInstance();
     camBehaviour = Camera.main.GetComponent <CamBehaviour>();
     defaultData  = camBehaviour.GetCamData();
 }
示例#6
0
 private void Awake()
 {
     main = Camera.main.GetComponent <CamBehaviour>();
 }