// Use this for initialization void Start() { lives = 5; delay = Delay; audioSource = GetComponent <AudioSource>(); animator = GetComponent <Animator>(); EnemyRigidbody = GetComponent <Rigidbody2D>(); movementDirection = -1; fireScript = GetComponentInChildren <FireSpit_script>(); Bridge = GameObject.Find("Bridge"); script = GetComponentInChildren <Hammer_script>(); }
Transform groundCheck; // Child object located under game object // Use this for initialization void Start() { groundCheck = transform.Find("Ground check"); scooreScript = GetComponentInChildren <Scoore_script>(); scoore = transform.Find("Scoore"); movingHorizontally = true; setDelay = true; boxCollider = GetComponent <BoxCollider2D>(); script = GetComponentInChildren <Hammer_script>(); EnemyRigidbody = GetComponent <Rigidbody2D>(); movementDirection = 1; chaseTimer = ChaseTimerValue; animator = GetComponent <Animator>(); }
} // Instance of parented hammer, which creates clones // Use this for initialization void Start() { if (transform.parent != null) { Instance = this; if (transform.parent.name.Contains("Hammer")) { scriptH = GetComponentInParent <HammerBro_script>(); HammerBro = true; } else { scriptB = GetComponentInParent <Bowser_script>(); Bowser = true; } } Throw = false; rigidBody = GetComponent <Rigidbody2D>(); timer = TimerValue; }