Ejemplo n.º 1
0
 void Awake()
 {
     if (m_ManController == null)
     {
         GameObject Girl = GameObject.FindGameObjectWithTag("Man");
         if (Girl != null)
         {
             m_ManController = Girl.GetComponent <ManController>();
         }
         else
         {
             Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
         }
     }
     if (m_PlayerController == null)
     {
         GameObject player = GameObject.FindGameObjectWithTag("Player");
         if (player != null)
         {
             m_PlayerController = player.GetComponent <PlayerController>();
         }
         else
         {
             Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
         }
     }
 }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     if (manController == null)
     {
         manController = transform.parent.GetComponentInChildren <ManController>();
     }
 }
Ejemplo n.º 3
0
 void Awake()
 {
     if (m_ManController == null)
     {
         GameObject Girl = GameObject.FindGameObjectWithTag("Man");
         if (Girl != null)
         {
             m_ManController = Girl.GetComponent<ManController>();
         }
         else Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
     }
     if (m_PlayerController == null)
     {
         GameObject player = GameObject.FindGameObjectWithTag("Player");
         if (player != null)
         {
             m_PlayerController = player.GetComponent<PlayerController>();
         }
         else Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
     }
 }
Ejemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        for (int i = 0; i < foodSpawnPoints.Length; i++)
        {
            if (foodSpawnPoints[i].childCount == 0 || waterSpawnPoints[i].childCount == 0)
            {
                if (findClosestMan() != null)
                {
                    man = findClosestMan().GetComponent <ManController>();
                    man.agent.SetDestination(transform.position);
                    Debug.Log("going to table");

                    if (Vector3.Distance(man.transform.position, transform.position) <= 2)
                    {
                        Debug.Log("Refilling");
                        isOccupied = true;
                        SpawnObjects();
                        StartCoroutine(SpawnObjects());
                    }
                }
            }
        }
    }
Ejemplo n.º 5
0
 void Awake()
 {
     rb            = GetComponent <Rigidbody> ();
     manController = GameObject.Find("Man_prepared").GetComponentInChildren <ManController>();
 }
Ejemplo n.º 6
0
 private void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <ManController>();
 }
    // void FlipTowardsVelocity()
    // {
    //     if(
    //         (rb.velocity.x < 0 && transform.localScale.x > 0) ||
    //         (rb.velocity.x > 0 && transform.localScale.x < 0)
    //     )
    //         transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
    // }

    void SetTargetMan()
    {
        targetMan = men.Where(e => e.Head.position.x > transform.position.x).OrderBy(e => Vector3.Distance(transform.position, e.Head.position)).ToArray()[0];
        handDown2WrapperTransform.position = new Vector3(targetMan.Head.position.x, handDown2WrapperTransform.position.y, handDown2WrapperTransform.position.z);
    }
Ejemplo n.º 8
0
 void Awake()
 {
     mC = GameObject.Find("Man_Handle").GetComponent <ManController>();
     uC = GameObject.Find("UIManager").GetComponent <UIController>();
 }
Ejemplo n.º 9
0
	// Use this for initialization
	void Start () {
        if (manController == null)
        {
            manController = transform.parent.GetComponentInChildren<ManController>();
        }
	}