Exemplo n.º 1
0
    private void PlayerUpdate()
    {
        GUIPlayer playerGUI = gameObject.GetComponent("GUIPlayer") as GUIPlayer;

        playerGUI.Health     = tankData.HealthAmount;
        playerGUI.RocketAmmo = hatchControlData.RocketAmmo;
        playerGUI.ShellAmmo  = gunData.ShellAmmo;
    }
Exemplo n.º 2
0
    private void PlayerMechanics()
    {
        playerGUI            = gameObject.GetComponent("GUIPlayer") as GUIPlayer;
        playerGUI.Health     = tankData.HealthAmount;
        playerGUI.MaxHealth  = HealthSave;
        playerGUI.HealthBars = GameObject.Find(tankPreset.ToString() + "HealthBarsFull").
                               GetComponent <GUIPlayer>().HealthBars;
        playerGUI.ShellAmmo  = gunData.ShellAmmo;
        playerGUI.RocketAmmo = hatchControlData.RocketAmmo;

        playerGuiTexture.texture = new Texture2D(140, 60);
    }
Exemplo n.º 3
0
    private void PlayerControlled()
    {
        gameObject.tag = "Player";

        //Player Modules
        if (!gameObject.GetComponent("GUIPlayer"))
        {
            playerGUI = gameObject.AddComponent("GUIPlayer") as GUIPlayer;
        }
        if (!gameObject.GetComponent("GUITexture"))
        {
            playerGuiTexture = gameObject.AddComponent("GUITexture") as GUITexture;
        }

        fireRocketData     = hatchControl.AddComponent("PlayerLaunchRocket") as PlayerLaunchRocket;
        fireShellData      = gun.AddComponent("PlayerLaunchShell") as PlayerLaunchShell;
        movement           = gameObject.AddComponent("PlayerMovement") as PlayerMovement;
        positionCursorData = gunShieldControl.AddComponent("FollowCursor") as FollowCursor;

        AudioListener playerAudioListener = gameObject.AddComponent("AudioListener") as AudioListener;
    }
Exemplo n.º 4
0
    private void NewTeachX10()
    {
        string key   = "x10";
        int    value = NewGetTeachStep(key);

        if (value == 1)
        {
            GUIMain guiMain = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>();
            if (guiMain != null && guiMain.IsVisible)
            {
                NewSetJianTouPos(key, 1, CMD_X10_1, 300, 100f, new Vector3(-408f, 720f, 0f), new Vector3(200f, 30f, 0f), new Vector3(0f, -180f, -25f));
            }
        }
        else if (value == 2)
        {
            GUIPlayer guiPlayer = Globals.Instance.MGUIManager.GetGUIWindow <GUIPlayer>();
            if (guiPlayer != null && guiPlayer.IsVisible)
            {
                ShowTalkObj(7013, key, TeachFinishedValue, true);
            }
        }
    }
Exemplo n.º 5
0
    public void RecuperarVida(Atributos atributos, GUIPlayer gui)
    {
        if (atributos.VidaAtualMenorqVida())
        {
            switch (Tamanho)
            {
            case Tamanho.Pequeno:
                atributos.RecuperarVida(1.15f);
                gui.SetVida(atributos.vidaAtual, atributos.vida);
                break;

            case Tamanho.Medio:
                atributos.RecuperarVida(1.30f);
                gui.SetVida(atributos.vidaAtual, atributos.vida);
                break;

            case Tamanho.Grande:
                atributos.RecuperarVida(1.50f);
                gui.SetVida(atributos.vidaAtual, atributos.vida);
                break;
            }
        }
        Destroy(gameObject);
    }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     m_SetPlayer = GameManager.GetInstance().m_cPlayer;
     m_SetGUI    = GameManager.GetInstance().m_cGUIPlayer;
 }
Exemplo n.º 7
0
	private void PlayerMechanics()
	{
		playerGUI = gameObject.GetComponent("GUIPlayer") as GUIPlayer;
		playerGUI.Health = tankData.HealthAmount;
		playerGUI.MaxHealth = HealthSave;
		playerGUI.HealthBars = GameObject.Find(tankPreset.ToString() + "HealthBarsFull").
			GetComponent<GUIPlayer>().HealthBars;
		playerGUI.ShellAmmo = gunData.ShellAmmo;
		playerGUI.RocketAmmo = hatchControlData.RocketAmmo;
		
		playerGuiTexture.texture = new Texture2D(140, 60);
	}
Exemplo n.º 8
0
	private void PlayerControlled()
	{
		gameObject.tag = "Player";
		
		//Player Modules
		if(!gameObject.GetComponent("GUIPlayer"))
		{
			playerGUI = gameObject.AddComponent("GUIPlayer") as GUIPlayer;
		}
		if(!gameObject.GetComponent("GUITexture"))
		{
			playerGuiTexture = gameObject.AddComponent("GUITexture") as GUITexture;
		}
		
		fireRocketData = hatchControl.AddComponent("PlayerLaunchRocket") as PlayerLaunchRocket;  
		fireShellData = gun.AddComponent("PlayerLaunchShell") as PlayerLaunchShell;
		movement = gameObject.AddComponent("PlayerMovement") as PlayerMovement;
		positionCursorData = gunShieldControl.AddComponent("FollowCursor") as FollowCursor;
		
		AudioListener playerAudioListener = gameObject.AddComponent("AudioListener") as AudioListener;
	}