Inheritance: MonoBehaviour
Exemplo n.º 1
0
 void Start()
 {
     TextControl = World.Instance.TextControl;
     TextControl.CreateText(
         "Lorem ipsum dolor sit amet, consectetur adipiscing elit. <Item>Crowbar In lobortis ultrices pulvinar. " +
         "Nulla mauris diam, rhoncus eu dui a, <Item>Crowbar ullamcorper magna. Suspendisse adipiscing, " +
         "ligula sed suscipit fringilla, arcu sem eleifend dolor, vel tristique lacus sapien et quam. Curabitur in " +
         "ultrices orci. Integer <Item>Crowbar eu odio in tempus. In nec semper ante. Suspendisse volutpat rutrum " +
         "mollis. Fusce facilisis eget nunc sed ultrices. Mauris ut iaculis odio. Donec sit amet orci et lorem varius" +
          "bibendum a eu orci. Nunc placerat dui eu mauris viverra volutpat. Sed sagittis sed nulla at vulputate. " +
          "Mauris eu quam est. Quisque ullamcorper nibh id mollis sagittis. Vestibulum id eros mollis, volutpat" +
           "lacus at, pellentesque tellus. Cras nunc leo, luctus eget consectetur id, pulvinar non justo. Proin tempor" +
            "tortor ut dui varius lobortis. Maecenas scelerisque tellus sed lorem semper, a sodales lectus vulputate. " +
            "Donec ligula diam, bibendum eu congue quis, dapibus quis nisi. In rutrum nisl sed odio faucibus, a " +
            "accumsan arcu egestas. Mauris lacinia magna at malesuada. Ut cursus nunc et nibh pharetra " +
            "pharetra. Nam lectus risus, hendrerit lacinia feugiat non, fringilla et tellus. Quisque tincidunt, nisi et euismod " +
            "hendrerit, est enim semper sapien, molestie bibendum mauris justo ac leo. Quisque in rhoncus risus, " +
            "non hendrerit eros. Praesent varius diam dolor, facilisis interdum neque placerat nec. Fusce bibendum, " +
            "dui rhoncus ullamcorper imperdiet, dolor neque tristique nisl, nec porttitor odio magna et nulla. In varius " +
            "consectetur ante, et tempor tellus commodo quis. Ut pretium pharetra lorem ac molestie. Sed sed diam " +
            "tincidunt, volutpat sem ut, semper augue. Maecenas at nulla eu massa fermentum molestie id eu tellus. " +
            "Donec in elit quis nibh adipiscing iaculis eget ut nisi. Pellentesque est velit, pretium ac lobortis a, suscipit " +
            "eget ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse in facilisis nunc, ac " +
            "condimentum diam. Ut vitae est nec erat pharetra lacinia. Nam rutrum ligula eu tortor interdum, ut" +
             "bibendum enim consequat. Vivamus suscipit mattis orci in scelerisque. Phasellus vel iaculis nunc. " +
             "Mauris malesuada posuere rhoncus. Nam venenatis libero dignissim, varius dolor nec, volutpat justo. " +
             "Aenean sollicitudin, velit vel aliquet gravida, risus velit imperdiet purus, vitae egestas nulla dui sed felis." +
              "Nam convallis dui justo, at tincidunt metus eleifend id. Aenean ac mi ac nisi ultrices pharetra ut sed ante.");
 }
        /// <summary>
        /// Parses the specified pattern returned by the reader and localizes error messages with the text manager specified
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="textManager">The text manager.</param>
        /// <returns></returns>
        public override Expression Parse(TextReader reader, TextManager textManager)
        {
            try
            {
                _reader = reader.ReadToEnd();

                _pos = -1;

                MoveNext();

                var expr = ParseExpression();
                if (_current != Eof)
                {
                    UnexpectedToken("Expression", "" + _current);
                }

                expr.Accept(_trimmer);

                return expr;
            }
            catch (InnerParserException template)
            {
                throw new SyntaxErrorException(template.Message, template.Construct, template.Pos);
            }
        }
Exemplo n.º 3
0
        public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
        {
            Match m;
            if ((m = matcher.Match(spelling)).Success)
            {
                var ops = new List<ArithmeticCondition.Operation>();
                foreach (Match op in operation.Matches(m.Groups["Ops"].Value))
                {
                    ops.Add(new ArithmeticCondition.Operation
                    {
                       Number = double.Parse(op.Groups["Number"].Value, dialect.Parser.PatternCulture),
                       Operator = Arithmetic.GetArithmeticOperator(op.Groups["Op"].Value)
                    });
                }

                return new ArithmeticCondition
                {
                    Operations = ops,
                    CompareOperator = Arithmetic.GetCompareOperator(m.Groups["Op"].Value),
                    TargetValue = int.Parse(m.Groups["TargetValue"].Value)
                };
            }

            return null;
        }
Exemplo n.º 4
0
        public override Expression Parse(System.IO.TextReader reader, TextManager manager)
        {
            var expr = new Expression();
            expr.Parts.Add(new Text { Spelling = reader.ReadToEnd() });

            return expr;
        }
 public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
 {
     if (!string.IsNullOrEmpty(formatExpression))
     {
         return new StringFormatFormatter(formatExpression);
     }
     return null;
 }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     rb2d = gameObject.GetComponent<Rigidbody2D> ();
     animator = gameObject.GetComponent<Animator> ();
     movement = getDefaultMovement ();
     dragon = GameObject.FindGameObjectWithTag ("Dragon").GetComponent<Dragon> ();
     textManager = GameObject.FindGameObjectWithTag ("TextManager").GetComponent<TextManager> ();
 }
Exemplo n.º 7
0
 protected void Awake()
 {
     me = this;
     if (!fonts.ContainsKey("Intro"))
         fonts.Add("Intro", new IntroFont(introLetterPrefab));
     if (!fonts.ContainsKey("Game"))
         fonts.Add("Game", new GameFont(gameLetterPrefab));
 }
Exemplo n.º 8
0
        public override PatternEvaluator GetEvaluator(string pattern, TextManager manager)
        {
            lock (_parseLock)
            {
                var expr = Parser.Parse(pattern, manager);

                return new PatternEvaluator(expr);
            }
        }
Exemplo n.º 9
0
 public virtual ISwitchConditionEvaluator GetSwitchConditionEvaluator(Expression expr, TextManager manager)
 {
     ISwitchConditionEvaluator sc = null;
     if (!SwitchConditionEvaluators.Any(x => (sc = x.GetFor(expr, this, manager)) != null))
     {
         throw new LocalizedKeyNotFoundException("Exceptions.SwitchConditionNotFound", "No switch condition evaluator found for {0}", new { Spec = expr });                
     }
     return sc;
 }
Exemplo n.º 10
0
        public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
        {
            if (!string.IsNullOrEmpty(formatExpression) && formatExpression.Equals("roman", StringComparison.InvariantCulture))
            {
                return new RomanNumberFormatter();
            }

            return null;
        }
Exemplo n.º 11
0
        public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
        {
            if (string.IsNullOrEmpty(spelling) || spelling.Equals("true", StringComparison.InvariantCultureIgnoreCase))
            {
                return new TakeAllCondition();
            }

            return null;
        }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        networkManager = gameObject.GetComponent<NetworkManager>();
        collisionManager = gameObject.GetComponent<CollisionManager>();
        textManager = gameObject.GetComponent<TextManager>();
        notificationManager = gameObject.GetComponent<NotificationManager>();

        panelManager = GameObject.Find("Panel");
        scaleChilds(panelManager);
    }
        public IParameterEvaluator GetFor(ParameterSpec spec, PatternDialect dialect, TextManager manager)
        {
            var parts = spec.ParameterName.Split('.');
            if (parts.Length > 1)
            {
                return new ReflectionParameterEvaluator(parts[0], parts.Skip(1).ToArray());
            }

            return null;
        }
Exemplo n.º 14
0
        public virtual IValueFormatter GetValueFormatter(string spelling, TextManager manager)
        {
            IValueFormatter formatter = null;
            if (!ValueFormatters.Any(x => (formatter = x.GetFor(spelling, this, manager)) != null))
            {
                throw new LocalizedKeyNotFoundException("Exceptions.ValueFormatterNotFound", "No parameter evaluator found for {0}", new { Text = spelling});                
            }

            return formatter;
        }
Exemplo n.º 15
0
        public virtual IParameterEvaluator GetParameterEvaluator(ParameterSpec spec, TextManager manager)
        {
            IParameterEvaluator evaluator = null;
            if (!ParameterEvaluators.Any(x => (evaluator = x.GetFor(spec, this, manager)) != null))
            {
                throw new LocalizedKeyNotFoundException("Exceptions.ParameterEvaluatorNotFound", "No parameter evaluator found for {0}", new { Text = spec });
            }

            return evaluator;
        }
Exemplo n.º 16
0
        public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
        {
            StringCaseTransformationType type;
            if (!string.IsNullOrEmpty(formatExpression) 
                && _transformationTypes.TryGetValue(formatExpression.ToLowerInvariant(), out type))
            {
                return new StringCaseFormatter { TransformationType = type };
            }

            return null;
        }
Exemplo n.º 17
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 18
0
	void Start()
    {
        root = GameObject.Find("UI Root");
        ps = transform.GetComponent<PanelSwitch>();
        tm = transform.GetComponent<TextManager>();
        im = transform.GetComponent<ImageManager>();
        playerdata = new UserData();
        for(int i = 0; i < 7; i++)
        {
            girl[i] = new GirlData(i);
        }
    }
Exemplo n.º 19
0
    void OnEnable()
    {
        thisScript = (TextManager) target;

        isFinalBoxProp = serializedObject.FindProperty("isFinalBox");
        TypeWritterFrequencyProp = serializedObject.FindProperty("TypeWritterFrequency");
        NumberOfStatementsProp = serializedObject.FindProperty("NumberOfStatements");
        ScriptProp = new SerializedProperty[thisScript.Script.Length];
        for(int i = 0; i < thisScript.Script.Length; i++)
        {
            ScriptProp[i] = serializedObject.FindProperty(string.Format("{0}.Array.data[{1}]", "Script", i));
        }
    }
Exemplo n.º 20
0
        public ITextSource GetSource(TextManager textManager, Assembly referenceAssembly, string targetNamespace)
        {
            var source = new SimpleTextSource();
            source.Texts.Add(new LocalizedText
            {
                Namespace = targetNamespace,
                Key = "Tulips1",
                Pattern = "resource:TestPlugin.Koala.jpg",
                Language = "da-DK",
                Source = new TextSourceInfo { TextSource = source, ReferenceAssembly = referenceAssembly }
            });

            return source;
        }
 public override ITextSource GetSource(Assembly asm, TextManager textManager, string targetNamespace)
 {            
     var source = XmlTextSource.ForAssembly(asm, ResourceName);
     if (source != null)
     {
         source.DefaultNamespace = targetNamespace;
     }
     else
     {
         throw new LocalizedFileNotFoundException(ResourceName, "Exceptions.ResourceNotFoundException",
             defaultMessage: "The resource {0} could not be opened");
     }
     return source;
 }
Exemplo n.º 22
0
        public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
        {
            if (spelling.StartsWith("@"))
            {
                var evaluator = dialect.GetParameterEvaluator(
                    new ParameterSpec { ParameterName = spelling }, manager) as PatternLookupEvaluator;
                if (evaluator != null)
                {
                    return new LookupCondition
                    {
                        Dialect = dialect,
                        Evaluator = evaluator
                    };
                }
            }

            return null;
        }        
        public ISwitchConditionEvaluator GetFor(Expression rep, PatternDialect dialect, TextManager manager)
        {
            if (rep == null)
            {
                return GetFor("", dialect, manager);
            }
            else if (rep.Parts.Count == 1)
            {
                var text = rep.Parts[0] as Text;
                if (text != null)
                {
                    return GetFor(text.Spelling.Trim(), dialect, manager);
                }
            }

            //Unsupported expression
            return null;
        }
Exemplo n.º 24
0
        public SDFTestbench()
            : base(800, 600,
            OpenTK.Graphics.GraphicsMode.Default,
            "SDF Testbench",
            GameWindowFlags.Default,
            DisplayDevice.Default,
            3, 1,
            OpenTK.Graphics.GraphicsContextFlags.Default)
        {
            this.VSync = OpenTK.VSyncMode.Off;

            // set default shader loader
            ShaderProgram.DefaultLoader = new OpenTKExtensions.Loaders.FileSystemLoader(SHADERPATH);

            Components.Add(font = new Font("Resources/consolab.ttf_sdf_512.png", "Resources/consolab.ttf_sdf_512.txt"));
            Components.Add(textManager = new TextManager("main", font) { AutoTransform = true });
            Components.Add(frameCounter = new FrameCounter());
            Components.Add(camera = new WalkCamera(this.Keyboard, this.Mouse) { MovementSpeed = 10.0f, Position = new Vector3(0f,1f,0f), LookMode = WalkCamera.LookModeEnum.Mouse1});
            Components.Add(sdfRenderer = new SDFRenderer() { Camera = camera });

            keyDownActions.Add(Key.Escape, (km) => { this.Close(); });

            keyDownActions.Add(Key.I, (km) => { sdfRenderer.ShowTraceDepth = !sdfRenderer.ShowTraceDepth; });
            //keyDownActions.Add(Key.I, (km) => { sdfRenderer.ShowTraceDepth = true; });
            //keyUpActions.Add(Key.I, (km) => { sdfRenderer.ShowTraceDepth = false; });

            this.Load += SDFTestbench_Load;
            this.Unload += SDFTestbench_Unload;
            this.UpdateFrame += SDFTestbench_UpdateFrame;
            this.RenderFrame += SDFTestbench_RenderFrame;
            this.Resize += SDFTestbench_Resize;

            this.KeyDown += SDFTestbench_KeyDown;
            this.KeyUp += SDFTestbench_KeyUp;

            //shaderWatcher = new FileSystemWatcher(SHADERPATH);
            //shaderWatcher.Changed += shaderWatcher_Changed;
            //shaderWatcher.EnableRaisingEvents = true;
            shaderWatcher = new FileSystemPoller(SHADERPATH);

            this.MouseWheel += SDFTestbench_MouseWheel;
        }
Exemplo n.º 25
0
        public override PatternEvaluator GetEvaluator(string pattern, TextManager manager)
        {
            lock (_parseLock)
            {
                if (PatternTransformer != null)
                {
                    pattern = PatternTransformer.Encode(pattern);
                }

                var expr = Parser.Parse(pattern, manager);

                //Bind parameter evaluators, value formatters etc.
                expr.Accept(new PatternDecorator(manager, this));

                //Convert switches with two or three condition less cases to default enum construction and apply switch templates
                expr.Accept(new SwitchDecorator(manager, this));

                return new PatternEvaluator(expr) {PatternTransformer = PatternTransformer};
            }
        }
        public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
        {
            if (spelling.StartsWith("(") && spelling.EndsWith(")"))
            {
                spelling = spelling.Substring(1, spelling.Length - 1);
            }            

            Match m;
            if ((m = _matcher.Match(spelling)).Success)
            {
                var left = RemoveParentheses(m.Groups["Left"].Value);
                var right = RemoveParentheses(m.Groups["Right"].Value);

                return new BooleanExpressionCondition
                {
                    Left = dialect.GetSwitchConditionEvaluator(Expression.Text(left), manager),                    
                    Disjunction = m.Groups["Operator"].Value.Equals("or", StringComparison.CurrentCultureIgnoreCase),
                    Right = dialect.GetSwitchConditionEvaluator(Expression.Text(right), manager)
                };
            }

            return null;
        }
        /// <summary>
        /// Gets the text sources defined in the assembly specified
        /// </summary>
        /// <param name="asm">The assembly.</param>
        /// <param name="textManager">The text manager.</param>
        /// <param name="targetNamespace">The default namespace expected for the assembly when adding texts</param>
        /// <returns></returns>
        public static ITextSource GetTextSource(Assembly asm, TextManager textManager, string targetNamespace)
        {
            var sources = new List<LocalizationSourceAttribute>();


            sources.AddRange(asm.GetCustomAttributes(typeof(LocalizationSourceAttribute), true)
                .Cast<LocalizationSourceAttribute>());

            var source = new TextSourceAggregator();

            using (source.BeginUpdate())
            {
                //TODO: Is a default source needed?
                //The default source  
                try
                {                    
                    source.Sources.Add(
                        new PrioritizedTextSource(
                            new LocalizationXmlSourceAttribute(LocalizationConfig.DefaultXmlFileName).GetSource(asm, textManager, targetNamespace)));
                }
                catch
                {                                        
                }

                foreach (var attr in sources)
                {
                    var s = attr.GetSource(asm, textManager, targetNamespace);
                    if (s != null)
                    {
                        source.Sources.Add(
                            new PrioritizedTextSource(s, attr.Priority));
                    }
                }
            }

            return source.Sources.Any() ? source : null;
        }
Exemplo n.º 28
0
        public Map(string file, string dir, string version, Orientation orientation, int width, int height, int tileWidth, int tileHeight, IEnumerable<KeyValuePair<string, string>> properties, IEnumerable<Layer> layers)
        {
            Filename = file;
            Directory = dir;
            Version = version;
            Orientation = orientation;
            Width = width;
            Height = height;
            TileWidth = tileWidth;
            TileHeight = tileHeight;

            _properties = new Dictionary<string, string>();
            foreach (var property in properties)
                _properties.Add(property.Key, property.Value);

            _layers = new List<Layer>();
            foreach (var layer in layers)
            {
                if (layer is TileLayer)
                {
                    var tl = layer as TileLayer;
                    _layers.Add(new TileLayer(tl.Name, tl.Type, tl.Width, tl.Height, tl.Opacity, tl.Visible, tl.LayerDepth, tl.Properties, tl.Tiles));
                }
                else if (layer is MapObjectLayer)
                {
                    var mol = layer as MapObjectLayer;
                    _layers.Add(new MapObjectLayer(mol.Name, mol.Type, mol.Width, mol.Height, mol.Opacity, mol.Visible, mol.LayerDepth, mol.Properties, mol.Objects, mol.Color));
                }
                else
                    throw new Exception("Unknown layer type: " + layer.GetType());
            }

            TextManager = new TextManager(this);

            Debug.Assert(HasLayer("player"), "No player layer exists on map!\n\n" + Filename);
        }
 public LocalizingDefaultModelBinder(TextManager textManager)
 {
     TextManager = textManager;
 }
Exemplo n.º 30
0
        private bool SelectItem(GUIComponent component, object obj)
        {
            FabricableItem targetItem = obj as FabricableItem;

            if (targetItem == null)
            {
                return(false);
            }

            if (selectedItemFrame != null)
            {
                GuiFrame.RemoveChild(selectedItemFrame);
            }

            //int width = 200, height = 150;
            selectedItemFrame = new GUIFrame(new Rectangle(0, 0, (int)(GuiFrame.Rect.Width * 0.4f), 300), Color.Black * 0.8f, Alignment.CenterY | Alignment.Right, null, GuiFrame);

            selectedItemFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);

            progressBar = new GUIProgressBar(new Rectangle(0, 0, 0, 20), Color.Green, "", 0.0f, Alignment.BottomCenter, selectedItemFrame);
            progressBar.IsHorizontal = true;

            if (targetItem.TargetItem.sprite != null)
            {
                int y = 0;

                GUIImage img = new GUIImage(new Rectangle(10, 0, 40, 40), targetItem.TargetItem.sprite, Alignment.TopLeft, selectedItemFrame);
                img.Scale = Math.Min(Math.Min(40.0f / img.SourceRect.Width, 40.0f / img.SourceRect.Height), 1.0f);
                img.Color = targetItem.TargetItem.SpriteColor;

                new GUITextBlock(
                    new Rectangle(60, 0, 0, 25),
                    targetItem.TargetItem.Name,
                    Color.Transparent, Color.White,
                    Alignment.TopLeft,
                    Alignment.TopLeft, null,
                    selectedItemFrame, true);

                y += 40;

                if (!string.IsNullOrWhiteSpace(targetItem.TargetItem.Description))
                {
                    var description = new GUITextBlock(
                        new Rectangle(0, y, 0, 0),
                        targetItem.TargetItem.Description,
                        "", Alignment.TopLeft, Alignment.TopLeft,
                        selectedItemFrame, true, GUI.SmallFont);

                    y += description.Rect.Height + 10;
                }


                List <Skill> inadequateSkills = new List <Skill>();

                if (Character.Controlled != null)
                {
                    inadequateSkills = targetItem.RequiredSkills.FindAll(skill => Character.Controlled.GetSkillLevel(skill.Name) < skill.Level);
                }

                Color  textColor = Color.White;
                string text;
                if (!inadequateSkills.Any())
                {
                    text = TextManager.Get("FabricatorRequiredItems") + ":\n";
                    foreach (Tuple <ItemPrefab, int, float, bool> ip in targetItem.RequiredItems)
                    {
                        text += "   - " + ip.Item1.Name + " x" + ip.Item2 + (ip.Item3 < 1.0f ? ", " + ip.Item3 * 100 + "% " + TextManager.Get("FabricatorRequiredCondition") + "\n" : "\n");
                    }
                    text += TextManager.Get("FabricatorRequiredTime") + ": " + targetItem.RequiredTime + " s";
                }
                else
                {
                    text = TextManager.Get("FabricatorRequiredSkills") + ":\n";
                    foreach (Skill skill in inadequateSkills)
                    {
                        text += "   - " + skill.Name + " " + TextManager.Get("Lvl").ToLower() + " " + skill.Level + "\n";
                    }

                    textColor = Color.Red;
                }

                new GUITextBlock(
                    new Rectangle(0, y, 0, 25),
                    text,
                    Color.Transparent, textColor,
                    Alignment.TopLeft,
                    Alignment.TopLeft, null,
                    selectedItemFrame);

                activateButton           = new GUIButton(new Rectangle(0, -30, 100, 20), TextManager.Get("FabricatorCreate"), Color.White, Alignment.CenterX | Alignment.Bottom, "", selectedItemFrame);
                activateButton.OnClicked = StartButtonClicked;
                activateButton.UserData  = targetItem;
                activateButton.Enabled   = false;
            }

            return(true);
        }
Exemplo n.º 31
0
 void Awake()
 {
     tmp = gameObject.GetComponent <TextMeshPro>();
     TM  = GameObject.FindGameObjectWithTag("TextManager");
     TMS = TM.GetComponent <TextManager>();
 }
Exemplo n.º 32
0
 /// <summary>
 /// Creates a <see cref="XmlTextSource"/> that monitors the specified path for changes.
 /// This is not allowed in medium trust
 /// </summary>
 /// <typeparam name="TReferenceAssembly">The default assembly used to resolve resources.</typeparam>
 /// <param name="manager">The manager.</param>
 /// <param name="path">The path.</param>
 public static XmlTextSource Monitoring <TReferenceAssembly>(TextManager manager, string path)
 {
     return(Monitoring(typeof(TReferenceAssembly).Assembly, manager, path));
 }
Exemplo n.º 33
0
    public override void Show(bool active)
    {
        base.Show(active);
        if (active)
        {
            int score      = GameSystem.GetInstance().Score;
            int gainedCoin = GameSystem.GetInstance().CurrentModeLogic.ShouldGainBouns ? score / Constant.SCORE_TO_COIN : 0;
            if (GameSystem.GetInstance().IsVIP)
            {
                bonusBlockLabel.text = string.Format("+{0} x 2", gainedCoin);
            }
            else
            {
                bonusBlockLabel.text = string.Format("+{0}", gainedCoin);
            }
            totalBlockLabel.text = GameSystem.GetInstance().Coin.ToString();

            int bestRecord = PlayerProfile.LoadBestRecord(GameSystem.GetInstance().CurrentMode, GameSystem.GetInstance().CurrentModeType);
            modeNameLabel.text     = TextManager.GetText(string.Format("mode_name_{0}", (int)GameSystem.GetInstance().CurrentMode));
            modeTypeNameLabel.text = string.Format("({0})", TextManager.GetText(string.Format("mode_type_name_{0}", (int)GameSystem.GetInstance().CurrentModeType)));

            if (GameSystem.GetInstance().CurrentModeType == GameSystem.ModeType.PassLevel)
            {
                scoreLabel.text         = string.Format("{0}/{1}", GameSystem.GetInstance().DisplayWaveNumber, Constant.MAX_PASSLEVEL);
                newBestRecordLabel.text = string.Format("{0}/{1}", bestRecord, Constant.MAX_PASSLEVEL);
                //passLevelElement.SetActive(true);
                nonePassLevelElement.SetActive(false);
            }
            else
            {
                scoreLabel.text         = score.ToString();
                bestRecordLabel.text    = bestRecord.ToString();
                newBestRecordLabel.text = bestRecord.ToString();
                //passLevelElement.SetActive(false);
                nonePassLevelElement.SetActive(true);
            }

            if (GameSystem.GetInstance().BrokenRecord)
            {
                commonResultPanel.SetActive(false);
                brokenRecordPanel.SetActive(true);
            }
            else
            {
                commonResultPanel.SetActive(true);
                brokenRecordPanel.SetActive(false);
            }

            if (score >= popADScore)
            {
                adTrigger.ToShow(true);
            }

            if (GameSystem.GetInstance().IsActivated &&
                gainedCoin > 0 &&
                (GameSystem.GetInstance().BrokenRecord || GameSystem.GetInstance().CurrentModeType != GameSystem.ModeType.PassLevel))
            {
                PlayGetBonusAnimation();
            }
            else
            {
                bonusAnimationObj.SetActive(false);
            }

            for (int i = 0; i < modeContents.Length; i++)
            {
                modeContents[i].SetActive(i == (int)GameSystem.GetInstance().CurrentMode);
            }

            if (GameSystem.GetInstance().CurrentMode == GameSystem.Mode.Dual)
            {
                dualWinnerSprite.color = DualMode.GetInstance().IsLeftWin ? Constant.LEFT_COLOR : Constant.RIGHT_COLOR;
            }
            int percent = AchieveData.computePercentByScore(GameSystem.GetInstance().CurrentMode, GameSystem.GetInstance().CurrentModeType, score);
            achieveLabel.text = string.Format(TextManager.GetText("achieve_desc"), percent);
        }
    }
Exemplo n.º 34
0
 public void Setup()
 {
     _manager = new DefaultTextManager { CurrentLanguage = () => new LanguageInfo { Key = "en-US" } };
     _manager.Texts.Sources.Add(new PrioritizedTextSource(_source = new SimpleTextSource()));
     LocalizationConfig.TextManagerResolver = () => _manager;
 }
Exemplo n.º 35
0
    private void changeInfo(string text)
    {
        string path     = "Sprites/icon/";
        string wakupath = "Sprites/newIcon/unkou/";
        Sprite image;
        Sprite wakuimage;

        Image waku = GameObject.Find("unkou").GetComponent <Image>();

        if (text.Contains("新京成線は、ただいま運転を見合わせています。") || text.Contains("【新京成線 全線運転見合わせ】") || text.Contains("【新京成線 一部区間運転見合わせ】"))
        {
            path            += "miawase";
            wakupath        += "miawase";
            image            = Resources.Load <Sprite>(path);
            infoimage.sprite = image;
            wakuimage        = Resources.Load <Sprite>(wakupath);
            waku.sprite      = wakuimage;

            infostr.text = TextManager.Get(TextManager.KEY.INFO_STOP);
        }
        else if (text.Contains("新京成線は、平常通り運転しています。"))
        {
            path            += "maru";
            wakupath        += "maru";
            image            = Resources.Load <Sprite>(path);
            infoimage.sprite = image;
            wakuimage        = Resources.Load <Sprite>(wakupath);
            waku.sprite      = wakuimage;

            infostr.text = TextManager.Get(TextManager.KEY.INFO_NORMAL);
        }
        else
        {
            if (text.Contains("【新京成線 遅延】"))
            {
                path            += "tien";
                wakupath        += "tien";
                image            = Resources.Load <Sprite>(path);
                infoimage.sprite = image;
                wakuimage        = Resources.Load <Sprite>(wakupath);
                waku.sprite      = wakuimage;

                infostr.text = TextManager.Get(TextManager.KEY.INFO_DELAY);
            }
            else if (text.Contains("【新京成線 一部列車運休】"))
            {
                path            += "tien";
                wakupath        += "tien";
                image            = Resources.Load <Sprite>(path);
                infoimage.sprite = image;
                wakuimage        = Resources.Load <Sprite>(wakupath);
                waku.sprite      = wakuimage;

                infostr.text = TextManager.Get(TextManager.KEY.INFO_UNKYU);
            }
            else if (text.Contains("【新京成線 直通運転中止】"))
            {
                path            += "tien";
                wakupath        += "tien";
                image            = Resources.Load <Sprite>(path);
                infoimage.sprite = image;
                wakuimage        = Resources.Load <Sprite>(wakupath);
                waku.sprite      = wakuimage;

                infostr.text = TextManager.Get(TextManager.KEY.INFO_TYOKUTU);
            }
            else
            {
                path            += "infomation";
                wakupath        += "infomation";
                image            = Resources.Load <Sprite>(path);
                infoimage.sprite = image;
                wakuimage        = Resources.Load <Sprite>(wakupath);
                waku.sprite      = wakuimage;

                infostr.text = TextManager.Get(TextManager.KEY.INFO_INFO);
            }
        }
    }