// Start is called before the first frame update
    void Start()
    {
        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Player"))
        {
            players.Add(obj.gameObject);
        }

        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Enemy"))
        {
            enemies.Add(obj.gameObject);
        }

        blueTeamBtn.onClick.AddListener(BlueTeamReset);
        redTeamBtn.onClick.AddListener(RedTeamReset);
        //Always start from Blue Team
        redTeamBtn.gameObject.SetActive(false);
        redCDPanel.gameObject.SetActive(false);
        blueCDPanel.gameObject.SetActive(false);


        if (PlayerPrefs.GetInt("Mode", 0) != 4)
        {
            dragSystem = FindObjectOfType <DragSystemOffline>().GetComponent <DragSystemOffline>();
            turnMenu   = FindObjectOfType <TurnMenuOffline>().GetComponent <TurnMenuOffline>();
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        //Get Component
        dragSystem = FindObjectOfType <DragSystemOffline>().GetComponent <DragSystemOffline>();

        if (PlayerPrefs.GetInt("Mode", 0) == 1 || PlayerPrefs.GetInt("Mode", 0) == 5)
        {
            if (PlayerPrefs.GetInt("Mode", 0) == 5)
            {
                currentTurn = PlayerPrefs.GetInt("Turn", 1);
            }
            StartCoroutine(YourturnMenu());
        }
        else if (PlayerPrefs.GetInt("Mode", 0) == 2 || PlayerPrefs.GetInt("Mode", 0) == 3)
        {
            try
            {
                Youturn.gameObject.SetActive(false);
                panel.gameObject.SetActive(false);
            }
            catch (Exception e)
            {
                //Avoid crash
            }
        }

        redCD      = PlayerPrefs.GetInt("RedCD", 0);
        blueCD     = PlayerPrefs.GetInt("BlueCD", 0);
        tempRedCD  = 0;
        tempBlueCD = 0;
    }
 // Start is called before the first frame update
 void Start()
 {
     try
     {
         turnMenu   = FindObjectOfType <TurnMenuOffline>().GetComponent <TurnMenuOffline>();
         dragSystem = FindObjectOfType <DragSystemOffline>().GetComponent <DragSystemOffline>();
         ballSpeed  = FindObjectOfType <SoccerSpeedControlOffline>().GetComponent <SoccerSpeedControlOffline>();
     }
     catch (Exception e)
     {
         //Avoid crash
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     dragSystem     = FindObjectOfType <DragSystemOffline>().GetComponent <DragSystemOffline>();
     ColorSystem    = FindObjectOfType <ColorSystemOffline>().GetComponent <ColorSystemOffline>();
     originPosition = gameObject.GetComponent <Transform>().localPosition;
 }