Exemple #1
0
    protected override void ApplyTemporalOutcome(eTemporalTriggerOutcome outcome)
    {
        switch (outcome)
        {
        case eTemporalTriggerOutcome.Crop_Grow:
            mMeshArrayIndex++;
            if (mMeshFilter != null && meshArray.Length >= mMeshArrayIndex)
            {
                mMeshFilter.sharedMesh = meshArray[mMeshArrayIndex];
            }
            else
            {
                Debug.Assert(false, "Invalid mesh array index for crop: " + this.name);
            }
            break;

        case eTemporalTriggerOutcome.Crop_Harvestable:
            break;

        case eTemporalTriggerOutcome.Crop_Spoiled:
            break;

        case eTemporalTriggerOutcome.Crop_Dead:
            GameObject.Destroy(this.gameObject);
            break;

        default:
            break;
        }
    }
    protected override void ApplyTemporalOutcome(eTemporalTriggerOutcome outcome)
    {
        switch (outcome)
        {
        case eTemporalTriggerOutcome.Food_Ripe:
        case eTemporalTriggerOutcome.Food_Spoiled:
        case eTemporalTriggerOutcome.Food_Rotten:
            mMeshArrayIndex++;
            if (mMeshFilter != null && meshArray.Length >= mMeshArrayIndex)
            {
                mMeshFilter.sharedMesh = meshArray[mMeshArrayIndex];
            }
            else
            {
                Debug.Assert(false, "Invalid mesh array index for crop: " + this.name);
            }
            // TODO(jamesp): Do stuff for the resoucess when these happen
            break;

        default:
            break;
        }
    }
 /// <summary>
 /// Abstract method to be implemented by each temporal object subclass.
 /// The intention here is that the subclass handles what it does when certain outcomes are triggered.
 /// </summary>
 /// <param name="outcome">A temporal outcome. This could be a crop being harvestable, dying, a sign changing, a tool rusting, etc.</param>
 protected abstract void ApplyTemporalOutcome(eTemporalTriggerOutcome outcome);
Exemple #4
0
 protected override void ApplyTemporalOutcome(eTemporalTriggerOutcome outcome)
 {
     // Do nothing.
 }