private void MiniGame() { if (isCheck) { comRandom = Random.Range(1, 4); com = comRandom; print(comRandom); int com_user_formula = user - com; if (com_user_formula == 0) { print("비김"); m_objectList.GetUnitGameObject().SetMiniGameCheck("draw"); } if (com_user_formula == 1 || com_user_formula == -2) { print("유저 이김 컴퓨터 짐"); m_objectList.GetUnitGameObject().SetMiniGameCheck("win"); } if (com_user_formula == -1 || com_user_formula == 2) { print("유저 짐 컴퓨터 이김"); m_objectList.GetUnitGameObject().SetMiniGameCheck("lose"); } } isCheck = false; }
public void scvCreateUnit() { int scvPrice = m_unitPrice.GetScvPrice(); if (m_objectList.GetMapGameObject().GetMineralStorage() >= scvPrice) { UnitObjectCreate("SCV", UniqueIdIndexGenerator(), "SCV", 1000, 100, 100.0f, 100.0f, CommonTypes.MinionTeam.MINION_TEAM_USER_SCV); m_objectList.GetMapGameObject().SetMineralStorage(-scvPrice); } Vector3 scvPoint = new Vector3(100, -80, -2); m_objectList.GetUnitGameObject().SetScvStartPoint(scvPoint); }
private void ScvStartPosition() { Vector3 ScvStartPoint = m_objectList.GetUnitGameObject().GetScvStartPoint(); Vector3 ScvBackMove = Vector3.MoveTowards(m_scvObject.transform.position, ScvStartPoint, Time.deltaTime * 30f); m_scvObject.transform.position = ScvBackMove; if (m_scvObject.transform.position == ScvStartPoint) { m_scvType.SetStatusType(CommonTypes.StatusType.STATUS_TYPE_SCV_ORIGINPOINT); m_storage += m_mineral; m_objectList.GetMapGameObject().SetMineralStorage(m_storage); m_storage = 0; Debug.Log("누적" + m_objectList.GetMapGameObject().GetMineralStorage()); } if (m_scvType.GetStatusType().Equals(CommonTypes.StatusType.STATUS_TYPE_SCV_ORIGINPOINT)) { m_scvType.SetStatusType(CommonTypes.StatusType.STATUS_TYPE_SCV_PLAY); m_mineral = 0; } }