Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         ElementChecks.ChangePlayerElem(allyElem);
     }
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        ElementChecks.Init(this);

        spriteRenderer = GetComponent <SpriteRenderer>();
        rigid          = GetComponent <Rigidbody2D>();
    }
Example #3
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.transform.tag == "Player")
        {
            Elements        playerElem = collision.transform.GetComponent <PlayerController>().GetElem();
            ResultElemInter result     = ElementChecks.ComparePlayerElem(objGoodElem, objEnemyElem);
            switch (result)
            {
            case ResultElemInter.ALLY:
                Destroy(gameObject);
                //goodAction.ToString();
                break;

            case ResultElemInter.ENEMY:
                //badAction.ToString();
                break;
            }
        }
    }