private void Awake()
    {
        main = this;

        leavesAtLeafSites    = new Dictionary <Waypoint, List <Leaf> >();
        leavesAtFarmSites    = new Dictionary <Waypoint, List <Leaf> >();
        leavesAtFarmWaypoint = new Dictionary <Leaf, Waypoint>();
        farmSiteCapacities   = new Dictionary <Waypoint, int>();
        leafList             = new List <Leaf>();
        selectedLeaves       = new List <Leaf>();
    }
Exemple #2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemple #3
0
        public SurfaceWindow()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);

            this.ClientSize = Properties.Resources.background.Size;
            PinToBackground();
            renderer = new Renderer(this);

            /* ** Create Scenes ** */

            // Background
            var background = new c.Image(renderer);

            background.SetSource(Properties.Resources.background);

            renderer.AddScene(background);

            // FPS
#if DEBUG
            renderer.AddScene(new c.FPSScene(renderer));
#endif

            // Leaf
            var lm = new LeafManager(renderer);
            lm.Size     = new SharpDX.Size2(this.ClientSize.Width, this.ClientSize.Height);
            lm.Interval = TimeSpan.FromMilliseconds(0);

            /*
             * lm.Sources.AddRange(
             *  new Bitmap[]
             *  {
             *      Properties.Resources.leaf_1,
             *      Properties.Resources.leaf_2,
             *      Properties.Resources.leaf_3,
             *      Properties.Resources.leaf_4,
             *      Properties.Resources.leaf_5
             *  });
             *
             * renderer.AddScene(lm);
             * lm.Begin();
             */
            // Morph
            var f  = new Font("맑은고딕", 128, FontStyle.Bold);
            var mm = new MorphingManager(renderer);
            mm.AddMorphing(
                CharacterFactory.ToBitmap("御坂", f.Clone() as Font),
                CharacterFactory.ToBitmap("美琴", f.Clone() as Font));

            renderer.AddScene(mm);
            mm.Begin();
        }
Exemple #4
0
    public override void _Ready()
    {
        PlayButton = FindNode("PlayButton") as Button;
        PlayButton.Connect("pressed", this, "OnPlayPressed");

        StressFree = FindNode("StressFreeToggle") as CheckButton;

        Leaves = FindNode("LeafManager") as LeafManager;
        Leaves.SkipFirstLevel();
        Leaves.GenerateLeaves();
        Leaves.Connect("LeavesDropped", this, "OnLeavesDropped");
        Leaves.Connect("SkyLeavesDropped", this, "OnSkyLeavesDropped");
    }
Exemple #5
0
    public override void _Ready()
    {
        LeafManager = GetNode <LeafManager>("LeafManager");
        LeafManager.Connect("LeafMoved", this, "OnLeafMoved");
        LeafManager.Connect("LeavesDropped", this, "OnLeavesDropped");
        LeafManager.Connect("SkyLeavesDropped", this, "OnSkyLeavesDropped");

        LeafManager.GenerateLeaves();

        WinCountText      = FindNode("WinCount") as Label;
        WinCountText.Text = WinCount.ToString();

        MoveCountText      = FindNode("MoveCount") as Label;
        MoveCountText.Text = MoveCount.ToString();

        TotalMoveCountText      = FindNode("TotalMoveCount") as Label;
        TotalMoveCountText.Text = TotalMoveCount.ToString();

        TimerText      = FindNode("Timer") as Label;
        TimerText.Text = Timer.ToString("0").ToString();
    }