Exemple #1
0
    public LambdaFuncInt[] GetOnClickEvents()
    {
        //pBuildingId, pName,pDisplayStringActivated, pDisplayStringInactivated, pPrice
        LambdaFuncInt type1 = (int id) =>
        {
            //Debug.Log("LambdaFuncInt id : " + id);
            Facility fac = DataController_han.GetInstance().GetFacilities()[(id - 1)];
            if (fac.CheckIsActivated())
            {
                DataController_han.GetInstance().FacilityProduce(id);
                //Debug.Log(fac.GetName()+" do something!");
                //GameManager_han.GetInstance().Refresh();
            }
            else
            {
                //Debug.Log("LambdaFuncInt ActivateFacility id : " + id);
                DataController_han.GetInstance().ActivateFacility(id);
                //Debug.Log(fac.GetName() + " Is Activated!!");
                //GameManager_han.GetInstance().Refresh();
            }
        };
        LambdaFuncInt type2 = (int id) =>
        {
            DataController_han.GetInstance().ActivateFacility(id);
            //GameManager_han.GetInstance().Refresh();
        };

        return(new LambdaFuncInt[]
        {//id, Name, Required
            type1,
            type1,
            type1,
            type1,
            type1,
            type1,
            type1,
            type1,
            type1,
            type1,
            type1,
        });
    }
Exemple #2
0
 public Facility(int pBuildingId,
                 string pName,
                 string pDisplayStringActivated,
                 string pDisplayStringInactivated,
                 Resources pPrice,
                 Resources pProduct,
                 Resources pCost,
                 Army pMaterial,
                 Army pRollouted,
                 LambdaFuncInt onClickEvent) : base(pBuildingId,
                                                    pName,
                                                    pDisplayStringActivated,
                                                    pDisplayStringInactivated,
                                                    pPrice,
                                                    pProduct,
                                                    pCost,
                                                    pMaterial,
                                                    pRollouted)
 {
     this.onClickEvent = onClickEvent;
 }