void Start()
 {
     pa           = this.GetComponent <PlayerAnimate> ();
     sc           = GameObject.FindGameObjectWithTag("GameController").GetComponent <SpriteContainer> ();
     oneHandSpawn = GameObject.Find("oneHandSpawn");
     bl           = GameObject.Find("Bullet").GetComponent <Bullet> ();
 }
    void killPlayer()
    {
        if (this.GetComponent <PlayerAnimate> ().enabled == true)
        {
            PlayerAnimate  pa  = this.GetComponent <PlayerAnimate> ();
            PlayerMovement pm  = this.GetComponent <PlayerMovement> ();
            RotateToCursor rot = this.GetComponent <RotateToCursor> ();
            WeaponAttack   wa  = this.GetComponent <WeaponAttack> ();
            legDir         ld  = this.GetComponentInChildren <legDir> ();
            wa.dropWeapon();
            pa.legs.sprite  = null;
            pa.legs.enabled = false;
            ld.enabled      = false;

            pa.torso.sprite = deadSpr;
            pa.enabled      = false;

            rot.enabled = false;
            wa.enabled  = false;

            pm.enabled = false;
            CircleCollider2D col = this.GetComponent <CircleCollider2D> ();
            col.enabled = false;
        }
    }
Exemplo n.º 3
0
    void revivePlayer()
    {
        dead = false;

        Debug.Log("PlayerHealth - revivePlayer");

        PlayerAnimate  pa  = this.GetComponent <PlayerAnimate> ();
        PlayerMovement pm  = this.GetComponent <PlayerMovement> ();
        RotateToCursor rot = this.GetComponent <RotateToCursor> ();
        WeaponAttack   wa  = this.GetComponent <WeaponAttack> ();

        dead = false;
        legDir ld = this.GetComponentInChildren <legDir> ();

        wa.dropWeapon();
        pa.legs.enabled = true;
        ld.enabled      = true;
        pa.enabled      = true;
        rot.enabled     = true;
        wa.enabled      = true;
        pm.enabled      = true;
        CircleCollider2D col = this.GetComponent <CircleCollider2D> ();

        col.enabled = true;
    }
Exemplo n.º 4
0
    void Start()
    {
        Scene currentScene = SceneManager.GetActiveScene();

        sceneName = currentScene.name;
        pa        = this.GetComponent <PlayerAnimate> ();
        sc        = GameObject.FindGameObjectWithTag("GameController").GetComponent <SpriteContainer> ();
    }
Exemplo n.º 5
0
 private void OnTriggerStay(Collider collider)
 {
     if (collider.gameObject == player)
     {
         PlayerAnimate playerAnimate = player.GetComponentInChildren <PlayerAnimate>();
         if (playerAnimate.Meleeing())
         {
             unconscious = true;
         }
     }
 }
Exemplo n.º 6
0
        private void buttonPlay_Click(object sender, EventArgs e)
        {
            PlayerAnimate.Start();
            virusStartScreen.Visible = false;
            labelTitle.Visible       = false;
            buttonPlay.Visible       = false;
            this.Height = 460;
            this.Width  = 760;
            int rand1 = rand.Next(30, 730);
            int rand2 = rand.Next(30, 430);

            Player.Location = new Point(rand1, rand2);
            MoveTimer.Start();
        }
Exemplo n.º 7
0
    public void Damage()
    {
        _audioSource.Play();
        _health--;

        if (_health <= 0)
        {
            _died = true;
        }

        PlayerAnimate playerAnimate = this.GetComponent <PlayerAnimate>();

        playerAnimate.Damage();

        GameManager.instance.CurrentHealth(_health);
    }
Exemplo n.º 8
0
    void Start()
    {
        originalLightColor = spotlight.color;
        spotlight.color    = Color.yellow;
        player             = GameObject.FindGameObjectWithTag("Player");
        navAgent           = GetComponent <NavMeshAgent>();
        viewAngle          = spotlight.spotAngle;
        firstReturnTimer   = returnTimer;

        crouchables   = GameObject.FindGameObjectsWithTag("Crouchable");
        playerAnimate = player.GetComponentInChildren <PlayerAnimate>();
        anim          = GetComponentInChildren <Animator>();

        GotoNextPoint();

        //SetWaypoints();
    }
Exemplo n.º 9
0
    public void revivePlayer()
    {
        PlayerAnimate  pa     = this.GetComponent <PlayerAnimate>();
        playermovement pm     = this.GetComponent <playermovement>();
        rotateToCursor rot    = this.GetComponent <rotateToCursor>();
        WeaponAttack   wa     = this.GetComponent <WeaponAttack>();
        LegsDirection  legDir = this.GetComponentInChildren <LegsDirection>();

        wa.dropWeapon();
        pa.legs.enabled = true;
        legDir.enabled  = true;

        pa.enabled  = true;
        rot.enabled = true;
        wa.enabled  = true;
        pm.enabled  = true;
        dead        = false;
    }
Exemplo n.º 10
0
    void KillPlayer()
    {
        if (this.GetComponent <PlayerAnimate>().enabled == true)
        {
            PlayerAnimate  pa     = this.GetComponent <PlayerAnimate>();
            playermovement pm     = this.GetComponent <playermovement>();
            rotateToCursor rot    = this.GetComponent <rotateToCursor>();
            WeaponAttack   wa     = this.GetComponent <WeaponAttack>();
            LegsDirection  legDir = this.GetComponentInChildren <LegsDirection>();
            wa.dropWeapon();
            pa.legs.sprite  = null;
            pa.legs.enabled = false;
            legDir.enabled  = false;

            pa.torso.sprite = deadSpr;
            pa.enabled      = false;
            rot.enabled     = false;
            wa.enabled      = false;
            pm.enabled      = false;
            BoxCollider2D col = this.GetComponent <BoxCollider2D>();
            col.enabled = false;
        }
    }
Exemplo n.º 11
0
 private void Awake()
 {
     m_Memory = MemoryPull.instance;
     m_Player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAnimate>();
 }
Exemplo n.º 12
0
    //public EnemyAttacked ea;

    // Use this for initialization
    void Start()
    {
        pa = this.GetComponent <PlayerAnimate>();
        sc = GameObject.FindGameObjectWithTag("GameController").GetComponent <SpriteContainer>();
    }
Exemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     pa = GetComponent <PlayerAnimate>();
     sc = GameObject.FindGameObjectWithTag("Player").GetComponent <spriteContainers>();
 }
Exemplo n.º 14
0
 void Start()
 {
     m_PlayerLife    = 3;
     m_CoinCount     = 0;
     m_PalyerAnimate = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAnimate>();
 }