Exemplo n.º 1
0
        private void UpdatePlaine()
        {
            AirPlaneData planeData = SingletonManager.Get <FreeUiManager>().Contexts1.ui.map.PlaneData;

            if (planeData == null)
            {
                planeData = new AirPlaneData(1, new MapFixedVector3(0, 0, 0), 0);
                SingletonManager.Get <FreeUiManager>().Contexts1.ui.map.PlaneData = planeData;
            }


            FreeRenderObject plane = SingletonManager.Get <FreeEffectManager>().GetEffect("plane");

            if (plane == null)
            {
                plane = SingletonManager.Get <FreeEffectManager>().GetEffect("plane1");
                if (plane != null)
                {
                    planeData.Type = 1;
//                        planeData.Pos = new Vector2(plane.model3D.x - leftMinPos.x, plane.model3D.z - leftMinPos.z);
                    var worldPos = WorldOrigin.WorldPosition(new Vector3(plane.model3D.x, plane.model3D.y, plane.model3D.z));
                    planeData.Pos       = new MapFixedVector3(worldPos);
                    planeData.Direction = -plane.GetEffect(0).EffectModel3D.model3D.rotationY;
                }
            }
            else
            {
                planeData.Type = 2;
//                    planeData.Pos = new Vector2(plane.model3D.x - leftMinPos.x, plane.model3D.z - leftMinPos.z);
                var worldPos = WorldOrigin.WorldPosition(new Vector3(plane.model3D.x, plane.model3D.y, plane.model3D.z));
                planeData.Pos       = new MapFixedVector3(worldPos);
                planeData.Direction = -plane.GetEffect(0).EffectModel3D.model3D.rotationY;
            }

            if (plane == null)
            {
                planeData.Type      = 0;
                planeData.Pos       = new MapFixedVector3(0, 0, 0);
                planeData.Direction = 0;
            }
        }
Exemplo n.º 2
0
        public List <MapFixedVector2> KongTouList()
        {
            int planeId = 0;

            kongTouList.Clear();

            FreeRenderObject plane = SingletonManager.Get <FreeEffectManager>().GetEffect("plane1");

            if (plane != null)
            {
                IAutoValue id = plane.GetAuto("id");
                if (id != null && id is AutoConstValue)
                {
                    planeId = int.Parse(((AutoConstValue)id).GetValue());

                    foreach (FreeRenderObject drop in SingletonManager.Get <FreeEffectManager>().FreeEffects.Values)
                    {
                        if (drop.key.StartsWith("dropBox"))
                        {
                            IAutoValue dropBoxId = drop.GetAuto("id");
                            if (dropBoxId != null && dropBoxId is AutoConstValue)
                            {
                                int realId = int.Parse(((AutoConstValue)dropBoxId).GetValue());
                                if (realId == planeId)
                                {
                                    kongTouList.Add(new MapFixedVector2(WorldOrigin.WorldPosition(new Vector3(drop.model3D.x, drop.model3D.y, drop.model3D.z)).To2D()));
                                }
                                //                        Debug.LogFormat("********************************** planeId:{0} dropId:{1}", planeId, realId);
                            }
                        }
                    }
                }
            }

            return(kongTouList);
        }