Skip to content

Instantly share code, notes, and snippets.

static void PerformBuild ()
{
Console.WriteLine (":: Performing build");
var buildTarget = GetBuildTarget ();
var buildPath = GetBuildPath ();
var buildName = GetBuildName ();
var fixedBuildPath = GetFixedBuildPath (buildTarget, buildPath, buildName);
Console.WriteLine("Fixed build path:" + fixedBuildPath);
var buildInfo = BuildPipeline.BuildPlayer (GetEnabledScenes (), fixedBuildPath, buildTarget, GetBuildOptions ());
if( buildInfo.summary.result == BuildResult.Succeeded ) {
#!/usr/bin/env bash
set -e
set -x
mkdir -p /root/.cache/unity3d
mkdir -p /root/.local/share/unity3d/Unity/
set +x
echo 'Writing $UNITY_LICENSE_CONTENT to license file /root/.local/share/unity3d/Unity/Unity_lic.ulf'
echo "$UNITY_LICENSE_CONTENT" | base64 --decode | tr -d '\r' > /root/.local/share/unity3d/Unity/Unity_lic.ulf
#!/usr/bin/env bash
set -e
set -x
echo "Building for $BUILD_TARGET"
export BUILD_PATH=./Builds/$BUILD_TARGET/
mkdir -p $BUILD_PATH
#!/usr/bin/env bash
set -e
docker run \
-e BUILD_NAME \
-e UNITY_LICENSE_CONTENT \
-e BUILD_TARGET \
-e UNITY_USERNAME \
-e UNITY_PASSWORD \
version: 2.1
executors:
unity_exec:
docker:
- image: gableroux/unity3d:2018.4.5f1-android
environment:
BUILD_NAME: my_build_name
.build: &build
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
namespace Tests
{
public class AssetSpawnerTest
{
[UnityTest]
public IEnumerator Should_InstantiateObject_When_GivenStringHasNameAndPosition()
using System.Collections;
using NUnit.Framework;
using TDDForUnity;
using UnityEngine;
using UnityEngine.TestTools;
namespace Tests
{
public class AssetSpawnerTest
{
[UnityTest]
public class AssetSpawner
{
public void createAGameObject()
{
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.name = "CubeOne";
}
}
public class AssetSpawner
{
public void createAGameObjectFromString(String csvString)
{
String[] tokens = csvString.Split(",".ToCharArray());
if (tokens.Length >= 4)
{
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.name = tokens[0];
}
public class AssetSpawnerTest
{
[UnityTest]
public IEnumerator Should_InstantiateObject_When_GivenStringHasNameAndPosition()
{
//given
String csvString = "CubeX,2,3,3";
String expectedName = "CubeX";
//when
AssetSpawner assetSpawner = new AssetSpawner();