Inheritance: MonoBehaviour
コード例 #1
0
ファイル: Main.cs プロジェクト: hematogen50g/Druncard
    /// <summary>
    /// This is entry point of program.
    /// </summary>

    void Start()
    {
        taker         = players[0];
        turnSequencer = FindObjectOfType <TurnSequencer>();
        turnSequencer.Init(this);

        dealingSoundSource      = GetComponent <AudioSource>();
        dealingSoundSource.clip = dealCardsProgress;
        tableImage = table.GetComponent <Image>();

        mainSource.clip = buttonClick;

        // add event listener to each button to play sound.
        Button[] btns = FindObjectsOfType <Button>();
        foreach (var btn in btns)
        {
            if (btn.gameObject.name != "UserAction")
            {
                btn.onClick.AddListener(PlayButtonSound);
            }
        }

        options = FindObjectOfType <Options>();
        options.Init(this);
        deck = FindObjectOfType <Deck>();
        deck.Init(this);
        ads = new ADS();


        ads.ShowBannerWhenReady();
    }
コード例 #2
0
        private void MainDesktop_Load(object sender, EventArgs e)
        {
            this.endStateNotifier = new FxnBlock();
            this.endStateNotifier.InputParameter = null;
            this.endStateNotifier.Function       = this.handleEndFlow;
            this.mainMenuPanel.setExitButtonHandler(this.exitButton_Click);

            ADS.Setup(this);

            ADS.ResourceProperties.DP    = Properties.Resources.DP;
            ADS.ResourceProperties.HB    = Properties.Resources.HB;
            ADS.ResourceProperties.HP    = Properties.Resources.HP;
            ADS.ResourceProperties.Pearl = Properties.Resources.Pearl;

            ADS.ResourceProperties.oldvistabutton_blue = Properties.Resources.oldvistabutton_blue;
            ADS.ResourceProperties.vistabutton_blue    = Properties.Resources.vistabutton_blue;
            ADS.ResourceProperties.cl1 = Properties.Resources.cl1;
            ADS.ResourceProperties.cl2 = Properties.Resources.cl2;
            ADS.ResourceProperties.cl3 = Properties.Resources.cl3;
            ADS.ResourceProperties.cl4 = Properties.Resources.cl4;
            ADS.ResourceProperties.cl5 = Properties.Resources.cl5;
            ADS.ResourceProperties.newDialog_400_BlueScale = Properties.Resources.newDialog_400_BlueScale;
            ADS.ResourceProperties.newDialog_512_BlueScale = Properties.Resources.newDialog_512_BlueScale;
            ADS.ResourceProperties.newDialog_600_BlueScale = Properties.Resources.newDialog_600_BlueScale;

            ADS.ResourceProperties.OverrideMachineName = Properties.Resources.OverrideMachineName;
        }
コード例 #3
0
        private void resetMenu()
        {
            if (this.resetFlag)
            {
                return;
            }
            this.resetFlag = true;
            //Will allow user to reset the menu back to the parent
            if (this.mainMenuPanel.Enabled == false)
            {
                //Remove the connected cd user entry
                //string errorCode;
                //string errorMesg;
                //ShopCashProcedures.DeleteConnectedCdUser(CashlinxDesktopSession.Instance.CashDrawerId,
                //    PawnSecurityAccessor.Instance.EncryptConfig.ClientConfig.ClientConfiguration.WorkstationId,
                //    CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber, CashlinxDesktopSession.Instance,
                //    out errorCode,
                //    out errorMesg);
                //CashlinxDesktopSession.Instance.LoggedInUserSecurityProfile = new UserVO();
                ADS.ClearLoggedInUser();

                ADS.ClearSessionData();

                this.mainMenuPanel.Enabled = true;
                this.mainMenuPanel.Visible = true;
                this.mainMenuPanel.ButtonControllers.resetGroupInitialState();
                this.mainMenuPanel.BringToFront();
                this.mainMenuPanel.Update();
                this.mainMenuPanel.setExitButtonHandler(this.exitButton_Click);
            }
            this.resetFlag = false;
        }
コード例 #4
0
    public void ShowAdAtTheEnd()
    {
        int totalGames = PlayerPrefs.GetInt("TotalGames", 0);

        totalGames++;
        PlayerPrefs.SetInt("TotalGames", totalGames);
        if (totalGames % 2 == 0)
        {
            ADS.ShowAd();
        }
    }
コード例 #5
0
ファイル: GameManager.cs プロジェクト: DavidM17/Unity_Game
    public void ConfirmGameOver()
    {
        co++;
        if (co >= 3)
        {
            ADS.showAd();
            co = 0;
        }

        OnGameOverConfirmed();
        scoreText.text = "0";
        SetPageState(PageState.Start);
    }
コード例 #6
0
        private void bwPostAudit_DoWork(object sender, DoWorkEventArgs e)
        {
            CommonDatabaseContext dataContext = CreateCommonDatabaseContext();

            ADS.beginTransactionBlock();
            InventoryAuditProcedures.PostAudit(ADS.ActiveAudit, dataContext);

            if (!dataContext.Result)
            {
                ADS.endTransactionBlock(EndTransactionType.ROLLBACK);
            }
            else
            {
                ADS.endTransactionBlock(EndTransactionType.COMMIT);
            }

            e.Result = dataContext;
        }
コード例 #7
0
        public void playRandomADS()
        {
            pbScreen.Image = new Bitmap(640, 480);
            pbScreen.Refresh();
            System.Threading.Thread.Sleep(1000);
            int    total     = scenes.Count;
            int    sceneidx  = random.Next(total);
            string adsname   = scenes[sceneidx].Key;
            int    scriptidx = random.Next(scenes[sceneidx].Value.Count);

            Log.write("Playing " + adsname + " sequence " + scriptidx);
            UInt16    scriptno = scenes[sceneidx].Value[scriptidx];
            ADS       ads      = (ADS)ResourceManager.get(adsname);
            ADSPlayer player   = new ADSPlayer(ads);

            player.UpdateEvent   += updateImage;
            player.CompleteEvent += complete;
            Debug.WriteLine("ADS: " + adsname + ", no: " + scriptno);
            player.runADS(scriptno);
        }
コード例 #8
0
        public ActionResult NewAdd(string txtCompanyName, string txtLink, HttpPostedFileBase foto)
        {
            if (foto != null)
            {
                if (txtCompanyName != "" && txtLink != "")
                {
                    WebImage img      = new WebImage(foto.InputStream);
                    FileInfo fotoInfo = new FileInfo(foto.FileName);

                    newFoto = Guid.NewGuid().ToString() + fotoInfo.Extension;
                    img.Resize(1080, 720);
                    img.Save("~/Image/" + newFoto);

                    ADS newAd = new ADS()
                    {
                        AdCompany = txtCompanyName,
                        AdLink    = txtLink,
                        AdImage   = "/Image/" + newFoto
                    };
                    Model.ADS.Add(newAd);
                    Model.SaveChanges();

                    return(RedirectToAction("Ads", "Account"));
                }
                else
                {
                    ViewBag.Error = "Empty field detected!";
                }
            }
            else
            {
                ViewBag.Error = "Empty field detected!";
            }

            return(View());
        }
コード例 #9
0
        private bool triggerNextEvent(MenuLevelController menuCtrl)
        {
            bool rt = false;

            if (menuCtrl != null)
            {
                Button triggerBtn = menuCtrl.TriggerButton;
                if (triggerBtn != null)
                {
                    if (triggerBtn != menuCtrl.BackButton)
                    {
                        string targetPanelName = menuCtrl[triggerBtn];


                        if (!string.IsNullOrEmpty(targetPanelName) &&
                            !targetPanelName.Equals("null"))
                        {
                            UserVO currUser = ADS.LoggedInUserSecurityProfile;
                            if (currUser == null || (string.IsNullOrEmpty(currUser.UserName)))
                            {
                                ADS.ClearLoggedInUser();
                                ADS.PerformAuthorization();
                            }
                            if (!string.IsNullOrEmpty(ADS.LoggedInUserSecurityProfile.UserName))
                            {
                                rt = this.initializeProperMenu(targetPanelName);
                            }
                            else
                            {
                                this.resetMenu();
                                return(true);
                            }
                        }
                        else
                        {
                            UserVO currUser = ADS.LoggedInUserSecurityProfile;
                            if (currUser == null || (string.IsNullOrEmpty(currUser.UserName)))
                            {
                                ADS.ClearLoggedInUser();
                                ADS.PerformAuthorization();
                            }
                            if (!string.IsNullOrEmpty(ADS.LoggedInUserSecurityProfile.UserName))
                            {
                                rt = this.InitializeFunctionality(
                                    StringUtilities.removeFromString(triggerBtn.Name.ToLowerInvariant(), "button"));
                            }
                            else
                            {
                                this.resetMenu();
                                return(true);
                            }
                        }
                    }
                    else
                    {
                        //We have the back button - reset the menu
                        this.resetMenu();
                        return(true);
                    }
                }
            }
            return(rt);
        }
コード例 #10
0
 private void OnMouseUp()
 {
     ADS.ShowUnityAds();
     transform.localScale = new Vector3(1, 1, 1);
     StartCoroutine(Open());
 }
コード例 #11
0
        private void DownloadFiles()
        {
            ProcessingMessage = new ProcessingMessage("Retrieving upload files", 0);
            ProcessingMessage.Show();
            try
            {
                string tmpPath       = Path.Combine(Application.StartupPath, "tmp");
                string trakkerPath   = Path.Combine(tmpPath, "uptrak");
                string trakkerIdPath = Path.Combine(tmpPath, "trakker.id");

                if (!Directory.Exists(tmpPath))
                {
                    Directory.CreateDirectory(tmpPath);
                }

                FtpHelper ftpHelper = new FtpHelper(FtpHost, FtpUser, FtpPassword);
                ftpHelper.DownloadFile("tmp_" + ADS.ActiveAudit.StoreNumber + "/uptrak", trakkerPath, false);
                ftpHelper.DownloadFile("tmp_" + ADS.ActiveAudit.StoreNumber + "/trakker.id", trakkerIdPath, false);

                string[] fileContents = File.ReadAllLines(trakkerIdPath);

                if (fileContents.Length == 0 || string.IsNullOrWhiteSpace(fileContents[0]))
                {
                    ProcessingMessage.Close();
                    throw new ApplicationException("trakker.id file is empty");
                }

                int trakkerId = Utilities.GetIntegerValue(fileContents[0].Substring(fileContents[0].IndexOf('|') + 1), 0);

                ProcessingMessage.Hide();
                ConfirmTrakker confirmTrakker = new ConfirmTrakker(trakkerId);
                if (confirmTrakker.ShowDialog() == DialogResult.Cancel)
                {
                    ProcessingMessage.Close();
                    return;
                }
                ProcessingMessage.Show();

                TrakkerFileReader  trakkerFileReader = new TrakkerFileReader(trakkerPath);
                List <TrakkerItem> uploadedItems     = trakkerFileReader.ReadFile();

                int count = 0;
                if (uploadedItems.Count > 0)
                {
                    ADS.beginTransactionBlock();
                    foreach (TrakkerItem item in uploadedItems)
                    {
                        count++;
                        ProcessingMessage.Message = string.Format("Uploading record {0} of {1}", count, uploadedItems.Count);
                        CommonDatabaseContext dataContext = new CommonDatabaseContext();

                        InventoryAuditProcedures.UploadTrakkerItem(item, ADS.ActiveAudit.AuditId, trakkerId, ADS.ActiveAudit.StoreNumber, dataContext);

                        if (!dataContext.Result)
                        {
                            ADS.endTransactionBlock(EndTransactionType.ROLLBACK);
                            MessageBox.Show(dataContext.ErrorText);
                            return;
                        }
                    }
                    ADS.endTransactionBlock(EndTransactionType.COMMIT);
                }

                ProcessingMessage.Close();
                ChangeStatusMessage2("Records Uploaded from Trakker " + trakkerId);
                ChangeStatusValue2(uploadedItems.Count.ToString());
                Uploaded = true;
            }
            catch (Exception exc)
            {
                ProcessingMessage.Close();
                BasicExceptionHandler.Instance.AddException("Failed to upload trakker files", exc);
                MessageBox.Show(exc.Message);
            }
        }
コード例 #12
0
    private void Start()
    {
        animationDeathIsFinished = true;
        exitFromPingPong         = false;
        inPingPong       = false;
        isStart          = false;
        isDead           = false;
        isFinishGame     = false;
        isTeleport       = false;
        isHit            = false;
        playerName       = "";
        countAlivePlayer = 3;
        isJump           = false;
        backgroundSpeed  = 3;
        inBodyColider    = false;
        float deltaSpeed = 1f / ((Screen.width / (float)Screen.height) / (1280f / 720f));

        speed = 5.2f / deltaSpeed;


        float a = (float)Screen.width / (float)Screen.height;
        float k = a / relation;
        float y = 1000 / k;

        parentPanel.transform.localScale = new Vector3(1000, y, 0);
        circle        = new GameObject[3];
        circle[0]     = GameObject.Find("Interface/Brian");
        circle[1]     = GameObject.Find("Interface/Eva");
        circle[2]     = GameObject.Find("Interface/Zak");
        disableScreen = GameObject.Find("DisableScreen/Block");
        setDefault    = new SetDefaultValue(SetDefaultValueMessageSystem);
        fail          = new FailPanel(OpenFailPanel);
        pong          = new PingPong(StartPingPong);
        speedy        = new Rizen(RizeSpeed);
        Brian         = hero[0];
        Eva           = hero[1];
        Zak           = hero[2];
        BrianIDLE     = hero[3];
        EvaIDLE       = hero[4];
        ZakIDLE       = hero[5];
        constraints   = Brian.GetComponent <Rigidbody2D>().constraints;
        if (!hash.ContainsKey(Brian.name))
        {
            hash.Add(Brian.name, 0);
        }
        if (!hash.ContainsKey(Eva.name))
        {
            hash.Add(Eva.name, 1);
        }
        if (!hash.ContainsKey(Zak.name))
        {
            hash.Add(Zak.name, 2);
        }

        int size = 5;

        storageVoid.InstMemory("void", size, 3);
        storageVoid[0, 0] = (p) => player = BrianIDLE;
        storageVoid[0, 1] = (p) => player = EvaIDLE;
        storageVoid[0, 2] = (p) => player = ZakIDLE;
        storageVoid[1, 0] = (p) => player = Brian;
        storageVoid[1, 1] = (p) => player = Eva;
        storageVoid[1, 2] = (p) => player = Zak;
        storageVoid[2, 0] = (p) =>
        {
            circle[0].GetComponent <BoxCollider2D>().enabled = false;
            activeCircleCollider[0] = false;
        };
        storageVoid[2, 1] = (p) =>
        {
            circle[1].GetComponent <BoxCollider2D>().enabled = false;
            activeCircleCollider[1] = false;
        };
        storageVoid[2, 2] = (p) =>
        {
            circle[2].GetComponent <BoxCollider2D>().enabled = false;
            activeCircleCollider[2] = false;
        };
        storageVoid[3, 0] = (obj) =>
        {
            GameObject buf = (GameObject)obj;
            buf.GetComponent <Animation>().Play("BufBrian");
        };
        storageVoid[3, 1] = (obj) =>
        {
            GameObject buf = (GameObject)obj;
            buf.GetComponent <Animation>().Play("BufEva");
        };
        storageVoid[3, 2] = (obj) =>
        {
            GameObject buf = (GameObject)obj;
            buf.GetComponent <Animation>().Play("BufZak");
        };
        storageVoid[4, 0] = (p) =>
        {
            TapToHero.InstantiateSpeed("Brian");
            SelectHero(Brian);
        };
        storageVoid[4, 1] = (p) =>
        {
            TapToHero.InstantiateSpeed("Eva");
            SelectHero(Eva);
        };
        storageVoid[4, 2] = (p) =>
        {
            TapToHero.InstantiateSpeed("Zak");
            SelectHero(Zak);
        };
        staticClips = new AudioClip[clips.Length];
        for (int i = 0; i < clips.Length; i++)
        {
            staticClips[i] = clips[i];
        }


        SetDefaultValueMessageSystem();

        audioSource = GetComponent <AudioSource>();
        for (int i = 0; i < clips.Length; i++)
        {
            listAudio.Add(clips[i]);
        }
        playMusic = new PlayMusic(StartPlaySound);
        ADS.ShowAdMobBanner();
        staticDefaultClip = defaultClip;

        SetupVolume();
    }
コード例 #13
0
 void Start()
 {
     FirePosition = transform.GetChild(1).transform;
     A            = GetComponent <ADS>();
 }