/// <summary>
    /// Customer instantiation method. Called from CreateCustomers().
    /// @param The customer model to load, the customer saveable class to load data from, a Vector3 containing position, a Quaternion containing rotation.
    /// </summary>
    private void InstantiateNewCustomer(Customer cust, CustomerSaveable custSave, Vector3 position, Quaternion rotation)
    {
        Customer newCustomer = Instantiate(cust, position, rotation, instantiatedCustomerParent.transform) as Customer;

        newCustomer.SetCustomerNeeds(custSave.bladderStat, custSave.happinessStat, custSave.hungerStat, custSave.tirednessStat, custSave.queasinessStat, custSave.weakStat);
        newCustomer.prefabName = custSave.prefabName;
    }
Exemple #2
0
    private CustomerSaveable GetCustomerSaveable()
    {
        CustomerSaveable customerSave = new CustomerSaveable();

        customerSave.bladderStat    = bladderStat.StatValue;
        customerSave.happinessStat  = happinessStat.StatValue;
        customerSave.hungerStat     = hungerStat.StatValue;
        customerSave.tirednessStat  = tirednessStat.StatValue;
        customerSave.queasinessStat = queasinessStat.StatValue;

        customerSave.weakStat = this.weakStat;

        customerSave.PosX = this.customerTransform.position.x;
        customerSave.PosY = this.customerTransform.position.y;
        customerSave.PosZ = this.customerTransform.position.z;

        customerSave.RotX = this.customerTransform.rotation.x;
        customerSave.RotY = this.customerTransform.rotation.y;
        customerSave.RotZ = this.customerTransform.rotation.z;

        customerSave.prefabName = this.prefabName;

        return(customerSave);
    }