Example #1
0
    public void configure(CustomerDesc desc)
    {
        foreach(CustomerStateDesc stateDesc in desc.stateDescribers)
        {
            _statesMap.Add(stateDesc.state, stateDesc);
        }

        ContentManager.instance.configureObject(_sprite, desc.spriteAtlas, desc.spriteName);
        ContentManager.instance.precacheAnimation(_sprite, desc.animationAtlas);

        BoxCollider box = gameObject.AddComponent<BoxCollider>();
        box.size = new Vector3(_sprite.GetBounds().size.x, _sprite.GetBounds().size.y, 1);

        _currentMood = 100;
        _moodDownSpeed = 60f/desc.moodDownTime;

        setState(CustomerState.INITIAL_STATE);

        _cachedDesc = desc;
    }
Example #2
0
    void spawnCustomer(CustomerDesc desc, string[] orders)
    {
        GameObject customerGO = new GameObject();
        //CustomerDeprecated customer = customerGO.AddComponent<CustomerDeprecated>();
        //customer.pushOrders(orders);
        //customer.configure(desc);
        Customer customer = customerGO.AddComponent <Customer>();

        customer.configure(desc);

        if (spawnArea.freePointExist())
        {
            spawnArea.placeCustomer(customer);
        }
        else
        {
            customerGO.SetActive(false);
            _customerQueue.Add(customer);
        }
    }
Example #3
0
    public void configure(CustomerDesc desc)
    {
        foreach (CustomerStateDesc stateDesc in desc.stateDescribers)
        {
            _statesMap.Add(stateDesc.state, stateDesc);
        }

        ContentManager.instance.configureObject(_sprite, desc.spriteAtlas, desc.spriteName);
        ContentManager.instance.precacheAnimation(_sprite, desc.animationAtlas);

        BoxCollider box = gameObject.AddComponent <BoxCollider>();

        box.size = new Vector3(_sprite.GetBounds().size.x, _sprite.GetBounds().size.y, 1);

        _currentMood   = 100;
        _moodDownSpeed = 60f / desc.moodDownTime;

        setState(CustomerState.INITIAL_STATE);

        _cachedDesc = desc;
    }
    public void configure(CustomerDesc desc)
    {
        _desc = desc;

        _sprite = gameObject.AddComponent<tk2dAnimatedSprite>();
        ContentManager.instance.configureObject(_sprite, _desc.spriteAtlas, _desc.spriteName);
        Debug.Log("Old animation atlas - "+_desc.animationAtlas);
        ContentManager.instance.precacheAnimation(_sprite, _desc.animationAtlas);

        _currentMood = 100;
        _moodDownSpeed = 60f/desc.moodDownTime;

        GameObject tableGO = (GameObject)Instantiate((GameObject)Resources.Load("Prefabs/OrderTable"), Vector3.zero, Quaternion.identity);

        _orderTable = tableGO.GetComponent<OrderTable>();

        BoxCollider box = gameObject.AddComponent<BoxCollider>();
        box.size = new Vector3(_sprite.GetBounds().size.x, _sprite.GetBounds().size.y, 1);

        _sprite.Play("hello");

        setState(CustomerStateDeprecated.WAITING_STAND);
    }
Example #5
0
    public void configure(CustomerDesc desc)
    {
        _desc = desc;

        _sprite = gameObject.AddComponent <tk2dAnimatedSprite>();
        ContentManager.instance.configureObject(_sprite, _desc.spriteAtlas, _desc.spriteName);
        Debug.Log("Old animation atlas - " + _desc.animationAtlas);
        ContentManager.instance.precacheAnimation(_sprite, _desc.animationAtlas);

        _currentMood   = 100;
        _moodDownSpeed = 60f / desc.moodDownTime;

        GameObject tableGO = (GameObject)Instantiate((GameObject)Resources.Load("Prefabs/OrderTable"), Vector3.zero, Quaternion.identity);

        _orderTable = tableGO.GetComponent <OrderTable>();

        BoxCollider box = gameObject.AddComponent <BoxCollider>();

        box.size = new Vector3(_sprite.GetBounds().size.x, _sprite.GetBounds().size.y, 1);

        _sprite.Play("hello");

        setState(CustomerStateDeprecated.WAITING_STAND);
    }
Example #6
0
    void spawnCustomer(CustomerDesc desc, string[] orders)
    {
        GameObject customerGO = new GameObject();
        //CustomerDeprecated customer = customerGO.AddComponent<CustomerDeprecated>();
        //customer.pushOrders(orders);
        //customer.configure(desc);
        Customer customer = customerGO.AddComponent<Customer>();
        customer.configure(desc);

        if (spawnArea.freePointExist())
        {
            spawnArea.placeCustomer(customer);
        }
        else
        {
            customerGO.SetActive(false);
            _customerQueue.Add(customer);
        }
    }