//Fuzzy Think IEnumerator Think() { yield return(new WaitForSeconds(0.4f)); FuzzyAnger = Fuzzy.Grade(Anger, 0, 30); FuzzyClickCount = Fuzzy.Grade(ClickCount, 3, 50); FuzzyPlayerDistance = Fuzzy.Grade(PlayerDistance, 1, 7); FuzzyFlashlightInt = Fuzzy.Grade(FlashlightInt, 1, 10); Debug.Log(FuzzyPlayerDistance); //Flee if FlashlightINT is high OR AI is close to the player degreeFlee = Fuzzy.OR(FuzzyFlashlightInt, Fuzzy.NOT(FuzzyPlayerDistance)); //ChasePlayer if AI is far from player AND hes not angry degreeChasePlayer = Fuzzy.AND(FuzzyPlayerDistance, Fuzzy.NOT(FuzzyAnger)); //Dash based on the average of ANGER and ClickCount degreeDash = Fuzzy.AVERAGE(FuzzyAnger, FuzzyClickCount); //throwRock if ClickCount is low but hes angry degreeThrowRock = Fuzzy.AND(FuzzyAnger, Fuzzy.NOT(FuzzyClickCount)); fuzzyActionValue = Fuzzy.OR(Fuzzy.OR(degreeFlee, degreeChasePlayer), Fuzzy.OR(degreeDash, degreeThrowRock)); StartCoroutine(Think()); }