Exemple #1
0
    // [HideInInspector]
    // public Move parent;

    // // Start is called before the first frame update
    // void Start()
    // {

    // }

    // // Update is called once per frame
    // void Update()
    // {

    // }

    // void OnTriggerEnter2D(Collider2D collision)
    // {
    //  // tell parent object
    //  // var move = gameObject.transform.parent.gameObject.GetComponent<Move>();
    //  parent.handleFootCollided();
    // }

    void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.gameObject.GetComponent <Collider2D>().isTrigger)
        {
            return;
        }

        // tell parent object
        // parent.handleFootCollided();
        EventObjectIn?.Invoke(collision.gameObject);
    }
Exemple #2
0
    void handleObjectInRange(Collider2D collision)
    {
        // if(!enabled || parent.isDoingUlti) return;
        if (!enabled)
        {
            return;
        }

        // if (GameObject.ReferenceEquals( collision.gameObject, parent.objectToChase))
        // {
        //  parent.handleObjectInWeaponRange(collision.gameObject);
        // }
        EventObjectIn?.Invoke(collision.gameObject);
    }
Exemple #3
0
    void handleWeaponCollided(Collider2D collision)
    {
        // if (isFire && collision.gameObject.CompareTag("enemy"))
        // if (isFire && tagsAttacked.Contains(collision.gameObject.tag))
        // if (isFire)
        // {


        // }

        if (enabled && !colliders.Contains(collision))
        {
            colliders.Add(collision);
            // parent.handleWeaponCollided(collision.gameObject);
            EventObjectIn?.Invoke(collision.gameObject);
        }
    }
Exemple #4
0
    void handleObjectInRange(Collider2D collision)
    {
        if (!isCheck)
        {
            return;
        }

        // if (isCheck && GameObject.ReferenceEquals(collision.gameObject, parent.objectToChase))
        // {
        // }

        if (!colliders.Contains(collision))
        {
            colliders.Add(collision);
            // parent.handleObjectInUltiRange(collision.gameObject);
            EventObjectIn?.Invoke(collision.gameObject);
        }
    }