コード例 #1
0
ファイル: PackMember.cs プロジェクト: madRebellion/AI-Project
 // Use this for initialization
 void Awake()
 {
     performingAction = false;
     SB        = GetComponent <SteeringBehaviours>();
     DB        = GetComponent <Birdwatcher>();
     SD        = GetComponent <SleepDesire>();
     CD        = GetComponent <ConsumeDesire>();
     TD        = GetComponent <ToiletDesire>();
     WD        = GetComponent <WasherDesire>();
     PU        = GetComponent <PillUnit>();
     foodTrees = GameObject.FindGameObjectsWithTag("Food");
     toilets   = GameObject.FindGameObjectsWithTag("Toilet");
     washers   = GameObject.FindGameObjectsWithTag("Washer");
     FindClosestSustinance();
     FindClosestToilet();
     FindClosestWasher();
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        SD = GetComponent <SleepDesire>();
        CD = GetComponent <ConsumeDesire>();
        TD = GetComponent <ToiletDesire>();
        BW = GetComponent <Birdwatcher>();
        WD = GetComponent <WasherDesire>();
        PM = GetComponent <PackMember>();
        WashDesirability    = GetComponent <Fuzzy>();
        EatDesirability     = GetComponent <Fuzzy>();
        SleepDesirability   = GetComponent <Fuzzy>();
        ExcreteDesirability = GetComponent <Fuzzy>();
        BirdDesirability    = GetComponent <Fuzzy>();
        lifeSpan            = 0;

        // Assigning UI texts
        #region
        foreach (Text t in GameObject.FindObjectsOfType <Text>())
        {
            if (t.name == "Quality of Life")
            {
                Qol = t;
            }
            else if (t.name == "Food")
            {
                food = t;
            }
            else if (t.name == "Sleep")
            {
                sleep = t;
            }
            else if (t.name == "Toilet")
            {
                toilet = t;
            }
            else if (t.name == "Wash")
            {
                wash = t;
            }
            else if (t.name == "Fun")
            {
                fun = t;
            }
            else if (t.name == "QoLValue")
            {
                QolValue = t;
            }
            else if (t.name == "FoodValue")
            {
                foodValue = t;
            }
            else if (t.name == "SleepValue")
            {
                sleepValue = t;
            }
            else if (t.name == "ToiletValue")
            {
                toiletValue = t;
            }
            else if (t.name == "WashValue")
            {
                washValue = t;
            }
            else if (t.name == "FunValue")
            {
                funValue = t;
            }
            else if (t.name == "Desire")
            {
                currentD = t;
            }
        }
        #endregion
    }