void Start() { this.side = SIDE.NONE; this.generalcontrol = GetComponent <GeneralBehaviour>(); this.generalcontrol.init(); this.getComponentsControl(); }
void Start() { this.side = SIDE.NONE; this.generalcontrol = GetComponent<GeneralBehaviour>(); this.generalcontrol.init(); this.getComponentsControl(); }
/// <summary> /// Checks the victorys. /// </summary> /// <param name="_one">_one.</param> /// <param name="_two">_two.</param> void checkVictorys(GeneralBehaviour _one, GeneralBehaviour _two) { if (_one.victorys < 5 && _two.victorys < 5) { StartCoroutine(wait(2, combatscore)); } else { if (Director.gameMode == GAME_MODE.ONE) { if (_one.victorys >= 5) { SaveGame.saveGame(EnemyStatic.enemyStatic, EarnStars.getStars(_two.victorys)); SlipPage.idCharge = EnemyStatic.enemyStatic.id + 1; StartCoroutine(wait(1, win)); } else { SlipPage.idCharge = EnemyStatic.enemyStatic.id; StartCoroutine(wait(1, lose)); } } else { StartCoroutine(wait(1, win)); } } this.onShot = false; }
/// <summary> /// events the shoot. /// </summary> /// <param name="obj">Object.</param> void HandleeventShoot(string obj) { playerOne = GameObject.FindWithTag("PlayerOne"); playerTwo = GameObject.FindWithTag("PlayerTwo"); GeneralBehaviour _one = playerOne.GetComponent <GeneralBehaviour>(); GeneralBehaviour _two = playerTwo.GetComponent <GeneralBehaviour>(); if (this.onShot) { if (this.shooter) { this.shooter = false; if (obj == "PlayerOne") { _one.shoot(); _two.lose(); blockShootEvent(); } else if (obj == "PlayerTwo") { _one.lose(); _two.shoot(); blockShootEvent(); } this.checkVictorys(_one, _two); } else { if (Director.gameMode == GAME_MODE.ONE) { if (obj.Equals("PlayerOne")) { _one.CanShoot = false; } else if (obj.Equals("playerTwo")) { _two.CanShoot = false; } } else { stopThreadsEvent(); this.shooter = false; if (obj == "PlayerOne") { _one.lose(); _two.shoot(); blockShootEvent(); } else if (obj == "PlayerTwo") { _one.shoot(); _two.lose(); blockShootEvent(); } this.checkVictorys(_one, _two); } } } }