Ejemplo n.º 1
0
 protected override void InitUIRefrence()
 {
     _loopList       = Transform.FindTransfrom("Content/Context/Scroll View").SafeGetComponent <LoopList>();
     noInfoTrans     = Transform.FindTransfrom("Content/EmptyInfo");
     noInfoAnim      = noInfoTrans.SafeGetComponent <Animation>();
     tabContentTrans = Transform.FindTransfrom("Content/TabContent");
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     _image    = null;
     _addImage = null;
     _transformList.Clear();
     LoopList.Clear();
     _blendDurationQueue.Clear();
 }
Ejemplo n.º 3
0
 private void InitRef()
 {
     _formulaName        = UIUtility.SafeGetComponent <Text>(UIUtility.FindTransfrom(m_dialog.ManuContent, "Name"));
     _timeText           = UIUtility.SafeGetComponent <Text>(UIUtility.FindTransfrom(m_dialog.ManuContent, "Time"));
     _formulaContentCmpt = UIUtility.SafeGetComponent <FormulaContentCmpt>(UIUtility.FindTransfrom(m_dialog.ManuContent, "FormulaContent"));
     _desc      = UIUtility.SafeGetComponent <Text>(UIUtility.FindTransfrom(m_dialog.ManuContent, "Desc"));
     _loopList  = UIUtility.SafeGetComponent <LoopList>(m_dialog.ScrollViewTrans);
     typeWriter = UIUtility.SafeGetComponent <TypeWriterEffect>(_desc.transform);
 }
Ejemplo n.º 4
0
        public Loop StartLoop(int startTime, int loopCount)
        {
            if (_isLooping || _isTriggering)
            {
                throw new Exception("You can not start another loop when the previous one isn't end.");
            }

            _isLooping = true;
            var loop = new Loop(startTime, loopCount);

            LoopList.Add(loop);
            return(loop);
        }
Ejemplo n.º 5
0
        public override void Start()
        {
            _game.Color = Color.FromDraw(System.Drawing.Color.FromArgb(42, 42, 42));
            _selectKey  = Key.Return;

            var btnStart   = new ButtonEntity(_game.HalfWidth, _game.HalfHeight, null, null, "Start");
            var btnOptions = new ButtonEntity(_game.HalfWidth, _game.HalfHeight, null, null, "Options");
            var btnQuit    = new ButtonEntity(_game.HalfWidth, _game.HalfHeight + 100, null, null, "Quit");

            btnStart.ClickHandler.MouseClick += button => SceneManager.LoadScene("SceneOne");

            btnQuit.ClickHandler.MouseClick += button => _game.Close();

            _selectables = new LoopList <ButtonEntity>(new List <ButtonEntity> {
                btnStart, btnOptions, btnQuit
            });

            AddMultiple(btnStart, btnQuit);
        }
Ejemplo n.º 6
0
        internal static void GenerateSurfaceRenderBuffers(int brushNodeID, LoopList loopList)
        {
            var output        = CSGManager.GetBrushOutput(brushNodeID);
            var brushInstance = CSGManager.GetBrushMeshID(brushNodeID);
            var mesh          = BrushMeshManager.GetBrushMesh(brushInstance);
            var meshPolygons  = mesh.polygons;
            var meshSurfaces  = mesh.surfaces;

            Matrix4x4 worldToLocal = Matrix4x4.identity;

            CSGManager.GetTreeToNodeSpaceMatrix(brushNodeID, out worldToLocal);

            var outputSurfaces     = new CSGSurfaceRenderBuffer[loopList.loops.Count]; // TODO: should be same size as brush.surfaces.Length
            int outputSurfaceCount = 0;

            foreach (var loop in loopList.loops)
            {
                var polygonIndex = loop.basePlaneIndex;       // TODO: fix this
                var meshPolygon  = meshPolygons[polygonIndex];

                var surfaceIndex = meshPolygon.surfaceID;       // TODO: fix this

                var localSpaceToPlaneSpace = MathExtensions.GenerateLocalToPlaneSpaceMatrix(meshSurfaces[surfaceIndex].plane);
                var uv0Matrix = meshPolygon.description.UV0.ToMatrix() * (localSpaceToPlaneSpace * worldToLocal);

                // TODO: all separate loops on same surface should be put in same OutputSurfaceMesh
                if (!loop.Triangulate(uv0Matrix, ref outputSurfaces[outputSurfaceCount]))
                {
                    continue;
                }

                // TODO: make this work
//				outputSurfaces[outputSurfaceCount].meshQuery		= loop.layers; //???
//				outputSurfaces[outputSurfaceCount].surfaceParameter = loop.surfaceParameter; //???
                outputSurfaces[outputSurfaceCount].surfaceIndex = surfaceIndex;
                outputSurfaceCount++;
            }
            if (outputSurfaceCount != loopList.loops.Count)
            {
                Array.Resize(ref outputSurfaces, outputSurfaceCount);
            }
            output.renderBuffers.surfaceRenderBuffers.AddRange(outputSurfaces);
        }
Ejemplo n.º 7
0
    void InitPrefabList <T>(int needYCount) where T : ItemCell, new()
    {
        List <List <ItemCell> > prefabsList = new List <List <ItemCell> >();

        //实例化循环的item
        for (int i = 0; i < needYCount; i++)
        {
            List <ItemCell> list = new List <ItemCell>();
            if (colCount > 1)
            {
                for (int j = 0; j < colCount; j++)
                {
                    GameObject gob = Instantiate(prefab.gameObject, gridRect.transform) as GameObject;
                    T          t   = new T();
                    t.Init(gob);
                    t.rectTransform.anchoredPosition = new Vector2((j - 1) * itemWidth, -itemHeight / 2 - i * itemHeight);
                    t.updateItem(i * colCount + j);
                    list.Add(t as ItemCell);
                }
            }
            else
            {
                for (int j = 0; j < colCount; j++)
                {
                    GameObject gob = Instantiate(prefab.gameObject, gridRect.transform) as GameObject;
                    T          t   = new T();
                    t.Init(gob);
                    t.rectTransform.anchoredPosition = new Vector2(0, -itemHeight / 2 - i * itemHeight);
                    t.updateItem(i * colCount + j);
                    list.Add(t as ItemCell);
                }
            }
            prefabsList.Add(list);//折扣
        }
        botomIndex          = needYCount - 1;
        this.loopPrefabList = new LoopList(prefabsList);
        this.prefab.gameObject.SetActive(false);
    }
Ejemplo n.º 8
0
        public void Reset()
        {
            // Setup data
            _lifelets = new LoopList<Lifelet>();
            _messages = new LoopList<Message>();
            _food = new LoopList<Food>();

            // Create the initial lifelets...
            spawnInitialLifelets();
        }
Ejemplo n.º 9
0
        // TODO: not really CSG yet .. just a hack
        // TODO: move somewhere else
        internal static LoopList PerformCSG(int brushNodeID, bool mode)
        {
            var brushNodeIndex = brushNodeID - 1;
            var output         = CSGManager.GetBrushOutput(brushNodeID);
            var outputLoops    = output.brushOutputLoops;
            var brushInstance  = CSGManager.GetBrushMeshID(brushNodeID);
            var surfaceLoops   = (outputLoops.intersectionLoops == null || outputLoops.intersectionLoops.Count == 0) ? null : outputLoops.intersectionLoops.Values.First();  // temp. Hack

            // TODO: get rid of needing mesh here
            var mesh         = BrushMeshManager.GetBrushMesh(brushInstance);
            var meshPolygons = mesh.polygons;
            var meshSurfaces = mesh.surfaces;


            var loopList = new LoopList(); // TODO: get rid of this somehow

            // TODO: separate base loops with holes
            //          need a seperate set of holes per intersecting brush
            for (int p = 0; p < meshPolygons.Length; p++)
            {
                // TODO: get rid of needing mesh here
                var meshPolygon  = meshPolygons[p];
                var surfaceIndex = meshPolygon.surfaceID;


                // Add all holes that share the same plane to the polygon
                var holeLoops = (surfaceLoops == null) ? (List <Loop>)null : surfaceLoops.surfaces[surfaceIndex];
                // Add all holes that share the same plane to the polygon
                if (mode)
                {
                    var loop = outputLoops.basePolygons[p]; // TODO: need to copy this
                    loopList.loops.Add(loop);
                    if (holeLoops != null)
                    {
                        for (int l = holeLoops.Count - 1; l >= 0; l--)
                        {
                            //if (holeLoops[l].basePlaneIndex != loop.basePlaneIndex)
                            //	continue;

                            // Cut polygons with its holes if they overlap
                            if (loopList.RemoveFrom(loop, holeLoops[l]))
                            {
                                holeLoops.RemoveAt(l);
                                //	lookHierarchies.Add(holeLoops[l]);
                                continue;
                            }
                            //loop.holes.Add(holeLoops[l]);
                        }
                        loop.holes.AddRange(holeLoops);
                    }
                }
                else
                {
                    if (holeLoops != null)
                    {
                        foreach (var hole in holeLoops)
                        {
                            hole.interiorCategory = Category.ReverseAligned;
                            loopList.loops.Add(hole);
                        }
                    }
                }
            }
            return(loopList);
        }
 public SequenceCondition(IEnumerable <EventTrigger> triggers)
 {
     _triggers       = new LoopList <EventTrigger>(triggers);
     _currentTrigger = _triggers.Next();
     _currentTrigger.ConditionsMet += OnConditionsMet;
 }
			public SequenceCondition( IEnumerable<EventTrigger> triggers )
			{
				_triggers = new LoopList<EventTrigger>( triggers );
				_currentTrigger = _triggers.Next();
				_currentTrigger.ConditionsMet += OnConditionsMet;
			}