示例#1
0
    void Start()
    {
        fireRateHZ      = 1f;
        hzText.text     = "1.00HZ";
        healthText.text = "Health: " + health;
        muzzleFlashBullet.StartPlayback();
        muzzleFlashPlasma.StartPlayback();
        muzzleAnimation = muzzleFlashBullet;
        shipAudioSource = GetComponent <AudioSource> ();

                #if UNITY_ANDROID
        myBody.GetComponent <MeshRenderer>().material     = Resources.Load("SilverMaterialAndroid", typeof(Material)) as Material;
        myGlass.GetComponent <MeshRenderer>().material    = Resources.Load("GlassMaterialAndroid", typeof(Material)) as Material;
        myLeftEng.GetComponent <MeshRenderer>().material  = Resources.Load("RedMaterialAndroid", typeof(Material)) as Material;
        myRightEng.GetComponent <MeshRenderer>().material = Resources.Load("RedMaterialAndroid", typeof(Material)) as Material;
                #endif

        persObj   = GameObject.Find("Persister");
        pers      = persObj.GetComponent <Persister>();
        gyroInput = pers.GetComponent <GyroToText> ();
    }