using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameObjectTagController : MonoBehaviour {



    private void Start()
    {
        StartCoroutine(WaitForTagControl());
    }

    private IEnumerator WaitForTagControl()
    {
        yield return new WaitForSeconds(0.10f);
        if (gameObject.tag == "Player1")
        {
            GetComponent<Player1Controller>().enabled = true;
            GetComponent<Player2Controller>().enabled = false;
            GetComponent<NeutralRandomMove>().enabled = false;
        }
        if (gameObject.tag == "Player2")
        {
            GetComponent<Player1Controller>().enabled = false;
            GetComponent<Player2Controller>().enabled = true;
            GetComponent<NeutralRandomMove>().enabled = false;
        }
        if (gameObject.tag == "Neutral")
        {
            GetComponent<Player1Controller>().enabled = false;
            GetComponent<Player2Controller>().enabled = false;
            GetComponent<NeutralRandomMove>().enabled = true;
        }
        StartCoroutine(WaitForTagControl());
    }
}
