Exemple #1
0
        public void Attack(bool isEnemy)
        {
            if (CanAttack)
            {
                shootCooldown = shootingRate;
                soloPlayer shotType = GetComponent <soloPlayer>();


                if (shotType.timer >= shotType.startTime)
                {
                    var shotTransform = Instantiate(shotPrefab2) as Transform;
                    AttackType(shotTransform);
                    Shot shot = shotTransform.gameObject.GetComponent <Shot>();

                    if (shot != null)
                    {
                        shot.isEnemyShot = isEnemy;
                    }
                }
                else
                {
                    var shotTransform1 = Instantiate(shotPrefab) as Transform;
                    AttackType(shotTransform1);

                    Shot shot = shotTransform1.gameObject.GetComponent <Shot>();

                    if (shot != null)
                    {
                        shot.isEnemyShot = isEnemy;
                    }
                }
            }
        }
Exemple #2
0
        void Start()
        {
            Physics2D.IgnoreLayerCollision(8, 9);
            player = GameObject.FindGameObjectWithTag("player").GetComponent <soloPlayer>();
            switch (perso)
            {
            case "Boss":
                break;

            default:
                health += PersistantManagerScript.Instance.HeroModif[0];
                break;
            }

            maxhealth = health;
        }