Пример #1
0
        public static ILayerable Initialize(int HIGH, int LONG)
        {
            layer = new Layer(HIGH, LONG);
            layer.Balls.AddRange(new List<Ball>
            {
                new Ball(new Position(HIGH - 2, 7),"ball1"),
                new Ball(new Position(HIGH - 2, 4),"ball3"),
                new Ball(new Position(HIGH - 2, 9),"ball2" )
            });

            for (int i = 4; i < 6; i++)
            {
                for (int j = 0; j < LONG; j++)
                {
                    layer.Bricks.Add(new Brick(new Position(i, j)));
                }
            }


            layer.Platforms.Add(new Platform(new PlatformElement[] 
            {
                new PlatformElement(new Position(HIGH - 1, LONG/2)),
                new PlatformElement(new Position(HIGH - 1, LONG/2 - 1)),
                new PlatformElement(new Position(HIGH - 1, LONG/2 - 2)),
                new PlatformElement(new Position(HIGH - 1, LONG/2 - 3))
            }));

            return layer;
        }
Пример #2
0
        public static ILayerable Initialize(int HIGH, int LONG)
        {
            layer = new Layer(HIGH, LONG);
            layer.Balls.AddRange(new List<Ball>
            {
                new Ball(new Position(HIGH - 2, 7),"ball1"),
                new Ball(new Position(HIGH - 2, 4),"ball3"),
                new Ball(new Position(HIGH - 2, 9),"ball2" )
            });

            for (int i = 4; i < 6; i++)
            {
                for (int j = 0; j < LONG; j++)
                {
                    layer.Bricks.Add(new Brick(new Position(i, j)));
                }
            }

            layer.Platforms.Add(new Platform(new PlatformElement[]
            {
                new PlatformElement(new Position(HIGH - 1, LONG/2)),
                new PlatformElement(new Position(HIGH - 1, LONG/2 - 1)),
                new PlatformElement(new Position(HIGH - 1, LONG/2 - 2)),
                new PlatformElement(new Position(HIGH - 1, LONG/2 - 3))
            }));

            return layer;
        }
Пример #3
0
 public BallManager(Space space, ILayerable layer)
 {
     this.layer      = layer;
     this.space      = space;
     this.balls      = layer.Balls;
     ballsDirections = new Dictionary <string, Direction>();
     SetInitialDirections();
 }
Пример #4
0
 public Space(int HIGH, int LONG, ILayerable layer)
 {
     this.LONG = LONG;
     this.HIGH = HIGH;
     this.layer = layer;
     space = new AbstractEntity[HIGH, LONG];
     InitializeSpace();
 }
Пример #5
0
 public Space(int HIGH, int LONG, ILayerable layer)
 {
     this.LONG  = LONG;
     this.HIGH  = HIGH;
     this.layer = layer;
     space      = new AbstractEntity[HIGH, LONG];
     InitializeSpace();
 }
Пример #6
0
 public BallManager(Space space, ILayerable layer)
 {
     this.layer = layer;
     this.space = space;
     this.balls = layer.Balls;
     ballsDirections = new Dictionary<string, Direction>();
     SetInitialDirections();
 }
Пример #7
0
        public Model(int HIGH, int LONG)
        {
            this.layer = LayoutInitializer.Initialize(HIGH, LONG);
            this.space = new Space(HIGH, LONG, layer);
            this.ballManager = new BallManager(space, layer);

            ballManager.SendChanges += OnShow;
            SendMove += space.OnSendMove;
        }
Пример #8
0
        internal virtual Playable OnCreateClipPlayableGraph(PlayableGraph graph, GameObject go, IntervalTree<RuntimeElement> tree)
        {
            if (tree == null)
                throw new ArgumentException("IntervalTree argument cannot be null", "tree");

            if (go == null)
                throw new ArgumentException("GameObject argument cannot be null", "go");

            s_BuildData.Clear();
            GatherCompilableTracks(s_BuildData.trackList);

            // nothing to compile
            if (s_BuildData.trackList.Count == 0)
                return Playable.Null;

            // check if layers are supported
            Playable layerMixer = Playable.Null;
            ILayerable layerable = this as ILayerable;
            if (layerable != null)
                layerMixer = layerable.CreateLayerMixer(graph, go, s_BuildData.trackList.Count);

            if (layerMixer.IsValid())
            {
                for (int i = 0; i < s_BuildData.trackList.Count; i++)
                {
                    var mixer = s_BuildData.trackList[i].CompileClips(graph, go, s_BuildData.trackList[i].clips, tree);
                    if (mixer.IsValid())
                    {
                        graph.Connect(mixer, 0, layerMixer, i);
                        layerMixer.SetInputWeight(i, 1.0f);
                    }
                }
                return layerMixer;
            }

            // one track compiles. Add track mixer and clips
            if (s_BuildData.trackList.Count == 1)
                return s_BuildData.trackList[0].CompileClips(graph, go, s_BuildData.trackList[0].clips, tree);

            // no layer mixer provided. merge down all clips.
            for (int i = 0; i < s_BuildData.trackList.Count; i++)
                s_BuildData.clipList.AddRange(s_BuildData.trackList[i].clips);

#if UNITY_EDITOR
            bool applyWarning = false;
            for (int i = 0; i < s_BuildData.trackList.Count; i++)
                applyWarning |= i > 0 && s_BuildData.trackList[i].hasCurves;

            if (applyWarning)
                Debug.LogWarning("A layered track contains animated fields, but no layer mixer has been provided. Animated fields on layers will be ignored. Override CreateLayerMixer in " + s_BuildData.trackList[0].GetType().Name + " and return a valid playable to support animated fields on layered tracks.");
#endif
            // compile all the clips into a single mixer
            return CompileClips(graph, go, s_BuildData.clipList, tree);
        }
Пример #9
0
        private void CreateLayers(SerializationObject serializationObject, Control parent, bool inherited)
        {
            FrameType frameType = serializationObject as FrameType;

            if (frameType != null)
            {
                foreach (FrameTypeLayers layers in frameType.LayersList)
                {
                    foreach (FrameTypeLayersLayer layer in layers.Layer)
                    {
                        foreach (SerializationObject so in layer.Layerables)
                        {
                            ILayerable layerable = CreateControl(so, parent, inherited) as ILayerable;
                            layerable.LayerLevel = layer.level;
                        }
                    }
                }
            }
        }
Пример #10
0
 public SendEventArgs(ILayerable layout)
 {
     this.matrix = new Matrix(layout);
 }
Пример #11
0
 public SendEventArgs(ILayerable layout)
 {
     this.matrix = new Matrix(layout);
 }
Пример #12
0
 public Matrix(ILayerable layout)
 {
     this.layout = layout;
     this.Refresh();
 }
Пример #13
0
 public Matrix(ILayerable layout)
 {
     this.layout = layout;
     this.Refresh();
 }