Esempio n. 1
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateinfo, int layerindex)
    {
        animator.SetBool("OrderTaken", false);
        npc = animator.GetComponent <NpcAi>();

        npc.cloud.SetActive(false);
        npc.orderSprites = false;
        npc.state        = "OrderTaken";

        npc.orderSystem.GetComponent <OrderManager>().UpdateOrders(npc.order);
    }
Esempio n. 2
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        animator.SetBool("Ordering", false);
        npc = animator.GetComponent <NpcAi>();

        if (!npc.orderSprites)
        {
            npc.initiateOrderSprites();
        }

        npc.state = "Ordering";
    }
Esempio n. 3
0
    void Awake()
    {
        col = GetComponent<SphereCollider> ();
        col.radius = GetComponent<NpcAi> ().detectRange;
        col.isTrigger = true;

        nav = GetComponent<NavMeshAgent> ();
        anim = GetComponentInChildren<Animator> ();
        ai = GetComponent<NpcAi> ();
        senseTarget = null;

        InvokeRepeating ("GroundedCheck", 0.1f, 0.1f);
    }
Esempio n. 4
0
    void Awake()
    {
        col           = GetComponent <SphereCollider> ();
        col.radius    = GetComponent <NpcAi> ().detectRange;
        col.isTrigger = true;

        nav         = GetComponent <NavMeshAgent> ();
        anim        = GetComponentInChildren <Animator> ();
        ai          = GetComponent <NpcAi> ();
        senseTarget = null;

        InvokeRepeating("GroundedCheck", 0.1f, 0.1f);
    }
Esempio n. 5
0
        internal ServerContext(Listener listener, DataManager data, Coroutine coroutine)
        {
            _listener = listener;
            _data = data;
            _coroutine = coroutine;

            _npcAi = new NpcAi(this);

            LoadObjectsFromStore();
            if (_gameObjects.Count > 0)
            {
                _objectId = _gameObjects.Values.Select(e => e.ObjectId).Max() + 1;
            }
        }
Esempio n. 6
0
    public void OnEnter( NpcAi ai )
    {
        //Debug.Log( "Entering state " + this.ToString() );
        if( Ai == null )
        {
            Ai = ai;
        }

        DoEnter();

        _Update = true;
    }