Beispiel #1
0
    public void Init()
    {
        if (!enabled)
        {
            return;
        }
        stateIcon = GetComponentInChildren <StateIcon>();
        stateIcon.Init();
        navigator = GetComponent <Navigator>();
        navigator.Init();

        health     = new Health();
        rifle      = GetComponentInChildren <Rifle>();
        enemySight = GetComponent <EnemySight>();

        enemySight.SetOnPlayerSightedListener(() => {
            if (personality != null)
            {
                personality.OnPlayerSeen(Player.Instance.transform.position);
            }
        });
        sosSprite = Resources.Load <Sprite>("StateIcons\\sos");
        ChoosePersonality();
    }