Exemple #1
0
 // Use this for initialization
 void Start()
 {
     _Instance = this;
     if (GlobalData.GetInstance().gameMode == GameMode.OnlineMode)
     {
         GameObject bikegamectrl = GameObject.Find(GlobalData.bikeGameCtrl);
         playerCreatScript   = bikegamectrl.GetComponent <PlayerCreatNet>();
         NetworkServerScript = NetworkServerNet.GetInstance();
         netCtrlScript       = NetCtrl.GetInstance();
         if (NetworkServerScript != null && NetworkServerScript.GetIsServer())
         {
             return;
         }
         else
         {
             SoureAudio = AudioManager.Instance.audio;
         }
     }
     else
     {
         SoureAudio = AudioManager.Instance.audio;
         ui         = GetComponent <UISprite>();
         scale      = GetComponent <TweenScale>();
         StartCoroutine("Gogo");
     }
 }
Exemple #2
0
    void playAudioTime()
    {
        if (GlobalData.GetInstance().gameMode == GameMode.OnlineMode &&
            NetworkServerScript != null &&
            NetworkServerScript.GetIsServer())
        {
            return;
        }

        if (TimeAudio.Length == 4 && TimeAudio[indexTime] != null)
        {
            SoureAudio.clip = TimeAudio[indexTime];
            SoureAudio.Play();
        }
        indexTime++;

        if (indexTime >= 4)
        {
            indexTime = 0;
        }
    }
    void Start()
    {
        _Instance           = this;
        camPosEvent         = BikeCamEvent.Null;
        NetworkServerScript = NetworkServerNet.GetInstance();

        if (mMotionBlur == null)
        {
            Debug.LogWarning("mMotionBlur is null");
        }
        BlurEffectScript.enabled = false;

        float[] distances = new float[32];
        for (int i = 0; i < 32; i++)
        {
            distances[i] = 400f;
        }
        distances[9]              = 260;
        distances[15]             = 100;
        distances[18]             = 600;
        distances[19]             = 50;
        distances[13]             = 250;
        distances[20]             = 50;
        distances[21]             = 250;
        camera.layerCullDistances = distances;

        Random.seed = (int)(Time.realtimeSinceStartup * 100000f);

        RainObj.SetActive(false);

        if (NetworkServerScript != null && !NetworkServerScript.GetIsServer())
        {
            Invoke("callBackgroundAudio", 3.5f);
        }

        mCamTran = transform;

        Screen.showCursor = false;
        smoothVal         = mSmooth * 0.015f;
        //smoothValTmp = smoothVal;

        if (mBike != null)
        {
            mBikePlayer = mBike;
        }

        mMotionBlur = gameObject.GetComponent <MotionBlur>();
        //		if(mMotionBlur == null)
        //		{
        //			ScreenLog.Log("BikeCamera::Start -> mMotionBlur is null!");
        //		}
    }