Пример #1
0
    // Use this for initialization
    void Start()
    {
        // 一球分のプレイ履歴を記録する
        Trace = new List <MyTrace>();

        // RacketController, PlayerControllerを取得
        racketController     = Racket.GetComponent <RacketController>();
        playerController     = Player.GetComponent <PlayerController>();
        scoreBoardController = ScoreBoard.GetComponent <ScoreBoardController>();

        // まずは初めのトレーニングセットから始める
        currentTrainingIndex = 0;

        // DATAはPLAYDATA/の配下に日付ごとにディレクトリを作成する。
        // 起動時にしかディレクトリを制御しないため、アプリ起動中に日付が変わっても同じディレクトリ使われる。

        // /PLAYDATA ディレクトリがなければ作成
        if (!Directory.Exists("PLAYDATA"))
        {
            Directory.CreateDirectory("PLAYDATA");
        }

        // 日付から作った ディレクトリ(例: PLAYDATA/20181019/ がなければ作成
        directoryName = System.DateTime.Now.ToString("PLAYDATA/yyyyMMdd");
        if (!Directory.Exists(directoryName))
        {
            Directory.CreateDirectory(directoryName);
        }

        // 初期状態である Servedへ移行
        StartServe();
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     rb        = GetComponent <Rigidbody2D>();
     shootable = true;
     player    = FindObjectOfType <RacketController>();
     lM        = FindObjectOfType <LivesManager>();
 }
Пример #3
0
    private void Awake()
    {
        rb = this.GetComponent <Rigidbody>();
        respawnLocation = transform.position;

        fakeConsole = GameObject.Find("FakeConsole").GetComponent <Text>();
        racket      = GameObject.Find("PlayerRacket").GetComponent <RacketController>();
    }
Пример #4
0
 public void SetUpRacket()
 {
     iRacket          = Substitute.For <IRacket>();
     racketController = new RacketController();
     racketController.SetIRacket(iRacket);
     racketController.SetLocalDeltaTime(1f);
     racketController.SetRacketVelocity(1f);
     racketController.SetRacketLimit(10);
 }
Пример #5
0
    public override void Activate()
    {
        GameObject player = GameObject.FindGameObjectWithTag(playerTag);

        if (player == null)
        {
            return;
        }

        RacketController racketController = player.GetComponent <RacketController>();

        if (racketController == null)
        {
            return;
        }

        racketController.ScaleHorizontally(scaleFactor);
    }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType <RacketController>();
 }
Пример #7
0
    //--------------------------------

    void Start()
    {
        racketController = new RacketController();
        racketController.SetIRacket(this);
        SetPosition(transform.position);
    }