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()!"); } } }
// Use this for initialization void Start() { if (manController == null) { manController = transform.parent.GetComponentInChildren <ManController>(); } }
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()!"); } }
// 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()); } } } } }
void Awake() { rb = GetComponent <Rigidbody> (); manController = GameObject.Find("Man_prepared").GetComponentInChildren <ManController>(); }
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); }
void Awake() { mC = GameObject.Find("Man_Handle").GetComponent <ManController>(); uC = GameObject.Find("UIManager").GetComponent <UIController>(); }
// Use this for initialization void Start () { if (manController == null) { manController = transform.parent.GetComponentInChildren<ManController>(); } }