public void SetView(MonsterView view)
    {
        _view = view;

        pathFollower.Start(view.transform);
        pathFollower.OnPathEnded += CommitSuicide;

        attackSystem.AddMonster(this);
    }
Example #2
0
    public void AddMonster(object[] data)
    {
        MonsterInfo charInfo = (MonsterInfo)data[0];
        MonsterView charView = new MonsterView(charInfo);

        charView.LoadModel();
        if (monsters.ContainsKey(charInfo.Id))
        {
            monsters[charInfo.Id] = charView;
        }
        else
        {
            monsters.Add(charInfo.Id, charView);
        }
    }
Example #3
0
    public MonsterView[] GetMonstersInRange()
    {
        List <MonsterView> monsters = new List <MonsterView>();

        Collider[] colliders = Physics.OverlapSphere(transform.position, range);
        foreach (Collider collider in colliders)
        {
            GameObject  gameObject = collider.gameObject;
            MonsterView monster    = gameObject.GetComponent <MonsterView>();
            if (monster != null)
            {
                monsters.Add(monster);
            }
        }

        return(monsters.ToArray());
    }
Example #4
0
 public void OnMonsterHit(MonsterView view)
 {
     view.OnShot(Model);
 }
Example #5
0
    public void SetView(MonsterView view)
    {
        _view = view;

        attackSystem.AddMonster(this);
    }
    public void SetView(MonsterView view)
    {
        _view = view;

        attackSystem.AddMonster(this);
    }