// Use this for initialization void Start() { UISpeed.SetText("Speed 0"); UIScore.SetText("Score: 0"); UIScoreAlert.enabled = false; UIBoost.enabled = false; }
//GameObject gameManager; // Use this for initialization // EntityManager entityManagerScript; public virtual void Start() { renderers = gameObject.GetComponentsInChildren<SpriteRenderer>(); uiScore = GameObject.Find("PlayerInfo").GetComponent<UIScore>(); alive = true; }
public virtual void BecomeAlive() { uiScore = GameObject.Find("Score").GetComponent<UIScore>(); powerUpChance = Random.Range(1, 101); hitPoints = startingHitPoints; alive = true; }
public static void OnStart() { //加载球和球桌游戏对象,保存在结构体中 GameObject Plane; Plane = Instantiate(Resources.Load("Prefabs/Plane")) as GameObject; GameObject WriteBall; WriteBall = Instantiate(Resources.Load("Prefabs/WriteBall")) as GameObject; GlobalHelper.g_GlobalLevel.Initialized(WriteBall, Plane); //加载指定UI GameObject UIM = new GameObject("UIManager"); UIManager uim = UIM.AddComponent <UIManager>(); uim.UI <UIHand>(); UISlight uis = uim.UI <UISlight>(); uis.transform.localPosition = new Vector3(0, 0, 0); UIPower uip = uim.UI <UIPower>(); UIScore uisc = uim.UI <UIScore>(); //碰撞器 GameObject SpCol; SpCol = Instantiate(Resources.Load("Prefabs/SpCol")) as GameObject; TPB = SpCol.GetComponent <TestPlatzierenBall>(); }
public void Initialize() { if (frontGround == null) { frontGround = GameObject.Find("FrontGround").GetComponent <Image>(); } if (IntroUI == null) { IntroUI = GameObject.FindObjectOfType <UIIntro>(); } if (LoadingUI == null) { LoadingUI = GameObject.FindObjectOfType <UILoading>(); } if (TimerUI == null) { TimerUI = GameObject.FindObjectOfType <UITimer>(); } if (ScoreUI == null) { ScoreUI = GameObject.FindObjectOfType <UIScore>(); } if (ResultUI == null) { ResultUI = GameObject.FindObjectOfType <UIResult>(); } IntroUI.Initialize(this); LoadingUI.Initialize(this); TimerUI.Initialize(this); ScoreUI.Initialize(this); ResultUI.Initialize(this); }
public void Back() { Application.LoadLevel("Menu"); // deux ligne à modifier UIScore score = new UIScore(); score.exitGame(); }
// Use this for initialization void Start() { for (int i = PlayerPrefs.GetInt("Duplicate") - 1; i > 0; --i) { CreateDuplicate(); } playerShootingScript = GetComponent<PlayerShooting>(); lives = GameObject.Find("Lives").GetComponent<UILives>(); //eww score = GameObject.Find("PlayerInfo").GetComponent<UIScore>(); //double eww }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
public override void OnEnter(string prevState = "") { ChangeState("Construct"); m_AudioManager.StartPlayMusic(); m_Canvas.enabled = true; m_StartLevelCanvas.enabled = true; m_ConstructUIController.Enable(); m_UIRangeIndicator.Visible(); UIRemainTowerCount.ResetTowerCount(); UIGameLevel.ResetLevel(); UIScore.Reset(); //防止无法生成怪物的情况 m_MonsterManager.isClearMode = false; }
public void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (scene.name.Equals("Level01")) { timerScript = FindObjectOfType <UITimer>(); playerSpawnPoint = GameObject.FindGameObjectWithTag("PlayerSpawnpoint").transform; UIScore scoreScript = FindObjectOfType <UIScore>(); onScoreUpdate.AddListener(scoreScript.OnScoreUpdate); timerScript.onPlayerLoss.AddListener(OnPlayerWinOrLoss); WinVolume winVol = FindObjectOfType <WinVolume>(); winVol.onPlayerWin.AddListener(OnPlayerWinOrLoss); playerCamera = FindObjectOfType <CameraFollow>(); playerScore = 0; } }
//public void TakeSlowdown(TowerLevel slowdownLevel) //{ // slowdownTime[(int)slowdownLevel] = Time.time + TowerInfo.debuffDuringTime[(int)TowerType.SourceBuffSlowdown, (int)slowdownLevel]; // if (isSlowdown[(int)slowdownLevel] == false) // { // isSlowdown[(int)slowdownLevel] = true; // slowdownRate += TowerInfo.sourceBuffSlow[(int)TowerType.SourceBuffSlowdown, (int)slowdownLevel]; // } //} //计算扣血量 protected void TakeHealth(float fireDamage) { //护甲大于0和小于0时的计算方式不一样 if (armor >= 0) { damageTemp = fireDamage * (1 - ((armor * 0.06f) / (1 + 0.06f * armor))); } else { damageTemp = fireDamage * (1 + (2 - Mathf.Pow(0.94f, -armor))); } health -= damageTemp; UIScore.Add(damageTemp); //Debug.Log("Damage:" + damageTemp + " Health:" + health); }
//------------------------------------ void Awake() { ThisAnimator = GetComponent <Animator> (); ThisAgent = GetComponent <UnityEngine.AI.NavMeshAgent> (); PlayerTransform = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform> (); PlayerHealth = PlayerTransform.GetComponent <Health>(); //Find and get associated UI Text NameTextComp = GetComponentInChildren <Text> (); ThisTransform = GetComponent <Transform> (); HitSound = GetComponent <AudioSource> (); ScoreText = GameObject.FindGameObjectWithTag("ScoreText").GetComponent <UIScore> (); //Hide text NameTextComp.gameObject.SetActive(false); }
void HitBall(GameObject obj) { GameObject UIMgr; UIManager UIM; UIMgr = GameObject.Find("UIManager"); UIM = UIMgr.GetComponent <UIManager>(); UIScore UIS = UIM.UI <UIScore>(false); UITimer UIT = UIS.GetComponentInChildren <UITimer>(); //给球加力 rb.AddForce(pos.normalized * 1000 * value); LR.SetPosition(0, BallPos); LR.SetPosition(1, BallPos); bFirst = true; //停止计时 UIT.Timer1.value = 1; UIT.Timer2.value = 2; }
public override void OnEnter(string prevState = "") { scoreTemp = UIScore.GetScore(); m_Canvas.enabled = true; m_AudioManager.StartPlayMusic(); m_Text.text = scoreTemp.ToString(); //测试代码 string a = ""; if (m_ConfigManager.IsEnableAdd(scoreTemp) == false) { //a = "Disable"; m_TypeName.SetActive(false); } else { m_TypeName.SetActive(true); } }
public static UIScore Instance = null;//单例对象 private void Awake() { Instance = this; }
void Awake() { Instance = this; }
private void Awake() { instance = this; GameStatisticsManager.OnScoreChanged += OnScoreChanged; GameStatisticsManager.OnPerfectChanged += GameStatistics_OnPerfectChanged; }
public void UpdateScore(int points) { UIScore.SetText("Score: " + points); }
// Use this for initialization void Start() { _scoreUI = GetComponent <UIScore>(); }