GithubHelp home page GithubHelp logo

unity-plugin-2's Introduction

Legacy TUNE Unity Plugin v7.2.0

Get the Branch Unity SDK here!

The TUNE plugin for Unity provides application session and event logging functionality via the TUNE native SDKs.

  • TUNE Android SDK 6.1.2
  • TUNE iOS SDK 6.2.0

This plugin was built and tested with Unity version 2018.2.11f1 LTS.

Dependencies

Unity 2018+

Google Unity Jar Resolver. This plugin handles Android and iOS dependency management for the TUNE plugin.

For iOS builds:

For Android builds:

  • Android Studio

Install Tune Unity Plugin

Download Tune.unitypackage from the releases section.

While your Unity project is open, double click the unitypackage. It should install. Otherwise, you can import it via the menu, Assets -> Import Package -> Custom Package.

Import Tune plugin

Create a new Tune script and attach it to an object.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TuneSDK;

public class TuneScript : MonoBehaviour {

    private void Awake()
    {
    	// verbose debug messages
        //Tune.SetDebugMode(true);
        
        Tune.Init("your_advertiser_id", "your_conversion_key");
        Tune.MeasureSession();
    }

    private void OnApplicationPause(bool pause)
    {
        if (!pause) {
            Tune.MeasureSession();
        }
    }

    // Use this for initialization
    void Start () {
        
    }
    
    // Update is called once per frame
    void Update () {
        
    }
}

Sample script in an example project:

Sample script in Assets

Sample script attached to an object:

Sample script attached to an Object

Build and export project

Switch platform to Android or iOS. Go into Player Settings and change the default Android package name or iOS bundle identifier to something other than com.Company.ProductName.

Sample Android build settings:

Sample build for Android

Sample Android package name change:

Sample change package name

For Android, Unity will export an apk file.

For iOS, Unity will export a folder with all the project files.

Running Android

From a terminal, use adb install to install the apk file to a device.

adb documentation

If you enabled debug, you can see Tune calls in the logs by using adb logcat.

Running iOS

Find and open the Unity-iPhone.xcworkspace file.

In the Unity-iPhone target, set the Apple developer to your developer account.

Set Apple developer

Debug on a device. Unity projects do not support simulator.

Using the bundled Sample App

Open /sample/Assets/Tune/Scenes/TUNESampleScene.unity in Unity.

Build and export as you would your own project. The TUNE sample app displays a menu that uses the TUNE Unity plugin's various functionalities. To see samples of how to use the plugin in your own code, see our sample script.

unity-plugin-2's People

Contributors

antonargunov avatar echo-branch avatar hasjohnb avatar hasronald avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.