Esempio n. 1
0
    public void Recruit(Recruitable person)
    {
        if (_carried != null)
        {
            return;
        }
        _anim.SetBool("IsCarrying", true);
        person.Available = false;
        WanderAI wander = person.GetComponent <WanderAI>();

        if (wander != null)
        {
            wander.enabled = false;
        }
        person.DisableMovement();
        person.CancelInvoke();
        person.transform.parent           = transform;
        person.transform.localPosition    = Vector2.up;
        person.transform.localEulerAngles = new Vector3(0, 0, 90);
        person.SortOrderOffset            = 2;
        foreach (Collider2D c in person.transform.GetComponents <Collider2D>())
        {
            c.enabled = false;
        }
        person.GetRigidbody().Sleep();
        _carried = person;
        SoundPlayer.Instance.PlaySound(LiftSFX);
    }
Esempio n. 2
0
 public void Init(GameObject gameObject)
 {
     wanderAI = new WanderAI((MovingEntity)gameObject,
                             gameObject.GetOrAddCustomProperty <WorldPosition>("BlockStartPosition", gameObject.Position.ToBlockPosition()),
                             gameObject.GetOrAddCustomProperty <int>("BlockRadius", 10));
 }