예제 #1
0
    void Start()
    {
        collectedCoinsCounts = 0;

        if (bikeScript == null)
        {
            bikeScript = Camera.main.GetComponent <BIKECamera> ();
        }
        // ;//
        // playerObj = GameObject.FindGameObjectWithTag ("Player");//
        playerObj = GameObject.Instantiate(playerBIKEs [BIKESelection.BIKEIndex]) as GameObject;

        UIControl.Static.playerRigidBody = playerObj.GetComponent <Rigidbody>();
        startPlayerBIKEPositionZ         = playerObj.transform.position.z;
        bikeScript.targetTrans           = playerObj.transform;
    }
    void OnEnable()
    {
        if (UnityEngine.Random.Range(-4, 4) > 0)
        {
            rotateDir = 1;
        }
        else
        {
            rotateDir = -1;
        }

        //print ("Nitrou"+ PlayerPrefs.GetInt ("NitrousCount", 0));
                #if UNITY_WEBPLAYER || UNITY_EDITOR
        tilt = tilt * 2;
                #endif
        thisTrans  = transform;
        mainCamera = Camera.main;
        foreach (Transform t in gameObject.GetComponentsInChildren <Transform>())
        {
            if (t.name.Contains("Effect"))
            {
                particleParent = t.gameObject;
            }
        }

        isDoubleSpeed = 1;


        bikeScript             = Camera.main.GetComponent <BIKECamera> ();
        bikeScript.targetTrans = thisTrans;


                #if UNITY_ANDROID || UNITY_IPHONE || UNITY_WP8
        // even blob shadows is also taking 5 draw calls ,so we are going disable it
//		foreach(Transform t in transform.GetComponentsInChildren<Transform>() )
//		{ if(t.name.Contains("Shadow") ) {
//				Debug.Log(t.name);
//				Destroy(t.gameObject);
//			}
//		}
                #endif
    }
예제 #3
0
 void Start()
 {
     speed  = 0.2f;
     Static = this;
 }