void Start() { test1 = FindObjectOfType <test>(); oyuncu = FindObjectOfType <Player>(); oyuncuA = FindObjectOfType <PlayerA>(); oyuncuB = FindObjectOfType <PlayerB>(); oyuncuC = FindObjectOfType <PlayerC>(); oyuncuD = FindObjectOfType <PlayerD>(); ld = FindObjectOfType <LoadScene>(); StartCoroutine(Text()); UnityEngine.PlayerPrefs.SetInt("FirstSituation", oyuncu.MevcutAltin); UnityEngine.PlayerPrefs.Save(); }
//返回游戏是否结束,项羽1, 虞姬2, 游戏没结束0, 都死3 public PlayerD ArrowAttack() { if (m_status != ArrowStatus.ATTACK) { SetType(ArrowStatus.ATTACK); return(0); } PlayerD Ret = 0; SceneModule _sceneModule = (SceneModule)GameManager.GameManagerObj.GetComponent <GameManager>().GetModuleByName("SceneModule"); //消灭攻击位置的所有的人;不同棋子不会在一个位置 MapPos pos = new MapPos(); _sceneModule.GetPlayerPos(ref pos); bool YuJiExist = _sceneModule.UpdateYuJiPos(); for (int _i = 0; _i < m_AttackArea.Count; _i++) { //敌人判断 if (_sceneModule.m_enemyList[m_AttackArea[_i].m_row][m_AttackArea[_i].m_col] != null) { //敌人被弓箭杀死的动画 //敌人死亡处理 _sceneModule.m_enemyList[m_AttackArea[_i].m_row][m_AttackArea[_i].m_col].DestroyObj(); } //虞姬项羽判断 if ((Ret != PlayerD.XIANGYU || Ret != PlayerD.ALL) && pos.m_row == m_AttackArea[_i].m_row && pos.m_col == m_AttackArea[_i].m_col) { Ret = Ret == PlayerD.YUJI ? PlayerD.ALL : PlayerD.XIANGYU; } if ((Ret != PlayerD.YUJI || Ret != PlayerD.ALL) && YuJiExist && _sceneModule.YuJiPos.m_row == m_AttackArea[_i].m_row && _sceneModule.YuJiPos.m_col == m_AttackArea[_i].m_col) { Ret = Ret == PlayerD.XIANGYU ? PlayerD.ALL : PlayerD.YUJI; } } SetType(ArrowStatus.WAIT); //删除这个arrow DestroyObj(); return(Ret); }
// Start is called before the first frame update void Start() { playerd = FindObjectOfType <PlayerD>(); }
public int CompareTo(PlayerD comparePart) { return(score - comparePart.score); }