コード例 #1
0
        private static WireController[] Generate(Level level, PuzzleState cc, GameController controller, GameObject wirePrefab, GameObject[] coins, GameObject[] solCoins)
        {
            var wires = new WireController[level.NumCoins];

            for (int i = 0; i < level.NumCoins; i++)
            {
                int targetCoin = level.solved.FirstIndexForColor(controller.Current.ColorIndex(i));

                var wire     = (GameObject)Instantiate(controller.wirePrefab);
                var wcontrol = wire.GetComponent <WireController>() as WireController;
                if (controller != null)
                {
                    wcontrol.Attach(controller, coins[i], solCoins[targetCoin]);
                }
                wires[i] = wcontrol;
            }
            return(wires);
        }
コード例 #2
0
ファイル: GameController.cs プロジェクト: seuribe/flip
 private void BuildWires()
 {
     DestroyWires();
     wires = WireController.Generate(this, coins, solutionCoins);
 }