예제 #1
0
파일: Spawn.cs 프로젝트: Kritz7/Village
    // Use this for initialization
    void Awake()
    {
        if(name.Contains("House")) structureType = Structure.House;
        if(name.Contains("Stone")) structureType = Structure.Path;

        gs = GameObject.Find("NavigationGraph").GetComponent<GraphScript>();
        goalModifier = new Vector3(0, goalYModifier, 0);

        if(collider && disableCollider) collider.enabled = false;
        if(name.Contains("House"))
        {
            foreach(Transform t in transform)
            {
                if(t.collider) t.collider.isTrigger = true;
            }
        }
    }
예제 #2
0
    // Use this for initialization
    void Awake()
    {
        player = GameObject.Find("Player").transform;
        graph = GameObject.Find("NavigationGraph").GetComponent<GraphScript>();
        voice = transform.FindChild("Speech").GetComponent<Speak>();

        transform.FindChild("Cube").renderer.material.mainTexture = Resources.Load("Villager-" + Random.Range(1,4)) as Texture;

        float spawnSay = Random.value;

        if(spawnSay > 0.9) voice.Say("Exuberant!");
        else if(spawnSay > 0.8) voice.Say("Alive again!");
        else if(spawnSay > 0.7) voice.Say("Why?");
        else if(spawnSay > 0.6) voice.Say("Hello, world!");
        else if(spawnSay > 0.5) voice.Say("Statistical!");
        else if(spawnSay > 0.4) voice.Say("Help");
        else if(spawnSay > 0.3) voice.Say("*hick*");
        else if(spawnSay > 0.2) voice.Say("Hats!");
        else if(spawnSay > 0.1) voice.Say("I'm lost.");
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.Find("Player").transform;
        graph = GameObject.Find("NavigationGraph").GetComponent<GraphScript>();
        voice = transform.FindChild("Speech").GetComponent<Speak>();

        transform.FindChild("Cube").renderer.material.mainTexture = Resources.Load("Villager-" + Random.Range(1,4)) as Texture;

        Say ("Exuberant!", "Alive again!", "Why?", "Hello, world!", "Statistical!", "Help", "*hick*", "Hats!", "I'm lost.");
    }
예제 #4
0
 // Use this for initialization
 void Start()
 {
     graph = GameObject.Find("NavigationGraph").GetComponent<GraphScript>();
 }
예제 #5
0
 void Start()
 {
     dist  = GameObject.Find("NormalDistribution").GetComponentInChildren <NormalDistributionScript>();
     graph = GameObject.Find("Graph").GetComponentInChildren <GraphScript>();
 }