Inheritance: MonoBehaviour
示例#1
0
    public Slot(Player player, float width, float height)
    {
        this.player = player;

        _width = width;
        _height = height;

        nameCell = new Cell();

        AddChild(handleBox = new HandleBox(this));
        AddChild(nameBox = new NameBox(this));
        AddChild(scoreBox = new ScoreBox(this));
        AddChild(minusBox = new MathBox(this, MathType.Minus));
        AddChild(plusBox = new MathBox(this, MathType.Plus));

        minusBox.SignalTick += HandleMinusTick;
        plusBox.SignalTick += HandlePlusTick;
        scoreBox.SignalRelease += HandleScoreTap;
        nameBox.SignalRelease += HandleNameTap;

        ListenForUpdate(HandleUpdate);
        DoLayout();

        _resetTweenable = new RXTweenable(0.0f, HandleResetTweenableChange);
        buildInTweenable = new RXTweenable(0.0f, HandleBuildInChange);

        HandleBuildInChange();
    }
        private void Refresh(int phase, MenuLayer layer)
        {
            switch (phase)
            {
            case 1:
                ScoreBox.SetText(GamestateManager.Instance.Points.ToString());
                break;

            case 2:
                Layers[MenuLayer.Scores].FindAll(actor => !ScoreActors.Contains(actor)).ForEach(actor => { actor.Dispose(); Layers[MenuLayer.Scores].Remove(actor); });

                int i = 0;

                ScoreManager.GetScores(10, ScoresOffset).ForEach(score =>
                {
                    Layers[MenuLayer.Scores].AddRange(new List <Actor>
                    {
                        new MenuTextBox(new Vector2f(100, 210 + i * 50), new Vector2f(300, 50), score.Item1, 20),
                        new MenuTextBox(new Vector2f(400, 210 + i++ *50), new Vector2f(300, 50), score.Item2, 20)
                    });
                });
                if (layer != MenuLayer.Scores)
                {
                    Layers[MenuLayer.Scores].ForEach(actor => actor.Visible = false);
                }
                break;

            case 3:
                QuitNoSaveButton.Visible = layer == MenuLayer.Main && GamestateManager.Instance.GamePhase != GamePhase.NotStarted && GamestateManager.Instance.GamePhase != GamePhase.Ending;
                ScoresPrev.Visible       = layer == MenuLayer.Scores && ScoresOffset > 0;
                ScoresNext.Visible       = layer == MenuLayer.Scores && ScoresOffset + 10 < ScoreManager.GetScoresCount();
                break;
            }
        }
示例#3
0
    public Slot(Player player, float width, float height)
    {
        this.player = player;

        _width  = width;
        _height = height;

        nameCell = new Cell();

        AddChild(handleBox = new HandleBox(this));
        AddChild(nameBox   = new NameBox(this));
        AddChild(scoreBox  = new ScoreBox(this));
        AddChild(minusBox  = new MathBox(this, MathType.Minus));
        AddChild(plusBox   = new MathBox(this, MathType.Plus));

        minusBox.SignalTick    += HandleMinusTick;
        plusBox.SignalTick     += HandlePlusTick;
        scoreBox.SignalRelease += HandleScoreTap;
        nameBox.SignalRelease  += HandleNameTap;

        ListenForUpdate(HandleUpdate);
        DoLayout();

        _resetTweenable  = new RXTweenable(0.0f, HandleResetTweenableChange);
        buildInTweenable = new RXTweenable(0.0f, HandleBuildInChange);

        HandleBuildInChange();
    }
示例#4
0
 // Start is called before the first frame update
 void Start()
 {
     Text     = this.gameObject;
     score    = GameObject.Find("ScoreBox");
     scorebox = score.GetComponent <ScoreBox>();
     chein    = scorebox.combo;
 }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     Text     = this.gameObject;
     score    = GameObject.Find("ScoreBox");
     scorebox = score.GetComponent <ScoreBox>();
     tokuten  = scorebox.getpoint;
 }
示例#6
0
 // Start is called before the first frame update
 void Start()
 {
     SteamVR_Fade.Start(Color.black, 0f);
     SteamVR_Fade.Start(Color.clear, 1f);
     score    = GameObject.Find("ScoreBox");
     scorebox = score.GetComponent <ScoreBox>();
     click    = gameObject.AddComponent <AudioSource>();
 }
示例#7
0
 // Start is called before the first frame update
 void Start()
 {
     Text     = this.gameObject;
     score    = GameObject.Find("ScoreBox");
     scorebox = score.GetComponent <ScoreBox>();
     tokuten  = scorebox.getpoint;
     tokuten1 = tokuten.ToString();
     Text.GetComponent <TextMesh>().text = tokuten1;
 }
示例#8
0
 // Start is called before the first frame update
 void Start()
 {
     Text     = this.gameObject;
     score    = GameObject.Find("ScoreBox");
     scorebox = score.GetComponent <ScoreBox>();
     miss     = scorebox.miss;
     miss1    = miss.ToString();
     Text.GetComponent <TextMesh>().text = miss1;
 }
示例#9
0
 // Start is called before the first frame update
 void Start()
 {
     Text     = this.gameObject;
     score    = GameObject.Find("ScoreBox");
     scorebox = score.GetComponent <ScoreBox>();
     combo    = scorebox.combomax;
     combo1   = combo.ToString();
     Text.GetComponent <TextMesh>().text = combo1;
 }
示例#10
0
    // Start is called before the first frame update
    void Start()
    {
        Text     = this.gameObject;
        databox  = GameObject.Find("ScoreBox");
        scorebox = databox.GetComponent <ScoreBox>();

        score  = scorebox.getScore;
        score1 = score.ToString();
        Text.GetComponent <TextMesh>().text = score1;
    }
示例#11
0
    // Start is called before the first frame update
    void Start()
    {
        score    = GameObject.Find("ScoreBox");
        scorebox = score.GetComponent <ScoreBox>();

        click = gameObject.AddComponent <AudioSource>();

        bgmobj = GameObject.Find("BGM");
        bgm    = bgmobj.GetComponent <AudioSource>();
    }
示例#12
0
        private void InitializeScoreBox()
        {
            var texture   = this.GameTextures.GetTexture("MemoryMatrixUpperMenu");
            var rectangle = new Rectangle(
                MemoryMatrixConstants.UpperMenuStartingX,
                MemoryMatrixConstants.UpperMenuStartingY,
                MemoryMatrixConstants.UpperMenuStartingWidth,
                MemoryMatrixConstants.UpperMenuStartingHeight);

            this.scoreBox = new ScoreBox(texture, rectangle, this.shootingRange, this.StateManager.Game.SpriteFont);
            this.ListOfObjects.Add(this.scoreBox);
        }
示例#13
0
    // Start is called before the first frame update
    void Start()
    {
        score    = GameObject.Find("ScoreBox");
        scorebox = score.GetComponent <ScoreBox>();
        root     = GameObject.Find("Camera");
        target   = this.gameObject;
        //Destroy(target, 2.5f);

        pos = this.transform;

        //target.transform.position = new Vector3(x, y, z);
        //this.transform.LookAt(root.transform);

        Invoke("targetdestroy", 2.7f);
    }
示例#14
0
    // Start is called before the first frame update
    void Start()
    {
        original_scale = transform.localScale;
        hand           = transform.GetChild(0).GetComponent <Transform>();

        Debug.Log("New Player Arrived, What Kind of Match?");
        //ROUND UP
        if (PlayerPrefs.GetString("mode", "none").Contains("roundup"))
        {
            //SET MODE TO ROUND UP
            roundupMode = true;
            chaseMode   = false;
            //CREATE SCORE BOX FOR EACH PLAYER
            GameObject sb = Instantiate(scoreBox, Camera.main.GetComponent <FollowPlayers>().scorePanel.transform);
            Debug.Log("SB: " + sb.name);
            score = sb.GetComponent <ScoreBox>();
            int index = sb.transform.GetSiblingIndex();
            Debug.Log("index = " + index);
            if (index % 2 == 0)
            {
                GameObject timer      = GameObject.FindGameObjectWithTag("Timer");
                int        timerIndex = timer.transform.GetSiblingIndex();
                timer.transform.SetSiblingIndex(timerIndex + 1);
            }
            if (PlayerPrefs.GetString("type", "points").Contains("points"))
            {
                //NUMBER OF CAUGHT ANIMALS?
                //POINTS, default 5 if not assigned
                goal         = PlayerPrefs.GetInt("goal", 5);
                timedRoundup = false;
            }
            else
            {
                //TIMED
                timedRoundup = true;
            }
        }
        else
        {
            //NOT PLAYING ROUND UP
            //CHASE
            roundupMode = false;
            chaseMode   = true;
        }
    }
示例#15
0
        public GameplayLayer(ScoreBox scoreBox)
        {
            _scoreBox = scoreBox;

            _fruitsPool = new FruitsPool(GameCoefficients.FruitGenerateDelay);
            _fruitsPool.FruitDestroyed += FruitDestroyed;
            _fruitsPool.FruitCreated   += FruitCreated;

            _paddle = new Paddle();

            CreateBins();

            CreateTouchListener();

            SetupDebug();

            AddChild(_paddle);

            Schedule(Activity);
        }
示例#16
0
        public HudLayer()
        {
            ScoreBox = new ScoreBox();

            AddChild(ScoreBox);
        }
示例#17
0
    void InitializeUI()
    {
        var os  = Environment.OSVersion;
        var pid = os.Platform;

        switch (pid)
        {
        case PlatformID.MacOSX:
            this.Title = "DeepLearnUI (OSX, Mono, Beta)";
            break;

        case PlatformID.Unix:
            this.Title = "DeepLearnUI (Unix/Linux/OSX, Mono, Beta)";
            break;

        case PlatformID.Xbox:
            this.Title = "DeepLearnUI (Xbox, Beta)";
            break;

        case PlatformID.WinCE:
            this.Title = "DeepLearnUI (WinCE x86/x64, Beta)";
            break;

        case PlatformID.Win32NT:
            this.Title = "DeepLearnUI (WinNT x86/x64, Beta)";
            break;

        case PlatformID.Win32Windows:
            this.Title = "DeepLearnUI (Win x86/x64, 1.0)";
            break;

        default:
            this.Title = "DeepLearnUI (Unknown OS, Beta)";
            break;
        }

        Confirm = new Dialog(
            "Are you sure?",
            this,
            DialogFlags.Modal,
            "Yes", ResponseType.Accept,
            "No", ResponseType.Cancel
            )
        {
            Resizable    = false,
            KeepAbove    = true,
            TypeHint     = WindowTypeHint.Dialog,
            WidthRequest = 250
        };

        Confirm.ActionArea.LayoutStyle = ButtonBoxStyle.Center;
        Confirm.WindowStateEvent      += OnWindowStateEvent;

        ImageLoader = new FileChooserDialog(
            "Load image",
            this,
            FileChooserAction.Open,
            "Cancel", ResponseType.Cancel,
            "Open", ResponseType.Accept
            );

        ClearDigit();

        CopyDrawing(Digit);

        CopyClassification();

        ProbabilityZ.IsEditable = false;
        Probability1.IsEditable = false;
        Probability2.IsEditable = false;
        Probability3.IsEditable = false;
        Probability4.IsEditable = false;
        Probability5.IsEditable = false;
        Probability6.IsEditable = false;
        Probability7.IsEditable = false;
        Probability8.IsEditable = false;
        Probability9.IsEditable = false;

        ScoreBox.ModifyFont(Pango.FontDescription.FromString("Verdana 16"));
        ClassificationBox.ModifyFont(Pango.FontDescription.FromString("Verdana 16"));

        for (int i = 0; i < cnn.Layers.Count; i++)
        {
            switch (cnn.Layers[i].Type)
            {
            case LayerTypes.Input:
                NetworkLayers.AppendText(String.Format("{0} Input", i));
                break;

            case LayerTypes.Convolution:
                NetworkLayers.AppendText(String.Format("{0} Convolution", i));
                break;

            case LayerTypes.Subsampling:
                NetworkLayers.AppendText(String.Format("{0} Subsampling / Pooling", i));
                break;
            }
        }

        PrepareImage(ActivationMap);
        PrepareImage(FeatureVector);
        PrepareImage(Output);
        PrepareImage(Weights);
        PrepareImage(NetworkBias);
        PrepareImage(FeatureMap);
        PrepareImage(BiasMap);

        NetworkLayers.Sensitive       = false;
        ActivationMapScroll.Sensitive = false;

        HideFeatureMaps();
    }
示例#18
0
文件: Map.cs 项目: EmmaHow/elementail
    void Start()
    {
        ScoreBox.NextLevel(this);

        Width  = CurrentFloorsizeFactor;
        Height = CurrentFloorsizeFactor;

        // Put the player in the center of the map.
        Player.transform.position = new Vector3((Width - 1) / 2 * TileSize, (Height - 1) / 2 * TileSize, 0f);
        ScoreBox.LeftRunes        = 0;
        ScoreBox.LeavesRemaining  = 0;

        Tiles = new Dictionary <string, GameObject>();
        for (int y = 0; y < Height; y++)
        {
            for (int x = 0; x < Width; x++)
            {
                var coord = x.ToString() + "|" + y.ToString();
                if (IsGoodSpotForMapBoundary(x, y))
                {
                    // Place where there must be walls.
                    Tiles[coord] = Place(WallPrefab, x, y);
                    Tiles[coord].GetComponent <Wall>().IsOutermostWall = true;
                }
                else if (IsGoodSpotForObstacle(x, y))
                {
                    // Places where there must be walls.
                    Tiles[coord] = Place(WallPrefab, x, y);
                }
                else
                {
                    // Places available for plain ground or leaves.
                    Tiles[coord] = null;
                }
            }
        }

        var prefabsToAdd = new Queue <GameObject>();

        for (int i = 0; i < CurrentNumberOfLeaves; i++)
        {
            prefabsToAdd.Enqueue(LeafPrefab);
        }
        for (int i = 0; i < CurrentCarrots; i++)
        {
            prefabsToAdd.Enqueue(CarrotPrefab);
        }

        var allCoords = new List <string>(Tiles.Keys);

        while (prefabsToAdd.Count > 0)
        {
            int    index   = UnityEngine.Random.Range(0, allCoords.Count - 1);
            string toSplit = allCoords[index];

            string[] coords = toSplit.Split(new Char[] { '|' });
            int      x      = Convert.ToInt32(coords[0], 10);
            //Int32.TryParse(coords[0], x);
            int y = Convert.ToInt32(coords[1], 10);
            //Int32.TryParse(coords[1], y);

            List <String> adjacentCoords = new List <string>();
            adjacentCoords.Add(((int)(x + 1)).ToString() + "|" + y.ToString());
            adjacentCoords.Add(((int)(x - 1)).ToString() + "|" + y.ToString());
            adjacentCoords.Add(x.ToString() + "|" + ((int)(y + 1)).ToString());
            adjacentCoords.Add(x.ToString() + "|" + ((int)(y - 1)).ToString());

            if (IsEmptyAndAvailable(toSplit) && IsEmptyAndAvailable(adjacentCoords[0]) && IsEmptyAndAvailable(adjacentCoords[1]) && IsEmptyAndAvailable(adjacentCoords[2]) && IsEmptyAndAvailable(adjacentCoords[3]))
            {
                var prefab = prefabsToAdd.Dequeue();
                Tiles[toSplit] = Place(prefab, x, y);
                if (prefab.GetComponent <Leaf>() != null)
                {
                    ScoreBox.LeavesRemaining++;
                }
            }
        }

        // Add plain ground in any remaining empty spots.
        foreach (var coord in allCoords)
        {
            if (Tiles[coord] == null)
            {
                string[] coords = coord.Split(new Char[] { '|' });
                int      x      = Convert.ToInt32(coords[0], 10);
                //Int32.TryParse(coords[0], x);
                int y = Convert.ToInt32(coords[1], 10);
                //Int32.TryParse(coords[1], y);


                Tiles[coord] = Place(GroundPrefab, x, y);
                var ground = Tiles[coord].GetComponent <Ground>();
                ground.IsDecorated = UnityEngine.Random.value < FractionOfDecoratedGroundTiles;
                ground.Map         = this;
            }
        }
    }
示例#19
0
 public void ResetLevel()
 {
     ScoreBox.ResetLevel();
 }