void AssignComponents()
 {
     pooler     = GameObject.Find("SpawnerObj").GetComponent <D_BulletPooler>();
     rb2d       = GetComponent <Rigidbody2D>();
     hBarScript = GetComponent <HealthBar>();
     iFrameTime = iFrameTimeMax;
     sRend      = this.gameObject.GetComponent <SpriteRenderer>();
     camShake   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShake>();
 }
 // Start is called before the first frame update
 void Awake()
 {
     if (current == null)
     {
         current = this;
     }
     else
     {
         Destroy(this.gameObject);
         return;
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (pooler == null)
     {
         pooler = GameObject.Find("SpawnerObj").GetComponent <D_BulletPooler>();
     }
     if (transform.parent != null && !shooting)
     {
         StartCoroutine(Shoot());
         shooting = true;
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        hBarScript = GetComponent <HealthBar>();
        pooler     = GameObject.Find("SpawnerObj").GetComponent <D_BulletPooler>();

        /***
         * if (Random.Range(0, 2) == 1)
         * {
         *  isMovingRight = true;
         * }
         * else
         * {
         *  isMovingRight = false;
         * }***/
        YPos = 8f;
        //YPos = Random.Range(MoveToYPosRand - YPosDiff, MoveToYPosRand + YPosDiff);
        moveSpeed = Random.Range(moveSpeed - moveSpeedDiff, moveSpeed + moveSpeedDiff);

        /***
         * if (XPosRange > 3.5)
         *  XPosRange = 3.5f;
         * xPos = this.transform.position.x;
         * XPosRange = Random.Range(0, XPosRange);
         * if(XPosRange < 1.5f)
         * {
         *  XPosRange = 1.5f;
         * }***/
        MovePoints = GameObject.Find("EnemyMovements");
        if (this.name.Contains("D_EnemyFacing"))
        {
            Transform parent = MovePoints.transform.Find("RocketEnemy");
            SpecificMovePoints = parent.GetComponentsInChildren <Transform>();
        }
        else if (this.name.Contains("D_EnemyCircle"))
        {
            Transform parent = MovePoints.transform.Find("CircleEnemy");
            SpecificMovePoints = parent.GetComponentsInChildren <Transform>();
        }
        else if (this.name.Contains("D_Enemy"))
        {
            Transform parent = MovePoints.transform.Find("NormalEnemy");
            SpecificMovePoints = parent.GetComponentsInChildren <Transform>();
        }
        if (SpecificMovePoints == null)
        {
            Debug.Log("NEED POINTS");
        }
        PointsLength = SpecificMovePoints.Length;
    }
Exemplo n.º 5
0
    // Start is called before the first frame update
    void Start()
    {
        hBarScript = GetComponent <HealthBar>();
        pooler     = GameObject.Find("SpawnerObj").GetComponent <D_BulletPooler>();
        moveSpeed  = Random.Range(moveSpeed - moveSpeedDiff, moveSpeed + moveSpeedDiff);

        MovePoints = GameObject.Find("EnemyMovements");
        Transform parent = MovePoints.transform.Find("CatBoss");

        SpecificMovePoints = parent.GetComponentsInChildren <Transform>();

        if (SpecificMovePoints == null)
        {
            Debug.Log("NEED POINTS");
        }
        PointsLength = SpecificMovePoints.Length;
    }
    // Start is called before the first frame update
    void Start()
    {
        pooler = GameObject.Find("SpawnerObj").GetComponent <D_BulletPooler>();


        curRot   = this.transform.localEulerAngles.z;
        startRot = curRot;

        if (startRot > 180)
        {
            flipRot = true;
        }
        else
        {
            flipRot = false;
        }
        //Debug.Log("StartRot" + startRot + "Name: " + name + " flipRot?: " + flipRot);
    }
 // Start is called before the first frame update
 void Start()
 {
     pooler = GameObject.Find("SpawnerObj").GetComponent <D_BulletPooler>();
 }