Exemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        Debug.Log("Entered: " + other);

        if (other.tag == "Pole")
        {
            currentPole = other.transform.root.GetChild(0).GetComponent <PoleController>();
            currentPole.AddHoop(this);
            onPole = true;
        }
    }
Exemplo n.º 2
0
    private void OnTriggerExit(Collider other)
    {
        Debug.Log("Left: " + other);

        if (other.tag == "Pole")
        {
            currentPole.RemoveHoop(this);
            currentPole = null;
            onPole      = false;
        }
    }
Exemplo n.º 3
0
    private void onLevelCompleteHandler(PoleController pole)
    {
        Poles.Remove(pole);
        //Move
        Debug.Log("Boss Killed");

        if (Poles.Count > 0)
        {
            StartCoroutine(MovePlayer());
        }
        else
        {
            //LevelDone
            Debug.Log("Level Bitti");
            UIController.ShowHideFinishUI();
        }
    }
Exemplo n.º 4
0
 /*
  * 一定時間毎に自動で実行される。
  * 物理演算は当メソッドで実行する。
  */
 void FixedUpdate()
 {
     // 1秒間ごとにリング投射。インデックスの分投げ切った後、4秒休止。
     this.delta_time += Time.deltaTime;
     if (this.interval_time <= this.delta_time)
     {
         // デルタタイムを初期化する。
         this.delta_time = 0.0f;
         // リングを投射する。
         throw_ring();
         // 投射対象ポールインデックスを更新する。
         update_target_index();
         // ポールを動かす
         PoleController ctrl = this.pole[this.target_pole_index].GetComponent <PoleController>();
         if (ctrl != null)
         {
             ctrl.move();
         }
     }
 }