コード例 #1
0
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerInfo>();
        stone  = this.GetComponent <StoneInfo>();

        grid = GameObject.Find("Game Grid").GetComponent <GridManager4>();
    }
コード例 #2
0
    // Use this for initialization
    void Awake()
    {
        pmoney1 = GameObject.Find("money1p").GetComponent <Text> ();
        pmoney2 = GameObject.Find("money2p").GetComponent <Text> ();
        pmoney3 = GameObject.Find("money3p").GetComponent <Text> ();
        pmoney4 = GameObject.Find("money4p").GetComponent <Text> ();

        mainC = GameObject.Find("Main Camera").GetComponent <Camera> ();
        AuctionInfoItemText.enabled = false;
        gameState = "";
        print     = true;
        pv        = GetComponent <PhotonView> ();
        timeCount = 20.0f;
        AuctionTime.have_stone = 1;
        AuctionTime.roundCount = 1;
        AuctionTime.propelTime = 100;
        AuctionCanvas          = GameObject.Find("AuctionCanvas").GetComponent <Canvas>();
        PhotonNetwork.isMessageQueueRunning = true;
        stoneinfo = new StoneInfo[] {
            new StoneInfo(true, 3, 5, 33, "StoneImage/default", "StoneMaterial/default", true, "시멘트"),
            new StoneInfo(true, 4, 6, 34, "StoneImage/blue", "StoneMaterial/blue", false, "구름돌"),
            new StoneInfo(true, 5, 6, 34, "StoneImage/chocolate", "StoneMaterial/chocolate", false, "초코릿"),
            new StoneInfo(true, 5, 6, 34, "StoneImage/coffe", "StoneMaterial/coffe", false, "커피"),
            new StoneInfo(true, 6, 7, 35, "StoneImage/green", "StoneMaterial/green", false, "옥석"),

            new StoneInfo(true, 7, 11, 35, "StoneImage/marron", "StoneMaterial/marron", false, "마로니에"),
            new StoneInfo(true, 8, 12, 35, "StoneImage/rio", "StoneMaterial/rio", false, "리오"),
            new StoneInfo(true, 8, 12, 36, "StoneImage/white", "StoneMaterial/white", false, "자갈"),
            new StoneInfo(true, 9, 13, 41, "StoneImage/floortile", "StoneMaterial/floortile", false, "논밭"),
            new StoneInfo(true, 10, 14, 36, "StoneImage/glass", "StoneMaterial/glass", false, "스텐글래스"),

            new StoneInfo(true, 11, 15, 45, "StoneImage/grass", "StoneMaterial/grass", false, "잔디"),
            new StoneInfo(true, 12, 16, 37, "StoneImage/mudrocky", "StoneMaterial/mudrocky", false, "진흙"),
            new StoneInfo(true, 13, 20, 38, "StoneImage/pavement_1", "StoneMaterial/pavement_1", false, "벽돌"),
            new StoneInfo(true, 13, 17, 38, "StoneImage/pavement_2", "StoneMaterial/pavement_2", false, "블럭"),
            new StoneInfo(true, 15, 18, 38, "StoneImage/splash_2", "StoneMaterial/splash_1", false, "도트"),

            new StoneInfo(true, 16, 21, 38, "StoneImage/splash_2", "StoneMaterial/splash_2", false, "안개"),
            new StoneInfo(true, 17, 24, 38, "StoneImage/DarkBlueOpacityMaterial", "StoneMaterial/DarkBlueOpacityMaterial", false, "사파이어"),
            new StoneInfo(true, 18, 26, 38, "StoneImage/DarkPurpleOpacityMaterial", "StoneMaterial/DarkPurpleOpacityMaterial", false, "자수정"),
            new StoneInfo(true, 18, 26, 38, "StoneImage/DarkRedOpacityMaterial", "StoneMaterial/DarkRedOpacityMaterial", false, "루비"),
            new StoneInfo(true, 20, 29, 43, "StoneImage/Flare50mm", "StoneMaterial/Flare50mm", false, "플레어"),

            new StoneInfo(true, 25, 30, 38, "StoneImage/LightGreenOpacityMaterial", "StoneMaterial/LightGreenOpacityMaterial", false, "에메랄드"),
            new StoneInfo(true, 26, 34, 38, "StoneImage/LightGrayOpacityMaterial", "StoneMaterial/LightGreyOpacityMaterial", false, "다이아몬드"),
            new StoneInfo(true, 28, 37, 50, "StoneImage/Orange", "StoneMaterial/Orange", false, "시트린"),
            new StoneInfo(true, 28, 37, 38, "StoneImage/SkyCarLightGlows", "StoneMaterial/SkyCarLightGlows", false, "불꽃"),
            new StoneInfo(true, 30, 40, 38, "StoneImage/YellowOpacityMaterial", "StoneMaterial/YellowOpacityMaterial", false, "호박")
        };
        playerStone [0]             = new StoneInfo(true, 3, 5, 33, "StoneImage/default", "StoneMaterial/default", true, "시멘트");
        playerStone [1].imageString = "StoneImage/invenDefault";
        playerStone [2].imageString = "StoneImage/invenDefault";
        playerStone [3].imageString = "StoneImage/invenDefault";
        playerStone [4].imageString = "StoneImage/invenDefault";
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     gameState     = "";
     print         = true;
     pv            = GetComponent <PhotonView> ();
     timeCount     = 10.0f;
     AuctionCanvas = GameObject.Find("AuctionCanvas").GetComponent <Canvas>();
     PhotonNetwork.isMessageQueueRunning = true;
     stoneinfo = new StoneInfo[] {
         new StoneInfo(true, 3, 10, 34, "StoneImage/BaseStone", "StoneMaterial/Base"),
         new StoneInfo(true, 4, 10, 34, "StoneImage/BaseStone2", "StoneMaterial/Base"),
         new StoneInfo(true, 5, 10, 34, "StoneImage/RedStone", "StoneMaterial/Red"),
         new StoneInfo(true, 6, 10, 34, "StoneImage/CheckStone", "StoneMaterial/Check"),
         new StoneInfo(true, 7, 10, 34, "StoneImage/PurpleStone", "StoneMaterial/Purple"),
         new StoneInfo(true, 11, 10, 34, "StoneImage/SkyStone", "StoneMaterial/Sky")
     };
     playerStone [0] = new StoneInfo(true, 3, 10, 34, "StoneImage/BaseStone", "StoneMaterial/Base");
 }
コード例 #4
0
        public static bool ExecuteGetMetalStones(
            string PMetal_File_Name,
            string Stones_File_Name,
            out List <PMetalInfo> PMETAL_INFO,
            out List <StoneInfo> STONES_INFO,
            out string errorCode,
            out string errorText)
        {
            //Set default output values
            errorCode   = string.Empty;
            errorText   = string.Empty;
            PMETAL_INFO = new List <PMetalInfo>();
            STONES_INFO = new List <StoneInfo>();
            DataSet outputDataSet = null;

            //Verify that the accessor is valid
            if (GlobalDataAccessor.Instance == null ||
                GlobalDataAccessor.Instance.OracleDA == null)
            {
                errorCode = "GetMetalStonesFailed";
                errorText = "Invalid desktop session or data accessor instance";
                BasicExceptionHandler.Instance.AddException("GetMetalStonesFailed", new ApplicationException("Cannot execute the GetMetalStones retrieval stored procedure"));
                return(false);
            }

            //Get data accessor object
            OracleDataAccessor dA = GlobalDataAccessor.Instance.OracleDA;

            //Create input list
            List <OracleProcParam> inParams = new List <OracleProcParam>();

            //Add cat pointer
            inParams.Add(new OracleProcParam("pmetalfile", PMetal_File_Name));
            inParams.Add(new OracleProcParam("stonefile", Stones_File_Name));

            //Setup ref cursor array
            List <PairType <string, string> > refCursors = new List <PairType <string, string> >();

            //Add general ref cursors
            refCursors.Add(new PairType <string, string>("c_pmlist", PMETAL));
            refCursors.Add(new PairType <string, string>("c_slist", STONES));

            //Create output data set names
            bool retVal = false;

            try
            {
                retVal = dA.issueSqlStoredProcCommand(
                    "PROKNOW", "proknow_procs", "get_metal_stone_values",
                    inParams, refCursors, "o_error_code", "o_error_desc",
                    out outputDataSet);
            }
            catch (OracleException oEx)
            {
                errorCode = "GetMetalStonesFailed";
                errorText = "Invocation of Get_Metal_Stone_Values stored proc failed";
                BasicExceptionHandler.Instance.AddException("OracleException thrown when invoking Get_Metal_Stone_Values stored proc", oEx);
                outputDataSet = null;
                return(false);
            }

            //See if retVal is false
            if (retVal == false)
            {
                errorCode = dA.ErrorCode;
                errorText = dA.ErrorDescription;
                return(false);
            }

            if (outputDataSet != null)
            {
                if (outputDataSet.Tables != null && outputDataSet.Tables.Count > 0)
                {
                    //Get Metal information and add to List<Metal>
                    if (outputDataSet.Tables.Contains(PMETAL))
                    {
                        PMETAL_INFO = new List <PMetalInfo>();
                        foreach (DataRow dataRow in outputDataSet.Tables[PMETAL].Rows)
                        {
                            PMetalInfo metalInfo = new PMetalInfo();
                            metalInfo.Record_Type       = Utilities.GetStringValue(dataRow["RECORD_TYPE"], "");
                            metalInfo.Category          = Utilities.GetIntegerValue(dataRow["CAT_CODE"], 0);
                            metalInfo.Class             = Utilities.GetStringValue(dataRow["CLASS"], "");
                            metalInfo.Metal             = Utilities.GetStringValue(dataRow["METAL"], "");
                            metalInfo.Karats            = Utilities.GetIntegerValue(dataRow["KARATS"], 0);
                            metalInfo.Gram_Low          = Utilities.GetDecimalValue(dataRow["GRAM_LOW"], 0);
                            metalInfo.Gram_High         = Utilities.GetDecimalValue(dataRow["GRAM_HIGH"], 0);
                            metalInfo.Loan_Buy_Per_Gram = Utilities.GetDecimalValue(dataRow["LOAN_BUY_PER_GRAM"], 0);
                            metalInfo.Retail_Per_Gram   = Utilities.GetDecimalValue(dataRow["RETAIL_PER_GRAM"], 0);

                            PMETAL_INFO.Add(metalInfo);
                        }
                    }
                    // Get Stone information adn add to List<Stones>
                    if (outputDataSet.Tables.Contains(STONES))
                    {
                        STONES_INFO = new List <StoneInfo>();
                        foreach (DataRow dataRow in outputDataSet.Tables[STONES].Rows)
                        {
                            StoneInfo stoneInfo = new StoneInfo();
                            stoneInfo.Record_Type = Utilities.GetStringValue(dataRow["RECORDTYPE"], "");
                            stoneInfo.Min_Points  = Utilities.GetDecimalValue(dataRow["MIN_POINTS"], 0);
                            stoneInfo.Max_Points  = Utilities.GetDecimalValue(dataRow["MAX_POINTS"], 0);
                            stoneInfo.Clarity     = Utilities.GetIntegerValue(dataRow["CLARITY"], 0);
                            stoneInfo.Color       = Utilities.GetIntegerValue(dataRow["COLOR"], 0);
                            stoneInfo.Loan        = Utilities.GetDecimalValue(dataRow["LOAN"], 0);
                            stoneInfo.Purchase    = Utilities.GetDecimalValue(dataRow["PURCHASE"], 0);
                            stoneInfo.Retail      = Utilities.GetDecimalValue(dataRow["RETAIL"], 0);

                            STONES_INFO.Add(stoneInfo);
                        }
                    }

                    errorCode = "0";
                    errorText = string.Empty;
                    return(true);
                }
            }

            errorCode = "GetMetalStonesFailed";
            errorText = "Operation failed";
            return(false);
        }