Exemplo n.º 1
0
 void Start()
 {
     this.side           = SIDE.NONE;
     this.generalcontrol = GetComponent <GeneralBehaviour>();
     this.generalcontrol.init();
     this.getComponentsControl();
 }
Exemplo n.º 2
0
	void Start()
	{
		this.side = SIDE.NONE;
        this.generalcontrol = GetComponent<GeneralBehaviour>();
        this.generalcontrol.init();
        this.getComponentsControl();
	}
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
    /// <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);
                }
            }
        }
    }