Пример #1
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        IFloorable target = coll.gameObject.GetComponent <IFloorable>();

        if (target != null && target.GetType() != typeof(HumanAI) && target.GetType() != typeof(MovableObject))
        {
            target.SetFloor(floor);
            // Debug.Log(coll.gameObject.name);
        }
    }
Пример #2
0
    public void NoticeSound(IFloorable target)
    {
        emoticonLove.SetActive(false);
        emoticonScared.SetActive(false);
        emoticonHostile.SetActive(false);
        StopAllCoroutines();
        Vector2 destination = target.GetPos();
        Floor   targetFloor = target.GetFloor();

        StartCoroutine(ChaseSound(destination, targetFloor));
    }
Пример #3
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        if (coll.gameObject.GetComponent <StairCase>() != null)
        {
            owner.SetStair(coll.gameObject.GetComponent <StairCase>());
        }
        if (coll.gameObject.GetComponent <SolidGround>() != null)
        {
            owner.SetFloor(coll.gameObject.GetComponent <SolidGround>().floor);
        }
        IFloorable target = coll.gameObject.GetComponent <IFloorable>();

        if (target != null)
        {
            if (target.IsOnStair() && target.GetStair() != null)
            {
                owner.SetStair(target.GetStair());
            }
            else if (!target.IsOnStair() && target.GetFloor() != null)
            {
                owner.SetFloor(target.GetFloor());
            }
        }
    }
Пример #4
0
 public void NoticeSound(IFloorable target)
 {
     emoticonLove.SetActive(false);
     emoticonScared.SetActive(false);
     emoticonHostile.SetActive(false);
     StopAllCoroutines();
     Vector2 destination = target.GetPos();
     Floor targetFloor = target.GetFloor();
     StartCoroutine(ChaseSound(destination, targetFloor));
 }