示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("前面有个小姐姐");
        GrilType    grilType = GrilType.AYi;
        BaseHandler handlerA = new HandleAYi();
        BaseHandler handlerB = new HandleLuoLi();
        BaseHandler handlerC = new HandleShaoNv();

        handlerA.SetNextHandler(handlerB).SetNextHandler(handlerC).SetNextHandler(handlerA);
        handlerC.Handle(grilType);
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("前边有一个很漂亮的小姐姐,我们去撩一下");
        GrilType    grilType = GrilType.ShaoNv;
        BaseHandler handlerA = new HandleAYi();
        BaseHandler handlerB = new HandleLuoLi();
        BaseHandler handlerC = new HandleShaoNv();

        //handlerA.NextHandler = handlerB;
        //handlerB.NextHandler = handlerC;

        handlerA.SetNextHandler(handlerB).SetNextHandler(handlerC).SetNextHandler(handlerA);

        handlerC.Handle(grilType);
    }