bool IsDieAlreadyInBufferList(aMechDie die) { for (int i = 0; i < m_DiceMatchBufferList.Count; i++) { if (m_DiceMatchBufferList[i] == die) { return(true); } } return(false); }
/// <summary> /// Test conditionals are placed here. /// </summary> /// <param name="state"></param> /// <returns>true or false depending if transition conditions are met.</returns> public override string UpdateConditionalTest(baseState state) { string strOut = null; aMechDie theScript = state.m_GameObject.GetComponent <aMechDie>(); if (theScript.DeathBool) { strOut = m_ChangeStateName; } return(strOut); }
/// <summary> /// Test conditionals are placed here. /// </summary> /// <param name="state"></param> /// <returns>true or false depending if transition conditions are met.</returns> public override string UpdateConditionalTest(baseState state) { string strOut = null; stateGameBase gamebase = (stateGameBase)state; aMechDie script = gamebase.StateGameObject.GetComponent <aMechDie>(); if (gamebase.StateTime > script.DeathTimeLimit) { strOut = m_ChangeStateName; } return(strOut); }
/// <summary> /// Test conditionals are placed here. /// </summary> /// <param name="state"></param> /// <returns>true or false depending if transition conditions are met.</returns> public override string UpdateConditionalTest(baseState state) { string strOut = null; aMechDie theScript = state.m_GameObject.GetComponent <aMechDie>(); if (theScript.gameObject.GetComponent <Rigidbody>().velocity.sqrMagnitude < theScript.FallVelocityThreshold) { m_FallTime += gameMgr.GetSeconds(); } if (theScript.gameObject.GetComponent <Rigidbody>().velocity.sqrMagnitude < theScript.FallVelocityThreshold && m_FallTime > theScript.FallTimeLimit) { strOut = m_ChangeStateName; } //utlDebugPrint.Inst.print(theScript.gameObject.GetComponent<Rigidbody>().velocity.sqrMagnitude.ToString()); return(strOut); }
void UpdateDieMatch() { //int dieMatchCount = 0; for (int i = 0; i < DiceList.Count; i++) { if (DiceList[i].DeathBool) { continue; } //utlDebugPrint.Inst.print("DiceList[i].ContactDiceList.Count = " + DiceList[i].ContactDiceList.Count); m_DiceMatchBufferList.Clear(); for (int j = 0; j < DiceList[i].ContactDiceList.Count; j++) { // utlDebugPrint.Inst.print("DiceList[i].ContactDiceList.Count = " + DiceList[i].ContactDiceList.Count); m_DiceMatchBufferList.Add(DiceList[i]); for (int index = 0; index < DiceList[i].ContactDiceList[j].ContactDiceList.Count; index++) { aMechDie die = DiceList[i].ContactDiceList[j].ContactDiceList[index]; if (!IsDieAlreadyInBufferList(die)) { m_DiceMatchBufferList.Add(die); } } } if (m_DiceMatchBufferList.Count >= m_MatchNum - 1) { TotalScore += m_DiceMatchBufferList.Count * m_DiceMatchBufferList.Count * m_BaseScore; m_ScoreText.text = "Score:" + TotalScore; SetBufferedDiceToDeath(); } } }
int DieCountRecursively(aMechDie die) { return(die.ContactDiceList.Count); }