// Use this for initialization void Start() { inRadius = new List <PersonColourControl>(); meBody = GetComponent <Rigidbody2D> (); meColour = GetComponent <PersonColourControl> (); personMoving = GetComponent <PersonMovement>(); nearBorders = new List <Transform>(); StartCoroutine(SeekFriends()); }
void Awake() { if (master == null){ master = this; } else if (master != this){ Destroy(gameObject); } person = gameObject.GetComponent<Person>(); personMovement = GetComponent<PersonMovement>(); }
private void spawnPeople(int count) { for (int i = 0; i < count; i++) { Vector2 pos = getRandomPos(); GameObject go = Instantiate(peoplePrefabs[Random.Range(0, peoplePrefabs.Length)], pos, Quaternion.identity) as GameObject; PersonMovement p = go.GetComponent <PersonMovement> (); p.setMapSize(mapSize_X, mapSize_Y); personMovments.Add(p); } }
void OnTriggerExit2D(Collider2D collider) { // Show decoration entirely when nothing is under PersonMovement person = collider.GetComponent <PersonMovement> (); if (person != null) { person.setIsHiding(false); } if (collider.GetComponent <PersonMovement> () != null) { isCovered = false; } }
void OnTriggerStay2D(Collider2D collider) { // Lower alpha when something is underneath PersonMovement person = collider.GetComponent <PersonMovement> (); if (person != null) { person.setIsHiding(true); } if (collider.GetComponent <PersonMovement> () != null) { isCovered = true; } }
public void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player" && disableTimer <= 0) { disableTimer = 4; PersonMovement PM = other.gameObject.GetComponent <PersonMovement>(); if (!PM.transfer_direction && PM.transfering) { TransferUP(other.gameObject); } else { TransferDown(other.gameObject); } } }
void Awake() { name = gameObject.name; reputation = GetComponent<Reputation>(); position = transform.position; personSprite = GetComponent<PersonSprite>(); schedule = GetComponent<Schedule>(); if(gameObject.GetComponent<Collider>()){ currentBound = gameObject.GetComponent<Collider>().bounds; } personMovement = GetComponent<PersonMovement>(); }
protected override void Move() { PersonMovement.Move(EnemyAI.MoveToDirection, EnemyAI.IsJump); }
// Start is called before the first frame update private void Start() { Cursor.lockState = CursorLockMode.Locked; playerScript = GetComponentInParent <PersonMovement>(); cameraAnimator = GetComponent <Animator>(); }