void Start() { StartCoroutine(currentState.ToString()); players = GameObject.FindGameObjectsWithTag(player); GetActivePlayers(); SetPlayers(true); }
// Update is called once per frame void Update() { if (currentState != targetState) { StopCoroutine(currentState.ToString()); previousState = currentState; currentState = targetState; StartCoroutine(currentState.ToString()); } CreateItem(); ShowPicture(); ChangePlayers(); }