public void InitForGame(GameLevel i_oMap, GameObject i_oPlayer) { bMapMode = true; oPlayer = i_oPlayer; oMap = i_oMap; vCamPos = new Vector3(0, 0, -10.0f); //set it away from the player, transform.position will then be set first Update vCamOffset = new Vector3(0, 0.3f, -1.90f); vMapSize = oMap.GetMapSize(); }
public void Init(bool i_bIsRace) { oTextTime.SetActive(i_bIsRace); oTextLapProgress.SetActive(i_bIsRace); oTextScore.SetActive(!i_bIsRace); oTextLives.SetActive(!i_bIsRace); oHealthBar.SetActive(true); oFuelBar.SetActive(!i_bIsRace); oCargoBar.SetActive(!i_bIsRace); gameObject.SetActive(true); if (!GameManager.bNoVR) { transform.eulerAngles = new Vector3(45, 0, 0); } transform.localScale = new Vector3(0.68f, 0.68f, 0.68f); string szMaterial = i_bIsRace ? "Status2" : "Status"; Material oMaterial = Resources.Load(szMaterial, typeof(Material)) as Material; oBack.GetComponent <Renderer>().material = oMaterial; oMatRed = Resources.Load("Ship_Body", typeof(Material)) as Material; oMatOriginal = oCargoBar.GetComponent <Renderer>().material; vMapSize = oMap.GetMapSize(); vMapSize.x /= 10.0f; vMapSize.y /= 10.0f; if (i_bIsRace) { oLeft.transform.localPosition = new Vector3(-3.625f, -1.8f + 1.35f, 0.4f) / 10.0f; oLeft.transform.localScale = new Vector3(0.25f, 3.80f, 0.25f) / 10.0f; oRight.transform.localPosition = new Vector3(2.625f, -1.8f + 1.35f, 0.4f) / 10.0f; oRight.transform.localScale = new Vector3(0.25f, 3.80f, 0.25f) / 10.0f; oBottom.transform.localPosition = new Vector3(-0.5f, -4.925f + 2.70f, 0.4f) / 10.0f; } }