// 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());
 }
Exemple #2
0
    void Awake()
    {
        if (master == null){
            master = this;
        } else if (master != this){
            Destroy(gameObject);
        }

        person = gameObject.GetComponent<Person>();
        personMovement = GetComponent<PersonMovement>();
    }
Exemple #3
0
 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);
     }
 }
Exemple #4
0
    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;
        }
    }
Exemple #5
0
    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;
        }
    }
Exemple #6
0
 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);
         }
     }
 }
Exemple #7
0
 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>();
 }
Exemple #8
0
 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>();
    }