// Start is called before the first frame update void Start() { Mini_Slime_An = GetComponentInParent <Mini_Slime_Animation>(); Attack_Collider = GetComponent <BoxCollider2D>(); Mini_Slime_Mo = GetComponentInParent <Mini_Slime_Movement>(); Mini_Slime_He = GetComponentInParent <Mini_Slime_Heath>(); }
// Start is called before the first frame update void Start() { Mini_Slime_RB = GetComponent <Rigidbody2D>(); Mini_Slime_RB.velocity = new Vector2(Spawn_Velocity_X, Spawn_Velocity_Y); Mini_Slime_An = GetComponent <Mini_Slime_Animation>(); Target = GameObject.Find("Player"); Debug.Log(Target); // Difficulty switch switch (Global_Variable.Difficulty_Level) { case 2: Max_Horizontal_Speed = Hard_Speed; break; case 1: Max_Horizontal_Speed = Normal_Speed; break; default: Max_Horizontal_Speed = Easy_Speed; break; } }