Example #1
0
    public PO_Sentinel GetSenitel()
    {
        foreach (PowerObject po in objects.Values)
        {
            GameObject  go = po.gameObject;
            PO_Sentinel s  = go.GetComponentInChildren <PO_Sentinel>();
            if (s != null)
            {
                return(s);
            }
        }

        return(null);
    }
    private void SetSeed(int seed, PO_Player player, PO_Sentinel sentinel)
    {
        _sentinelGridPosition = Vector3.positiveInfinity;
        _seed = seed;

        _player = player;
        if (_player != null)
        {
            _player.ON_ABSORBED.AddListener(OnPlayerAbsorbed);
            _player.ON_GRID_POSITION_CHANGE.AddListener(OnPlayerGridPositionChanged);
        }

        _sentinel = sentinel;
        if (_sentinel != null)
        {
            _sentinel.ON_ABSORBED.AddListener(OnSentinelAbsorbed);
        }
    }