コード例 #1
0
ファイル: PlayerController.cs プロジェクト: tocchan/unitydemo
    //-----------------------------------------------------------------------------
    void Start()
    {
        // Don't search for a rigid body every frame - that search takes time
          // you don't actually need to do.
          rb = GetComponent<Rigidbody2D>();

          if (emitterController == null) {
         emitterController = GetComponentInChildren<ChangeEmissionByVelocity>();
          }

          if (null == fireTrigger) {
         fireTrigger = GetComponent<FireTrigger>();
          }
    }
コード例 #2
0
ファイル: PlayerController.cs プロジェクト: tocchan/unitydemo
    //-----------------------------------------------------------------------------
    void Start()
    {
        // Don't search for a rigid body every frame - that search takes time
        // you don't actually need to do.
        rb = GetComponent <Rigidbody2D>();

        if (emitterController == null)
        {
            emitterController = GetComponentInChildren <ChangeEmissionByVelocity>();
        }


        if (null == fireTrigger)
        {
            fireTrigger = GetComponent <FireTrigger>();
        }
    }