Example #1
0
 private void Start()
 {
     DebugTextManager.Display(() => "FPS: " + m_fps.ToString("f2") + "(" + (Time.deltaTime * 1000).ToString("00") + "ms)\n", -3);
     DebugTextManager.Display(() => { return("Resolution: " + Screen.width + "×" + Screen.height + "\n"); }, -1);
     //ObserverGraph.observerValue = () => m_fps;
     RawImageGraph.observerValue = () => m_fps;
 }
 // Start is called before the first frame update
 void Start()
 {
     //本ビルドと区別がないので今は無効
     //DebugBoxManager.Display(this).SetSize(200, 200).SetAlignment(TMPro.TextAlignmentOptions.Center);
     DebugTextManager.Display(() => transform.position.x.ToString() + ", " + transform.position.y.ToString() + ((is_atari_) ? "当たり" : "はずれ") + "\n").AddRemoveTrigger(this);
     // sprite_ren_ = body.GetComponent<SpriteRenderer>();
     animator_ = body.GetComponent<Animator>();
     hit_box_ = body.GetComponent<BoxCollider2D>();
 }
Example #3
0
        public void DrawMinimapToScreen(SpriteBatch spriteBatch)
        {
            Texture2D drawMe = (Texture2D)radarTarget;

            spriteBatch.Begin();
            spriteBatch.Draw(drawMe, new Vector2(spriteBatch.GraphicsDevice.Viewport.Width - drawMe.Width, 0), Color.White);

            numOfFrames++;
            DebugTextManager.DrawTextToScreenRight(spriteBatch, 0, "FPS: " + FPS);
            spriteBatch.End();
        }
Example #4
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         throw new System.Exception();
     }
 }
Example #5
0
 // Start is called before the first frame update
 void Start()
 {
     DebugTextManager.Display(() => "MousePos(Screen):" + Input.mousePosition.ToString() + "\n");
     DebugTextManager.Display(() => "MousePos(Canvas):" + (Input.mousePosition * 1920 / Screen.width).ToString() + "\n");
     DebugTextManager.Display(() => "Position(World):" + rectTransform.position.ToString() + "\n");
     onClick       = () => { transform.localScale = Vector3.one; transform.DOPunchScale(Vector3.one, 1); };
     onTouchEnter  = () => rawImage.color = Color.red;
     onTouchStay   = () => rawImage.color = Color.blue;
     onTouchExit   = () => rawImage.color = Color.white;
     rectTransform = GetComponent <RectTransform>();
     rawImage      = GetComponent <RawImage>();
 }
        /// <summary>
        /// Manages all aspects of Planetary Invasion.
        /// </summary>
        /// <param name="Content">Content Manager</param>
        /// <param name="planetLevel">Level to play on.</param>
        public PlanetStateManager(SpriteBatch spriteBatch,
                                  ClientManager clientManager,
                                  HudElementManager hudElementManager,
                                  ParticleManager particleManager,
                                  PhysicsManager physicsManager,
                                  ProjectileManager projectileManager,
                                  ShipManager shipManager,
                                  TextureManager textureManager,
                                  WarpHoleManager warpHoleManager,
                                  SpaceStateManager spaceStateManager,
                                  MessageManager messageManager,
                                  IBus bus,
                                  DebugTextManager debugTextManager,
                                  TargetingManager targetManager,
                                  TeamManager teamManager,
                                  ConfigPlanetStateUI uiConfig,
                                  GameWindow window)

            : base(particleManager, physicsManager, targetManager, teamManager)
        {
            _clientManager     = clientManager;
            _spriteBatch       = spriteBatch;
            _hudElementManager = hudElementManager;
            _shipManager       = shipManager;
            _textureManager    = textureManager;
            _projectileManager = projectileManager;
            _warpHoleManager   = warpHoleManager;
            _spaceStateManager = spaceStateManager;
            _messageManager    = messageManager;
            _bus = bus;
            _debugTextManager = debugTextManager;
            _UI = new PlanetStateUI(uiConfig, shipManager.GetPlayerEnergy);

            _UI.RegisterInstructionCallback("ToggleColonizeMode", ToggleColonizeMode);
            _UI.RegisterInstructionCallback("TurretClicked", ToggleStructurePlacementMode);
            _UI.RegisterInstructionCallback("MissileClicked", _UIFireAmbassador);

            Turrets = new List <Turret>();

            Camera      = new Camera2D();
            updateWatch = new Stopwatch();
            drawWatch   = new Stopwatch();
            Windows     = new List <BaseUI>();
            Camera.Zoom = 1f;

            PotentialTurretTargets = new Dictionary <int, ITargetable>();

            _bus.Subscribe(this);

            this.OnStructureRemoved += PlanetStateManager_OnStructureRemoved;
        }
Example #7
0
        /// <summary>
        /// Draws Radar and Chat GUI elements
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="planetList"></param>
        /// <param name="shipPos"></param>
        public virtual void Draw(SpriteBatch spriteBatch, List <Planet> planetList, Vector2 shipPos)
        {
            pos_Console.Y = spriteBatch.GraphicsDevice.Viewport.Height - tex_Console.Height;

            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);

            spriteBatch.Draw(tex_Console, pos_Console, null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 1f);
            for (int i = 0; i < chatList.Count(); i++)
            {
                Chatline c = chatList[i];
                spriteBatch.DrawString(textFont, c.text, new Vector2(pos_Console.X + 10, pos_Console.Y + (textFont.LineSpacing * c.row)),
                                       Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, .9f);
                chatList[i] = c;
            }

            spriteBatch.DrawString(textFont, currentString, new Vector2(pos_Console.X + 10, pos_Console.Y + tex_Console.Height - textFont.LineSpacing - 5),
                                   Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, .9f);

            DebugTextManager.DrawTextToScreenLeft(spriteBatch, 12, "" + KeyboardManager.IsTyping);

            spriteBatch.End();
        }
Example #8
0
        public HudElementManager(IBus bus,
                                 DebugTextManager dtm,
                                 SpriteBatch spriteBatch,
                                 ContentManager Content,
                                 ClientManager clientManager,
                                 PortStateManager portStateManager,
                                 TextureManager textureManager,
                                 ShipManager shipManager)
        {
            _bus              = bus;
            _spriteBatch      = spriteBatch;
            _content          = Content;
            _debugTextManager = dtm;
            _portStateManager = portStateManager;
            _textureManager   = textureManager;
            _clientManager    = clientManager;
            _shipManager      = shipManager;

            blank = new Texture2D(spriteBatch.GraphicsDevice, 1, 1, false, SurfaceFormat.Color);

            blank.SetData(new[] { Color.White });

            _bus.Subscribe(this);
        }
Example #9
0
    // Start is called before the first frame update
    void Start()
    {
        Time.timeScale = 1;

#if UNITY_EDITOR
        DebugNotificationGenerator.Notify("Qキーでデバッグ表示ON/OFF");
#else
        DebugNotificationGenerator.Notify("4本マルチタッチでデバッグ表示ON/OFF");
#endif

#if UNITY_EDITOR
        isTestPlay = EditorPrefs.GetBool("testPlayFlag", false);
        if (isTestPlay)
        {
            Debug.Log("これはテストプレイです😀");
            EditorPrefs.SetBool("testPlayFlag", false);
            mode = PlayMode.Debug;
            var path = "Assets/Main/Games/TestPlayPackage.asset";
            singleGame     = AssetDatabase.LoadAssetAtPath <GamePackage>(path);
            Time.timeScale = EditorPrefs.GetFloat("timeScale", 1);
            //Initialization();
        }
#endif

        //Debug.Log(SceneManager.GetActiveScene().buildIndex);

        /*
         * if (mode != PlayMode.None)
         * {
         *  Initialization();
         * }
         */

        //やばい実装、後で直す
        if (SceneManager.GetActiveScene().buildIndex == 1)
        {
            mode = PlayMode.Normal;
        }
        else
        {
            //IsGamePlaying = true;
            //mode = PlayMode.None;
        }

        if (mode != PlayMode.None)
        {
            Initialization();
        }

        statementMesh.gameObject.SetActive(false);

        //デバッグ用
        //EndGame();
        DebugTextManager.Display(() => "TimeScale:" + Time.timeScale + "\n");
        //DebugTextManager.Display(() => "progress:" + async.progress + "\n");
        //DebugTextManager.Display(() => "IsGamePlaying:" + IsGamePlaying.ToString() + "\n");
        DebugTextManager.Display(() => "mode:" + mode.ToString() + "\n");
        //DebugTextManager.Display(() => "gameType:" + currentGameType.ToString() + "\n");
        //DebugTextManager.Display(() => "Loading:" + (async.progress * 100).ToString("D3") + "%\n");
        //DebugTextManager.Display(() => "Aspect:" + managerCamera.aspect + "\n");
        //DebugTextManager.Display(() => "AdsIsReady:" + Advertisement.IsReady() + "\n");
        //managerCammera.DOAspect(1, 5);
        //managerCammera.aspect = 16f / 9f;
        //カメラをアス比に合わせる設定
        //managerCamera.orthographicSize *= 16f / 9f / managerCamera.aspect;
    }
Example #10
0
 // Start is called before the first frame update
 virtual protected void Start()
 {
     rectTransform = GetComponent <RectTransform>();
     SetList(size);
     DebugTextManager.Display(() => "index:" + index.ToString());
 }