Now We just run the test using Menu in Unity3D.

사용자 삽입 이미지

If you didn't get any error, Push your code any VCS (This Article based P4V)

I. Basic Information : your mind
II. Source Code Management
사용자 삽입 이미지
1. Add Perforce Credentials
2. Select node type (We use the Streams)
3. Select Stream codeline (Path)
4. Type Workspace name format 
5. (Important) populate is just Sync only
   - Check Force sync / Populate have list / Quiet perforce messageIII. 
6. input "Perforce Depot path" in Polling build filters.

III. Build Triggers 
사용자 삽입 이미지

1. Build periodically: H 07 * * 1-5 (by 7 am on every Mon~Fri)

IV. Build : Unity
사용자 삽입 이미지
1. Select Unity version and commandline : -quit -batchmode -projectPath ${WORKSPACE}/Prototype/SCM  -executeMethod ProjectBuilder.PerformiOSBuild

V. Build: XCODE (General)
사용자 삽입 이미지
* Important: Output directory

VI. Build: XCODE Code signing
사용자 삽입 이미지

VII. Build : Advanced Xcode
사용자 삽입 이미지

 
VIII. Build Execute shell

사용자 삽입 이미지

rm -rf ${WORKSPACE}/Prototype/SCM/$(date +'%m%d%y')_build
mkdir ${WORKSPACE}/Prototype/SCM/$(date +'%m%d%y')_build
cp ${WORKSPACE}/Prototype/SCM/*.ipa ${WORKSPACE}/Prototype/SCM/$(date +'%m%d%y')_build/$(date +'%m%d%y%H%M').ipa
cp -rf ${WORKSPACE}/Prototype/SCM/$(date +'%m%d%y')_build /Volumes/CorgiMobile/
rm -rf ${WORKSPACE}/Prototype/SCM/$(date +'%m%d%y')_build

Done Jenkins setup!

Now, Build your source code on Jenkins.

If you see the Xcode Error, Please open Xcode and open the built code from Unity.
You could fix your problem on XCODE. (Before testing on Xcode, Should click the "Clean")

If you get the success on XCODE. Please save the project and try to build on Jenkins.

* Don't remove or update the project files.

Cheers!

2018/05/23 08:38 2018/05/23 08:38
No more support to set up the focus mode on Vuforia 7 directly.

However, If you add this code to your AR camera, you could change that by your mind.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;

public class CameraFocusController : MonoBehaviour {

bool mVuforiaStarted = false;

// Use this for initialization
void Start () {
VuforiaARController vuforia = VuforiaARController.Instance;
if (vuforia != null) vuforia.RegisterVuforiaStartedCallback(StartAfterVuforia);
}
 
void StartAfterVuforia() {
mVuforiaStarted = true;
SetAutofocus();
}

void SetAutofocus() {
CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO);
}

void OnApplicationPause(bool pauseStatus)
{
if (!pauseStatus) SetAutofocus();
}
}



2018/05/15 03:43 2018/05/15 03:43
Create "Editor" folder on "Asset" folder first.
and make a "ProjectBuilder.cs" file in "Editor" folder.

* This script tested on Unity 2018

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;

class ProjectBuilder {
    static string[] SCENES = FindEnabledEditorScenes();
    static string APP_NAME = "Your Project name";
    static string TARGET_DIR = "build";

    [MenuItem ("ForYou/CI/Build IOS")]
    staticvoidPerformiOSBuild ()
    {
        BuildOptions opt = BuildOptions.AcceptExternalModificationsToPlayer;
                    /*
                     BuildOptions.SymlinkLibraries |
                     BuildOptions.Development |
                     BuildOptions.ConnectWithProfiler |
                     BuildOptions.AllowDebugging |
                     BuildOptions.Development; 
                     */
 
        //PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK; 
        //PlayerSettings.iOS.targetOSVersionString = "11.0";
        //PlayerSettings.statusBarHidden = true;
        //PlayerSettings.iOS.cameraUsageDescription = "ARMode";
 
         PlayerSettings.SetScriptingBackend(BuildTargetGroup.iOS, ScriptingImplementation.IL2CPP);
         char sep = Path.DirectorySeparatorChar;
         string buildDirectory = Path.GetFullPath(".") + sep + TARGET_DIR;
         Directory.CreateDirectory(buildDirectory);
 
         string BUILD_TARGET_PATH = buildDirectory + "/ios";
         Directory.CreateDirectory(BUILD_TARGET_PATH);
 
         GenericBuild(SCENES, BUILD_TARGET_PATH, BuildTargetGroup.iOS, BuildTarget.iOS, opt);
    }

    [MenuItem ("ForYou/CI/Build Android")]
    staticvoidPerformAndroidBuild ()
    {
        string target_filename = APP_NAME + ".apk";
        GenericBuild(SCENES, target_filename, BuildTargetGroup.Android, BuildTarget.Android ,BuildOptions.None);
    }
    
    [MenuItem ("ForYou/CI/Build Window")]
    static void PerformWindowsBuild () {
        string target_filename = APP_NAME + ".exe";
        GenericBuild(SCENES, target_filename, BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows, BuildOptions.None);
    }

    [MenuItem ("ForYou/CI/Build Mac")]
    static void PerformMacBuild () {
        string target_filename = APP_NAME + ".app";
        GenericBuild(SCENES, target_filename, BuildTargetGroup.Standalone, BuildTarget.StandaloneOSX, BuildOptions.None);
    }

   private static string[] FindEnabledEditorScenes() {
      List<string> EditorScenes = new List<string>();
      foreach(EditorBuildSettingsScene scene in EditorBuildSettings.scenes) {
         if (!scene.enabled) continue;
         EditorScenes.Add(scene.path);
      }
      return EditorScenes.ToArray();
   }

    static void GenericBuild(string[] scenes, string target_filename, BuildTargetGroup build_group, BuildTarget build_target, BuildOptions build_options)
    {
        EditorUserBuildSettings.SwitchActiveBuildTarget(build_group, build_target);
        UnityEditor.Build.Reporting.BuildReport res = BuildPipeline.BuildPlayer(scenes, target_filename, build_target, build_options);
    }
}


You could copy & paste it. and Test it on Unity3d Editor.

Next time, Continue.



2018/04/24 08:22 2018/04/24 08:22
If you use the uGUI for making mobile UI Event, perhaps, Your code like below code.

* button script (Example): Mobile has just 3 events. Pressed, Exit from a button (Cancel), Deattached from a button (OK).

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class CommonButton : MonoBehaviour, IPointerDownHandler, IPointerExitHandler, IPointerClickHandler {

GameObject selectedObject;
 
//Process for Selected button
public void OnPointerDown(PointerEventData eventData) {
selectedObject = gameObject;
//Blah blah... something
}

//Process for cancel button
public void OnPointerExit(PointerEventData eventData) {
selectedObject = null;
//Blah blah... something
}

//Process for OK button
public void OnPointerClick(PointerEventData eventData) {
if (selectedObject != gameObject) return;
selectedObject = null;
//Blah blah... something
}
}


Normally, We attach this code @ each button object.
It is terrible for maintenance.

If someone wants to change some behavior, We should change all.

however, we could solve this problem by simple Inheritance.

1. Make a parents class for sharing.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class CommonButton : MonoBehaviour, IPointerDownHandler, IPointerExitHandler, IPointerClickHandler {

 GameObject selectedObject;

 public void OnPointerDown(PointerEventData eventData) {
 selectedObject = gameObject;
 PressedButton();
 }

 public void OnPointerExit(PointerEventData eventData) {
 selectedObject = null;
 CancelButton();
 }

 public void OnPointerClick(PointerEventData eventData) {
 if (selectedObject != gameObject) return;
 selectedObject = null;
 OKButton();
 }

 public virtual void PressedButton() { } //Virtual method is key point
 public virtual void CancelButton() { }
 public virtual void OKButton() { }
}


2. Make a child class for attaching to each button.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BehaviourRadioMenus : CommonButton {

 override public void PressedButton() {
 RevealDesc();
 }

 override public void CancelButton() {
 HideDesc();
 }

 override public void OKButton() {
 HideDesc();
 }

 void RevealDesc() {
 }

 void HideDesc() {
 }
}


Cheers!
2018/03/04 06:27 2018/03/04 06:27
I modified iTween for working  Fade/Color to the uGUI elements such as Text, Image, Textmesh.
and It will work Action<T> Lambda method.

iTween.ValueTo(gameObject, iTween.Hash(
    "from", 1f,
    "to", 0f,
    "time", 1f,
    "onupdate", (System.Action<object>)(x => { missedInfo.color = new Color(1f, 0f, 0f, (float)x); }),
    "oncomplete", (System.Action<object>)(x => missedInfo.gameObject.SetActive(true))
    ));


* Caution: If you didn't install the Textmesh pro, You could see the Error message on Unity3D


Enjoy~

2017/11/17 10:49 2017/11/17 10:49
TAG , ,
@Sun,

First, You should setup meta format in Unity Editor'setup
1.Open Editor setup
사용자 삽입 이미지
2. Change or Check "Version control mode" and "Asset Serialization mode" ("Visible Meta file", "Force Text")
사용자 삽입 이미지
3. Now close Unity3D and open the "Explorer" and Go your source's path. 
4. Remove not necessary folder and files (You need just 2 folders "Assets" and "ProjectSettings" (I just compress it. however, you can move these folders to other media)
사용자 삽입 이미지
* Please let me know what you block something.


2017/10/13 05:10 2017/10/13 05:10
TAG , ,
We had to meet Drawcall problem in Mobile game developing using unity 3D.
You should solve it by 2 combination way.

1. Make shard material.
2. Combine mesh.

I writing down about "Combine mesh"

1. Make next script as CombineChild on Unity3D

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class CombineChild : MonoBehaviour
{
void Start()
{
Matrix4x4 thisTransform = transform.worldToLocalMatrix; 
MeshFilter[] meshFilters = GetComponentsInChildren<MeshFilter>();
CombineInstance[] combine = new CombineInstance[meshFilters.Length];
int i = 0;
while (i < meshFilters.Length)
{
combine[i].mesh = meshFilters[i].sharedMesh;
combine[i].transform = thisTransform * meshFilters[i].transform.localToWorldMatrix;
meshFilters[i].gameObject.SetActive(false);
i++;
}
transform.GetComponent<MeshFilter>().mesh = new Mesh();
transform.GetComponent<MeshFilter>().mesh.CombineMeshes(combine); //, true, true, true);

transform.GetComponent<MeshFilter>().mesh.RecalculateNormals();
transform.gameObject.SetActive(true);
}
}


2. and Please attach to parent gameobject.

Cheers
2017/10/10 02:42 2017/10/10 02:42

first time, Update the code in iTween.cs file

void CallBack(string callbackType){
if (tweenArguments.Contains(callbackType) && !tweenArguments.Contains("ischild")) {
//establish target:
GameObject target;
if (tweenArguments.Contains(callbackType+"target")) {
target=(GameObject)tweenArguments[callbackType+"target"];
}else{
target=gameObject; 
}

/// Start of update
if (tweenArguments[callbackType] is Action<object>)
{
((Action<object>)tweenArguments[callbackType]).Invoke((object)tweenArguments[callbackType + "params"]);
}
else
/// End of update


//throw an error if a string wasn't passed for callback:
if (tweenArguments[callbackType].GetType() == typeof(System.String)) {
target.SendMessage((string)tweenArguments[callbackType],(object)tweenArguments[callbackType+"params"],SendMessageOptions.DontRequireReceiver);
}else{
Debug.LogError("iTween Error: Callback method references must be passed as a String!");
Destroy (this);
}
}
}

Now, You could use the Action<T> delegate in iTween.


iTween.ValueTo(gameObject,
iTween.Hash(
"from", 1f,
"to", 0f,
"time", 1f,
"onupdate", (System.Action<object>)(x => { missedInfo.color = new Color(1f, 0f, 0f, (float)x); }),
"oncomplete", (System.Action<object>)(x => missedInfo.gameObject.SetActive(true))
)
);

 

 

2017/10/06 07:32 2017/10/06 07:32
I am curious why they made UI System complex.
anyway, If you get any event from Event system(on UI), you can choice 2 options.

1. Using EventTrigger 
=> In my thinking, It's so terrible idea.It needs so many manual tasks. So I skip it. 

2. Using EventSystem
=> It's simple. However, I am finding another solution. Because it's not automation by runtime script.

a. add using...
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.EventSystems;


b. inherit from interfaces
public class BehaviorButton : MonoBehaviour, IPointerEnterHandler {

}


c. add Method
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.EventSystems;

public class BehaviorButton : MonoBehaviour, IPointerEnterHandler {
    public void OnPointerEnter(PointerEventData eventData) 
    {
 
    }
}


You can find it on unity's manual. (https://docs.unity3d.com/Manual/SupportedEvents.html)

IPointerEnterHandler - OnPointerEnter - Called when a pointer enters the object
IPointerExitHandler - OnPointerExit - Called when a pointer exits the object

IPointerDownHandler - OnPointerDown - Called when a pointer is pressed on the object
IPointerUpHandler - OnPointerUp - Called when a pointer is released (called on the original the pressed object)

IPointerClickHandler - OnPointerClick - Called when a pointer is pressed and released on the same object

IInitializePotentialDragHandler - OnInitializePotentialDrag - Called when a drag target is found, can be used to initialise values
IBeginDragHandler - OnBeginDrag - Called on the drag object when dragging is about to begin
IDragHandler - OnDrag - Called on the drag object when a drag is happening
IEndDragHandler - OnEndDrag - Called on the drag object when a drag finishes
IDropHandler - OnDrop - Called on the object where a drag finishes

IScrollHandler - OnScroll - Called when a mouse wheel scrolls

IUpdateSelectedHandler - OnUpdateSelected - Called on the selected object each tick

ISelectHandler - OnSelect - Called when the object becomes the selected object
IDeselectHandler - OnDeselect - Called on the selected object becomes deselected

IMoveHandler - OnMove - Called when a move event occurs (left, right, up, down, ect)

ISubmitHandler - OnSubmit - Called when the submit button is pressed
ICancelHandler - OnCancel - Called when the cancel button is pressed

* 영어 울렁증 가지고 계신분들께 죄송 -_-;; 
* 영어 연습겸 블로그에 영어로 작성중입니다.

2017/09/25 08:06 2017/09/25 08:06
* Prepare: Windows

1. Download Java JDK : http://www.oracle.com/technetwork/java ··· 151.html2. Install JDK
3. Open control panel
4. Open system path & Variable (Environment variable)
   a. search & run control panel.
   b. click System.
   c. click Advanced System setting.
5. create new system variable.
   a. JAVA_HOME: {Java JDK Path} (for example: D:\Program Files (x86)\Java\jdk1.8.0_25)
   b. CLASS_PATH: %JAVA_HOME%\lib
   c. PATH (just add new value): %JAVA_HOME%\bin
6. Download & Install Android Studio : https://developer.android.com/studio/index.html
7. Open Unity3d and Open Preferences
8. Click External Tool tab
9. Setup JDK / Android and NDK

Done

   

2017/09/13 17:28 2017/09/13 17:28