Esempio n. 1
0
        public override void GetNewTask()
        {
            if (stats.MoneyAmount <= 5)
            {
                var bank = FindObjectOfType <Building_Normal_Service_Bank>();
                if (bank == null)
                {
                    return;
                }

                CurrentAction = new BuyFromStore(this, bank);
                return;
            }


            var rand = Random.Range(1, 4);

            if (rand == 1)
            {
                CurrentAction = new TalkAction(this, WorldObjects.GetPersonTarget(this), Random.Range(5f, 15f));
            }
            if (rand == 2)
            {
                CurrentAction = new IdleMovement(this, Random.Range(5f, 15f));
            }
            if (rand == 3)
            {
                var store = FindObjectOfType <Building_Normal_Service_Store>();
                if (store == null)
                {
                    return;
                }
                CurrentAction = new BuyFromStore(this, store);
            }
        }
Esempio n. 2
0
    void Start()
    {
        idleMovement = GetComponent<IdleMovement>();

        enemyName = this.name;
    }