예제 #1
0
    // Update is called once per frame
    protected void Update()
    {
        if (thinkingEnabled == false)
            return;

        if(initalizedIsDone == false)
        {
            Initalize ();
            initalizedIsDone = true;
        }
        if(world == null)
        {
            world = GameObject.Find ("World").GetComponent<WorldThink>();
            if(world == null)
            {
                Debug.Log(this.GetType().Name);
                Debug.Log (world);
            }
        }
        worldIteration = world.GetWorldIteration ();
        if (iteration < worldIteration)
        {
            ThinkAlpha();
            Think();
            iteration++;
        }
        if(world.GetRunning())
            ThinkFast ();
    }
예제 #2
0
 protected void Start()
 {
     //	thinkingEnabled = true;
     iteration = 0;
     worldIteration = 0;
     world = GameObject.Find ("World").GetComponent<WorldThink>();
     //		Debug.Log (this.name);
 }