示例#1
0
    // Use this for initialization
    void Start()
    {
        depthManager = gameObject.transform.Find("Sprite").GetComponentInChildren <DepthManager>();

        appliedSkillList = new List <SkillInfo>();

        gameUpdater = GameObject.Find("Updater").transform.GetComponent <GameUpdater>();

        GameObject UI_Root = GameObject.Find("UI Root");

        UICam          = UI_Root.transform.Find("Camera(UI)").GetComponent <Camera>();
        TopLeftAnchor  = UI_Root.transform.Find("TopLeftAnchor").gameObject;
        TopRightAnchor = UI_Root.transform.Find("TopRightAnchor").gameObject;
        GameObject BottonRightAnchor = UI_Root.transform.Find("BottonRightAnchor").gameObject;
        GameObject MaxSpawnPosY      = UI_Root.transform.Find("MaxSpawnPosY").gameObject;

        RandomPosY = Random.Range(BottonRightAnchor.transform.position.y, MaxSpawnPosY.transform.position.y);
        gameObject.transform.position      = new Vector3(BottonRightAnchor.transform.position.x, RandomPosY, gameObject.transform.position.z);
        gameObject.transform.localPosition = new Vector3(gameObject.transform.localPosition.x, gameObject.transform.localPosition.y, -1);


        animation = gameObject.transform.Find("Sprite").GetComponentInChildren <Animation>();



        skillEffectSystem = GameObject.Find("Updater").transform.Find("SkillEffectSystem").GetComponent <SkillEffectSystem>();
    }
示例#2
0
        public void LoadContent()
        {
            string   exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            FileInfo exeInfo = new FileInfo(exePath);

            ContentFenja.Initialize(exeInfo.LastWriteTime);

#if DEBUG
            string contentPath = Path.Combine(new DirectoryInfo(Environment.CurrentDirectory).Parent.Parent.Parent.FullName, "Content");
#else
            string contentPath = Path.Combine(Environment.CurrentDirectory, @"Content");
#endif

#if DEBUG
            string[] files = null;
#else
            string filesFile;
            var    assembly     = Assembly.GetExecutingAssembly();
            var    resourceName = "LD48.Content.ContentListGenerated_do-not-edit.txt";
            using (Stream stream = assembly.GetManifestResourceStream(resourceName))
                using (StreamReader reader = new StreamReader(stream))
                {
                    filesFile = reader.ReadToEnd();
                }

            string[] files = filesFile.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
#endif

            Textures.LoadContent(gDevice, content, contentPath);
            Fonts.LoadContent(content);
            Sounds.LoadContent(content, contentPath, files);
            Music.LoadContent(content);
            DepthManager.Initialize(typeof(Depth));
            Paths.Initialize(contentPath);
        }
示例#3
0
 public void ResetDepth()
 {
     if (Application.get_isPlaying())
     {
         DepthManager.SetDepth(base.get_gameObject(), this.SortingOrder);
     }
 }
示例#4
0
    /// <summary>
    /// 實體化老鼠角色
    /// </summary>
    /// <param name="bundle">實體化物件</param>
    /// <param name="parent">上層</param>
    /// <param name="name">名稱</param>
    /// <param name="sacle">縮放</param>
    /// <returns></returns>-
    public GameObject InstantiateActor(GameObject bundle, Transform parent, string name, Vector3 sacle)
    {
        _clone = Instantiate(bundle, parent, name, Vector3.zero, sacle, Vector2.zero, -1);
        _clone.SetActive(false);
        DepthManager.SwitchDepthLayer(_clone, parent, Global.MeunObjetDepth);
        _clone.SetActive(true);

        return(_clone);
    }
示例#5
0
    // Use this for initialization
    void Start()
    {
        _depthManager   = depthManager.GetComponent <DepthManager> ();
        _nodeController = nodeController.GetComponent <NodeController> ();
        _depthData      = _depthManager.GetData();

        // create an array of rows for the depth data
        orderedDepthData = createOrderedDepthData(_depthData);
        heightThreshold  = (ushort)7000;
    }
示例#6
0
 /// <summary>
 /// 當按下且移動時,產生Clone
 /// </summary>
 void Move2Clone()
 {
     _clone = (GameObject)Instantiate(gameObject);
     EnDisableBtn(_clone, false);
     _clone.transform.parent        = transform.parent;
     _clone.transform.localPosition = _originPos;
     _clone.transform.localScale    = transform.localScale;
     _clone.name = gameObject.name;
     _clone.tag  = gameObject.tag;
     _depth      = DepthManager.SwitchDepthLayer(gameObject, transform, Global.MeunObjetDepth); // 移動時深度提到最高防止遮擋
 }
示例#7
0
 public void PauseGuideSystem(bool isPause)
 {
     if (isPause)
     {
         DepthManager.SetDepth(base.get_gameObject(), 0);
     }
     else
     {
         DepthManager.SetDepth(base.get_gameObject(), 10002);
     }
 }
示例#8
0
    public void GuideOn()
    {
        this.m_isGuideOn = true;
        LayerSystem.SetGameObjectLayer(base.get_gameObject(), "UI", 1);
        DepthManager.SetGraphicRaycaster(base.get_gameObject());
        DepthManager.SetDepth(base.get_gameObject(), 10002);
        Canvas component = base.GetComponent <Canvas>();

        if (component != null)
        {
            component.set_overrideSorting(true);
            component.set_enabled(true);
        }
    }
示例#9
0
 protected override void InitUI()
 {
     base.InitUI();
     DepthManager.SetDepth(base.FindTransform("Layer1").get_gameObject(), 10001);
     DepthManager.SetGraphicRaycaster(base.FindTransform("Layer1").get_gameObject());
     DepthManager.SetDepth(base.FindTransform("Layer2").get_gameObject(), 10003);
     this.Pause                      = base.FindTransform("Pause");
     this.m_goButtonSkip             = base.FindTransform("ButtonSkip").get_gameObject();
     this.MaskScreen                 = base.FindTransform("MaskScreen");
     this.m_spMaskScreen             = base.FindTransform("MaskScreen").GetComponent <Image>();
     this.JumpContinueUI             = base.FindTransform("JumpContinueUI");
     this.m_spContinueIcon           = base.FindTransform("ContinueIcon").GetComponent <Image>();
     this.m_spContinueIconName       = base.FindTransform("ContinueIconName").GetComponent <Image>();
     this.m_spContinueIconBg         = base.FindTransform("ContinueIconBg").GetComponent <Image>();
     this.m_lblContinueTip           = base.FindTransform("ContinueTip").GetComponent <Text>();
     this.ContinueFX                 = base.FindTransform("ContinueFX");
     this.JumpDriftUI                = (base.FindTransform("JumpDriftUI") as RectTransform);
     this.JumpDriftUIPos             = (base.FindTransform("JumpDriftUIPos") as RectTransform);
     this.m_spJumpDriftUIIcon        = base.FindTransform("JumpDriftUIIcon").GetComponent <Image>();
     this.m_spJumpDriftUIIconBg      = base.FindTransform("JumpDriftUIIconBg").GetComponent <Image>();
     this.FingerUI                   = (base.FindTransform("FingerUI") as RectTransform);
     this.FingerUIPos                = (base.FindTransform("FingerUIPos") as RectTransform);
     this.InstructionBubbleUI        = (base.FindTransform("InstructionBubbleUI") as RectTransform);
     this.InstructionBubbleBg1       = (base.FindTransform("InstructionBubbleBg1") as RectTransform);
     this.InstructionBubbleBg2       = (base.FindTransform("InstructionBubbleBg2") as RectTransform);
     this.m_lblInstructionBubbleDesc = base.FindTransform("InstructionBubbleDesc").GetComponent <Text>();
     this.InstructionRoleUI          = (base.FindTransform("InstructionRoleUI") as RectTransform);
     this.InstructionRoleBg          = (base.FindTransform("InstructionRoleBg") as RectTransform);
     this.InstructionRoleIcon        = base.FindTransform("InstructionRoleIcon");
     this.m_lblInstructionRoleDesc   = base.FindTransform("InstructionRoleDesc").GetComponent <Text>();
     this.ImageShowUI                = (base.FindTransform("ImageShowUI") as RectTransform);
     this.m_src                      = base.FindTransform("ISUIImageSR").GetComponent <ScrollRectCustom>();
     this.m_src.movePage             = true;
     this.m_src.Arrow2First          = base.FindTransform("ISUIArrowL");
     this.m_src.Arrow2Last           = base.FindTransform("ISUIArrowR");
     this.m_src.OnPageChanged        = delegate(int pageIndex)
     {
         PageUIView.Instance.SetPage(this.m_src.GetPageNum(), pageIndex);
     };
     this.m_listPool = base.FindTransform("ISUIImageList").GetComponent <ListPool>();
     this.m_listPool.SetItem("GuideUIImageShowItem");
     this.m_listPool.isAnimation = false;
     this.ResetGuideUI();
     EventTriggerListener.Get(base.FindTransform("ButtonSkip").get_gameObject()).onClick      = new EventTriggerListener.VoidDelegateGameObject(this.OnButtonSkip);
     EventTriggerListener.Get(base.FindTransform("MaskScreen").get_gameObject()).onClick      = new EventTriggerListener.VoidDelegateGameObject(this.OnMaskScreen);
     EventTriggerListener.Get(base.FindTransform("ButtonContinue").get_gameObject()).onClick  = new EventTriggerListener.VoidDelegateGameObject(this.OnClickButtonContinue);
     EventTriggerListener.Get(base.FindTransform("ISUIButtonClose").get_gameObject()).onClick = new EventTriggerListener.VoidDelegateGameObject(this.OnClickButtonClose);
     EventTriggerListener.Get(base.FindTransform("ISUIArrowL").get_gameObject()).onClick      = new EventTriggerListener.VoidDelegateGameObject(this.OnClickButtonArrowL);
     EventTriggerListener.Get(base.FindTransform("ISUIArrowR").get_gameObject()).onClick      = new EventTriggerListener.VoidDelegateGameObject(this.OnClickButtonArrowR);
 }
示例#10
0
        public static bool replayRun; // if set to true once, it stays that way until game is restartet (prevents save file from being overridden)

        public static void Initialize(Int2 _res, GraphicsDevice graphicsDevice)
        {
            gDevice = graphicsDevice;
            res     = _res;
            resV    = _res.ToVector2();
            res2    = resV / 2f;

            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("en-us");

            L.Initialize();

            DepthManager.Initialize(typeof(Depth), typeof(DepthScreen));

            graphicsRand = new Random();
        }
示例#11
0
 void Update()
 {
     if (InfraredSourceManager == null)
     {
         return;
     }
     
     _InfraredManager = InfraredSourceManager.GetComponent<DepthManager>();
     if (_InfraredManager == null)
     {
         return;
     }
 
     gameObject.GetComponent<Renderer>().material.mainTexture = _InfraredManager.GetInfraredTexture();
 }
示例#12
0
    // Use this for initialization
    void Start()
    {
        //Setting startin variable
        delay        = 25;
        current      = 0;
        formatLength = 217088;

        //Initializing depth manager
        _depthManager = depthManager.GetComponent <DepthManager> ();

        //Initializing the 2D array
        buffer = new ushort[delay, formatLength];
        result = new ushort[formatLength];

        //Display the resolution
        print("Current depth format length is:");
        print(formatLength);
    }
 public PowerShellTreeProgressCallback(PrtgCmdlet cmdlet, bool internalProgress = false)
 {
     DepthManager = new PowerShellDepthManager(cmdlet, internalProgress);
 }
 public void RefreshDepth(int sortingOrder)
 {
     this.SortingOrder = sortingOrder;
     DepthManager.SetDepth(base.get_gameObject(), this.SortingOrder);
 }
示例#15
0
 private void Start()
 {
     DepthManager.SetGraphicRaycaster(base.get_gameObject());
     this.ResetDepth();
 }
示例#16
0
文件: Race.cs 项目: bytinggames/LD48
        public override void Draw(GameTime gameTime)
        {
            G.GDevice.Clear(Color.Black);

            Drawer.roundPositionTo = 0f;// 0.25f;

            //DepthStencilState state = new DepthStencilState()
            //{
            //    DepthBufferEnable = true,
            //    DepthBufferFunction = CompareFunction.LessEqual,
            //};


            Vector3 screenshake = G.Rand.NextVector3Box() * screenshakeStrength;

            screenshake.Z        = 0;
            screenshakeStrength *= 0.8f;
            camera.matrix       *= Matrix.CreateTranslation(screenshake);

            G.SpriteBatch.Begin(SpriteSortMode.FrontToBack, null, SamplerState.PointClamp, null, null, null, camera.matrix);
            DepthManager.BeginDraw(typeof(Depth));
            DrawM.basicEffect.World = camera.matrix;
            //G.GDevice.DepthStencilState = state;

            //DrawM.basicEffect.Projection = Matrix.Create
            Depth.entities.Set(() =>
            {
                for (int i = 0; i < Entities.Count; i++)
                {
                    Entities[i].Draw(gameTime);
                }
            });

            Depth.floor.Set(() =>
            {
                for (int y = 0; y < tiles.GetLength(1); y++)
                {
                    for (int x = 0; x < tiles.GetLength(0); x++)
                    {
                        tiles[x, y].Draw(new Vector2(x * Tile.size, y * Tile.size));
                    }
                }
            });
            //Depth.floorOver.Set(() =>
            //{
            //    M_Rectangle rect = new M_Rectangle();
            //    rect.size = new Vector2(Tile.size);
            //    for (int y = 0; y < tiles.GetLength(1); y++)
            //    {
            //        for (int x = 0; x < tiles.GetLength(0); x++)
            //        {
            //            if (street[x, y])
            //            {
            //                rect.pos = new Vector2(x * Tile.size, y * Tile.size);
            //                rect.Draw(Color.Black * 0.5f);
            //            }
            //        }
            //    }
            //});

#if DEBUG
            if (editorTool == EditorTool.Goal || editorTool == EditorTool.House || editorTool == EditorTool.Tile)
            {
                Depth.editorTools.Set(() =>
                {
                    if (mouseDown != null)
                    {
                        GetDragRectangle().Draw(Color.Black * 0.5f);
                    }
                });
            }
#endif

            gameState.Current?.Draw(gameTime);

            G.SpriteBatch.End();

            List <House> ordered = new List <House>();

            for (int i = 0; i < houses.Count; i++)
            {
                houses[i].PrepareExtrudedPolygons();

                for (int j = 0; j < houses.Count; j++)
                {
                    if (j == i)
                    {
                        continue;
                    }
                    if (houses[i].AnyCastedPoly((poly, i) => houses[j].Mask.ColMask(poly)))
                    {
                        // collision
                        houses[i].under.Add(houses[j]);
                        houses[j].above.Add(houses[i]);
                    }
                }
            }

            for (int i = 0; i < houses.Count; i++)
            {
                if (!houses[i].rendered && houses[i].under.Count == 0)
                {
                    houses[i].DrawOverlayRecursive(gameTime);
                }
            }

//#if DEBUG
//            for (int i = 0; i < Entities.Count; i++)
//            {
//                Entities[i].DrawOverlay(gameTime);
//            }
//#endif

            G.SpriteBatch.Begin(samplerState: SamplerState.PointClamp, transformMatrix: screenMatrix);

#if DEBUG
            Fonts.bigSpace.Draw("Editor Tool: " + editorTool + "\ncarIndex: " + carIndex, Vector2.One * 16f, Color.Black);
#endif

            gameState.Current?.DrawScreen();

            G.SpriteBatch.End();
        }