コード例 #1
0
ファイル: Jogador.cs プロジェクト: vithort/unity-nave-2d
 // Start is called before the first frame update
 void Start()
 {
     animator    = GetComponent <Animator>();
     controle    = 0f;
     eixoXMax    = CameraPrincipal.LimitarDireitaX(transform.position);
     eixoXMin    = CameraPrincipal.LimitarEsquerdaX(transform.position);
     eixoYMax    = CameraPrincipal.LimitarParaCimaY(transform.position);
     eixoYMin    = CameraPrincipal.LimitarParaBaixoY(transform.position);
     rb2d        = GetComponent <Rigidbody2D>();
     audioSource = GetComponent <AudioSource>();
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        //bomba
        controle = 0f;

        //obrer CameraPrincipal
        eixoXMax = CameraPrincipal.LimitarDireitaX(transform.position);
        eixoXMin = CameraPrincipal.LimitarEsquerdaX(transform.position);
        eixoYMax = CameraPrincipal.LimitarParaCimaY(transform.position);
        eixoYMin = CameraPrincipal.LimitarParaBaixoY(transform.position);

        //Player
        rb2d = GetComponent <Rigidbody2D>();
        //audio
        audioSource = GetComponent <AudioSource>();
    }