Exemplo n.º 1
0
    private void _createHeroBall(BattleHeroModel model)
    {
        BattleBall monsterBall = Instantiate(ballItem) as BattleBall;

        monsterBall.setBattleModel(model);

        monsterBall.transform.SetParent(ballContainer);
        monsterBall.transform.localScale = new Vector3(100, 100, 1);

        Vector3 point = model.getPos();

        monsterBall.transform.localPosition = point;

        monsterBall.gameObject.SetActive(true);
        model.setAction(false);
        model.MOVE_END += _nextAction;
    }
Exemplo n.º 2
0
    void OnCollisionExit2D(Collision2D other)
    {
        if (_needCheck)
        {
            BattleBall targetBall = other.gameObject.GetComponent <BattleBall> ();

            if (targetBall == null)
            {
                return;
            }

            BattleHeroModel target = targetBall.getBattleModel();

            if (_model.isMonster() != target.isMonster())
            {
                target.attacked(_model);
            }
        }
    }