Exemplo n.º 1
0
        public void DraggerUpdate()
        {
            if (!dragging)
            {
                return;
            }
            List <IntVec3> list = DragCells;

            SelDes.RenderHighlight(list);
            if (list.Count != lastFrameDragCellsDrawn)
            {
                lastDragRealTime        = Time.realtimeSinceStartup;
                lastFrameDragCellsDrawn = list.Count;
                if (SelDes.soundDragChanged != null)
                {
                    SelDes.soundDragChanged.PlayOneShotOnCamera();
                }
            }
            if (sustainer == null || sustainer.Ended)
            {
                if (SelDes.soundDragSustain != null)
                {
                    sustainer = SelDes.soundDragSustain.TrySpawnSustainer(SoundInfo.OnCamera(MaintenanceType.PerFrame));
                }
            }
            else
            {
                sustainer.externalParams["TimeSinceDrag"] = Time.realtimeSinceStartup - lastDragRealTime;
                sustainer.Maintain();
            }
        }
Exemplo n.º 2
0
        private void TryAddDragCell(IntVec3 c)
        {
            AcceptanceReport acceptanceReport = SelDes.CanDesignateCell(c);

            if (acceptanceReport.Accepted)
            {
                dragCells.Add(c);
            }
            else if (!acceptanceReport.Reason.NullOrEmpty())
            {
                failureReasonInt = acceptanceReport.Reason;
            }
        }