How to count gameobjects by Tag in unity3D with C# ?

I was simulating the Monte Carlo Method for my assignment on course Game Based Simulation using Unity 3D.  I want to count the instantiated game objects. Though there are other methods like OnTriggerEnter(Collider other). But this method did not worked pretty well. The next method I want to try is to count the game object by their tag name. The process of implementing the code is like below.

First define game object class in public are like this

 

using UnityEngine;
using System.Collections;
using System.IO;
public class countfox : MonoBehaviour {
public int count_fox;
//public int count_rabbit;
public int count_rabbitNEW;
StreamWriter sw;
GameObject [] rabbit;
GameObject [] fox;

void Start(){
sw = new StreamWriter(“count_fox.txt”);
}

void Update(){

rabbit = GameObject.FindGameObjectsWithTag(“rabbit”);
count_rabbitNEW = rabbit.Length;
sw.WriteLine(” ” + count_fox+” “+ count_rabbitNEW+” “+System.DateTime.Now, true);
sw.Flush();

fox = GameObject.FindGameObjectsWithTag(“fox”);
count_fox= fox.Length;
if (count_fox == 0) {
Debug.Break ();

// Application.Quit ();
}
}

}

How to Fix Authentication Failed for Gmail Account Error in Opera Mail Client (100 % working)

In this article I will explain how to fix “The server respinded:Please log in via your web browser: http://support.google.com/mail/accounts/bing/answer.py?answer=78754 (Failure)” error in Opera mail client.

This is the common you may get while trying to import your gmail email in third party email client. We know , Gmail is a great tool. I  have more than 15 gmail accounts which I need to check very often.I was using Microsoft Outlook as email client before. Due to high memory consumption by outlook I was searching for the extremely light weight email client. Googlging for few hours I planned to installed Opera Mail client. The download size is approximately 11 mb.

After installing Opera mail Client , I tried adding my gmail accounts but could not authenticate with the server even though all credentials are correct. I have enabled my IMAP as well as POP. The error thrown by the opera mail client looks like

Authentication failed Open gmail imap error

 

I googled to fix the error but was diffult to find the exact solution.The most of the solution found on the internet mention to try the following link.

https://accounts.google.com/b/0/DisplayUnlockCaptcha

For my case this link did not worked. And I digg more with different keywords and found the solution. The solution is very easy. Login your gmail account from the browser and navigate to the account settings. Then click on the Security tab followed by Settings in Account Permissions.

Enable third party app for gmail

The intial setting will be disable. So change this setting to enable. Doing so Opera Mail App now will be able to authenticate your gmail account from the app as well as from browser.

Access for less secure apps gmail