Beispiel #1
0
    public void Bubbles()
    {
        if (sponge.gameObject.activeSelf)
        {
            return;
        }
        //starsBubbles = 0;
        //starsRotatingBrush = 0;
        //GameObject.Find ("btnBubbles").GetComponent<ButtonSelectTool>().ResetAllStars();

        SoundManager.Instance.Play_ButtonClick();
        DisableAllTools();
        sponge.transform.position = Vector3.zero;
        sponge.gameObject.SetActive(true);
        if (spongeScript == null)
        {
            spongeScript = sponge.GetComponent <Sponge>();
        }
        foreach (Transform ch in bubblesHolder)
        {
            if (ch.tag == "ANCHOR")
            {
                ch.GetComponent <Animator>().ResetTrigger("disable");
                ch.GetComponent <Animator>().SetTrigger("activate");
                ch.GetComponent <CircleCollider2D>().radius = 55;
            }
        }
        InvokeRepeating("TestBubbles", 0, 0.1f);
        //Tutorial.tutorialState = "bubbles";
        //Tutorial.bPause = false;
        //tutorial.HidePointer();
    }
Beispiel #2
0
    public override void OnEnable()
    {
        base.OnEnable();
        var o = new PropertyFetcher <Sponge>(serializedObject);

        sponge            = target as Sponge;
        Intensity         = Unpack(o.Find(x => x.intensity));
        opacityParameters = new List <SerializedDataParameter>()
        {
            Unpack(o.Find(x => x.opacity)),
            Unpack(o.Find(x => x.evaporateSpeed)),
            Unpack(o.Find(x => x.diffuseSpeed)),
            Unpack(o.Find(x => x.agentStrength)),
        };

        motionParamters = new List <SerializedDataParameter>()
        {
            Unpack(o.Find(x => x.moveSpeed)),
            Unpack(o.Find(x => x.turnSpeed)),
            Unpack(o.Find(x => x.randomStrength)),
            Unpack(o.Find(x => x.force)),
            Unpack(o.Find(x => x.repell)),
        };


        sensorParameters = new List <SerializedDataParameter>()
        {
            Unpack(o.Find(x => x.sensorOffsetDst)),
            Unpack(o.Find(x => x.sensorAngleSpacing)),
            Unpack(o.Find(x => x.sensorSize)),
        };
        var opacity = Unpack(o.Find(x => x.opacity));
    }
Beispiel #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Called when views is activated.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void ViewActivated(bool firstTime)
        {
            base.ViewActivated(firstTime);

            if (_refreshNeeded || firstTime)
            {
                RefreshSessionList();
                _refreshNeeded = false;
            }

            if (firstTime)
            {
                if (Settings.Default.SessionVwSplitterPos > 0)
                {
                    splitOuter.SplitterDistance = Settings.Default.SessionVwSplitterPos;
                }

                Sponge.SetGridColumnWidthsFromString(gridFiles, Settings.Default.SessionFileCols);

                // Setting up drap/drop crashes when there is no hosting form,
                // so make sure we're being hosted before doing so.
                if (FindForm() != null)
                {
                    splitFileTab.AllowDrop = true;
                    splitFileTab.DragOver += FileListDragOver;
                    splitFileTab.DragDrop += FileListDragDrop;
                }
            }
        }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void LetUserChooseSessionFiles()
        {
            var caption = LocalizationManager.LocalizeString(
                "NewSessionDlg.OpenFileDlgCaption", "Copy Files into Session", "Dialog Boxes");

            AddFilesToSession(Sponge.GetFilesOfAnyType(caption));
        }
Beispiel #5
0
 public static Hash Calculate(int[] tritsToCalculate, int offset, int length, Sponge curl)
 {
     int[] hashTrits = new int[SizeInTrits];
     curl.Reset();
     curl.Absorb(tritsToCalculate, offset, length);
     curl.Squeeze(hashTrits, 0, SizeInTrits);
     return(new Hash(hashTrits));
 }
 //------------------------------------------------------------------------
 //                          makeItemsAndInventory
 //------------------------------------------------------------------------
 private void makeItemsAndInventory(Level level)
 {
     inv         = new Inventory();
     sponge      = new Sponge(this);
     spongeTimer = 791;
     makeFoodCan();
     makeShopInScene(level);
 }
Beispiel #7
0
        public void TestSpongeBitRateIsCorrectlySetWithDefaultPermutation(int bitRate)
        {
            var sponge = new Sponge(bitRate);

            Assert.That(sponge.BitRate, Is.EqualTo(bitRate));

            sponge = new Sponge(bitRate, mockPermutation);
            Assert.That(sponge.BitRate, Is.EqualTo(bitRate));
        }
Beispiel #8
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public NewSessionsFromFilesDlg(NewSessionsFromFileDlgViewModel viewModel)
        {
            InitializeComponent();

            _instructionsLabel.Text = string.Format(_instructionsLabel.Text, Application.ProductName);
            _progressPanel.Visible  = false;

            _noFilesSelectedCreateButtonText = LocalizationManager.LocalizeString(
                "NewSessionsFromFilesDlg.NoFilesSelectedCreateButtonText",
                "Create Sessions", "Text in create button when no files are selected.",
                "Dialog Boxes", LocalizationCategory.Button, LocalizationPriority.High);

            _filesSelectedCreateButtonText = LocalizationManager.LocalizeString(
                "NewSessionsFromFilesDlg.FilesSelectedCreateButtonText",
                "Create {0} Sessions", "Format text in create button when one or more files are selected.",
                "Dialog Boxes", LocalizationCategory.Button, LocalizationPriority.High);

            var rc = Settings.Default.NewSessionsFromFilesDlgBounds;

            if (rc.Height < 0)
            {
                StartPosition = FormStartPosition.CenterScreen;
            }
            else
            {
                Bounds = rc;
            }

            Sponge.SetGridColumnWidthsFromString(_filesGrid,
                                                 Settings.Default.NewSessionsFromFilesDlgCols);

            _folderMissingMsgCtrl = new NewSessionsFromFilesDlgFolderNotFoundMsg();
            _filesPanel.Controls.Add(_folderMissingMsgCtrl);
            _folderMissingMsgCtrl.BringToFront();

            _mediaPlayerPanel.BorderStyle = BorderStyle.None;

#if !MONO
            _winMediaPlayer = new AxWindowsMediaPlayer();
            ((ISupportInitialize)(_winMediaPlayer)).BeginInit();
            _winMediaPlayer.Dock = DockStyle.Fill;
            _winMediaPlayer.Name = "_winMediaPlayer";
            _mediaPlayerPanel.Controls.Add(_winMediaPlayer);
            ((ISupportInitialize)(_winMediaPlayer)).EndInit();
            _winMediaPlayer.settings.autoStart = false;
#endif

            DialogResult = DialogResult.Cancel;
            new CheckBoxColumnHeaderHandler(_selectedCol);
            _viewModel = viewModel;
        }
Beispiel #9
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.HandleDestroyed"/> event.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected override void OnHandleDestroyed(EventArgs e)
        {
            _currProj.ProjectChanged -= HandleProjectFoldersChanged;

            Settings.Default.SessionFileCols =
                Sponge.StoreGridColumnWidthsInString(gridFiles);

            Settings.Default.SessionVwSplitterPos = splitOuter.SplitterDistance;
            Settings.Default.Save();

            SaveChangesToSession(_currSession);

            base.OnHandleDestroyed(e);
        }
Beispiel #10
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Save misc. info. about the state of the dialog (e.g. widths of columns in the
        /// files grid, size and location of the dialog box).
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            if (DialogResult == DialogResult.Cancel && _progressPanel.Visible)
            {
                _viewModel.CancelLoad();
            }

            base.OnFormClosing(e);

            Settings.Default.NewSessionsFromFilesDlgCols =
                Sponge.StoreGridColumnWidthsInString(_filesGrid);

            Settings.Default.NewSessionsFromFilesDlgBounds = Bounds;
            Settings.Default.Save();
        }
Beispiel #11
0
 public override void _Ready()
 {
     gameManager          = GetTree().Root.GetNode <GameManager>("Node2D/GameManager");
     hasLeftBeenScrubbed  = false;
     hasRightBeenScrubbed = false;
     totalStainsScrubbed  = 0;
     sponge      = GetNode <Sponge>("Panel/Sprite/Sponge");
     scrub1      = GetNode <Sprite>("Panel/Sprite/Scrub1");
     scrub2      = GetNode <Sprite>("Panel/Sprite/Scrub2");
     scrub3      = GetNode <Sprite>("Panel/Sprite/Scrub3");
     scrub4      = GetNode <Sprite>("Panel/Sprite/Scrub4");
     stains      = new[] { scrub4, scrub3, scrub2, scrub1 };
     totalStains = stains.Length;
     scrubLeft   = GetNode <AudioStreamPlayer>("Panel/ScrubLeft");
     scrubRight  = GetNode <AudioStreamPlayer>("Panel/ScrubRight");
 }
Beispiel #12
0
 void OnTriggerStay2D(Collider2D other)
 {
     if (other.gameObject.tag == "Follower")
     {
         if (countNum > countSpeed)
         {
             Sponge sponge = other.gameObject.GetComponent <Sponge>();
             if (sponge.owner == owner && sponge.amountFilled + refillSpeed < Settings.partFillCapacity)
             {
                 sponge.amountFilled += refillSpeed;
                 playSound();
             }
             countNum = 0;
         }
         countNum++;
     }
 }
Beispiel #13
0
 public void SetUp()
 {
     sponge = new Sponge();
 }
Beispiel #14
0
        public void TestCanCreateSpongeWithSpecifiedBitRateAndPermutation(int bitRate)
        {
            var sponge = new Sponge(bitRate, mockPermutation);

            Assert.Pass();
        }
Beispiel #15
0
        public void TestCanCreateSpongeWithDefaultBitRateAndSpecificPermutation()
        {
            var sponge = new Sponge(mockPermutation);

            Assert.Pass();
        }
Beispiel #16
0
        public void TestCanCreateSpongeWithSpecificBitRateAndDefaultPermutation(int bitRate)
        {
            var sponge = new Sponge(bitRate);

            Assert.Pass();
        }
Beispiel #17
0
        public void TestCanCreateSpongeWithDefaultPermutationAndBitRate()
        {
            var sponge = new Sponge();

            Assert.Pass();
        }
 public void SetUp()
 {
     sponge = new Sponge();
 }
Beispiel #19
0
 public void TestCanCreateSpongeWithDefaultBitRateAndSpecificPermutation()
 {
     var sponge = new Sponge(mockPermutation);
     Assert.Pass();
 }
Beispiel #20
0
 public void TestCanCreateSpongeWithDefaultPermutationAndBitRate()
 {
     var sponge = new Sponge();
     Assert.Pass();
 }
Beispiel #21
0
 public void TestCanCreateSpongeWithSpecificBitRateAndDefaultPermutation(int bitRate)
 {
     var sponge = new Sponge(bitRate);
     Assert.Pass();
 }
Beispiel #22
0
        public void TestSpongeBitRateIsCorrectlySetWithDefaultPermutation(int bitRate)
        {
            var sponge = new Sponge(bitRate);
            Assert.That(sponge.BitRate, Is.EqualTo(bitRate));

            sponge = new Sponge(bitRate, mockPermutation);
            Assert.That(sponge.BitRate, Is.EqualTo(bitRate));
        }
Beispiel #23
0
 public void TestCanCreateSpongeWithSpecifiedBitRateAndPermutation(int bitRate)
 {
     var sponge = new Sponge(bitRate, mockPermutation);
     Assert.Pass();
 }