Example #1
0
    private void Start()
    {
        playerMovement = GetComponent <DMovement>();
        rigid          = GetComponent <Rigidbody2D>();
        camera         = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <DCamera>();

        GameObject joystickObj = GameObject.FindGameObjectWithTag("Joystick");

        joystick      = joystickObj.GetComponent <Joystick>();
        camera.target = this.gameObject;
    }
Example #2
0
    private void Start()
    {
        playerMovement = GetComponent <DMovement>();
        rigid          = GetComponent <Rigidbody2D>();

        if (isActiveAndEnabled && isLocalPlayer)
        {
            GameObject joystickObj = GameObject.FindGameObjectWithTag("Joystick");
            joystick           = joystickObj.GetComponent <Joystick>();
            transform.position = DGameSystem.mapGenerator.PLAYER_START_PÓSITION;
            DGameSystem.cameraMain.GetComponent <DCamera>().target = this.gameObject;
            DGameSystem.RegistPlayer(this.gameObject);
        }
    }
 private void Start()
 {
     movement = GetComponent <DMovement>();
 }