コード例 #1
0
    //プレイヤー設置
    private static void SummonPlayer(int key)
    {
        playerPosition = new Vector2(2, 1);
        int[] size = ReadWrite.CalcField();
        int   id   = 0;

        for (int i = 0; i < size[0]; i++)
        {
            for (int j = 0; j < size[1]; j++)
            {
                int point = ReadWrite.PointPanel(i, j);
                if (point == 4)
                {
                    playerPosition = new Vector2(i, j);
                    break;
                }
            }
        }
        Vector3 vec = Parameter.Calc3DFloorToVec3(playerPosition);

        player = (GameObject)Instantiate(prePlayer, vec, Quaternion.identity);
        player.transform.localScale = Parameter.localMagnification;
        player.name     = "Player";
        playerParameter = ReadWrite.GetPlayerParameter(key);
        playerStatus    = MakeStatus(playerParameter);
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     floor     = Resources.Load("Prefub/Panel");
     tree      = Resources.Load("Prefub/Tree");
     fieldSize = ReadWrite.CalcField();
     SetPanel();
 }
コード例 #3
0
 //エネミー初期セット
 private static void SetEnemyParameters()
 {
     enemyPositionList  = new List <Vector2>();
     enemyParameterList = new List <int[]>();
     enemyStatusList    = new List <int[]>();
     int[] size = ReadWrite.CalcField();
     for (int i = 0; i < size[0]; i++)
     {
         for (int j = 0; j < size[1]; j++)
         {
             int point = ReadWrite.PointPanel(i, j);
             if (point >= 5)
             {
                 AddEnemy(point - 5, i, j, false);
             }
         }
     }
 }