Beispiel #1
0
    public void CallToInitialize(CustomerScriptable profile)
    {
        //index connects the patience parameters and the customer parameters

        this.profile = profile;
        type         = profile.customerType;
        int sleepIndex = (int)type;

        SetParameters(profile, sleepIndex);
        patience.SetParameters(profile, sleepIndex);
        animationOverrider.SetAnimations(profile.controller);
    }
Beispiel #2
0
    public void SetParameters(CustomerScriptable profile, int sleepIndex)
    {
        int patienceIndex = 0;

        switch (sleepIndex)
        {
        //salaryman
        case 1: patienceIndex = 1; break;

        //parent
        case 2: patienceIndex = 3; break;

        //student
        case 3: patienceIndex = 2; break;

        //random
        case 4: patienceIndex = Random.Range(1, 5); break;

        default: break;
        }

        patience  = profile.patience * patienceIndex;
        _patience = patience;
    }
Beispiel #3
0
 private void SetParameters(CustomerScriptable profile, int sleepIndex)
 {
     //copy all parameters from the scriptable object
     sleepNeeded    = profile.sleepNeeded * sleepIndex;
     sleepAllowance = profile.sleepAllowance * sleepIndex;
 }