I get it every time when I got code test.


using System;

namespace NodeTest
{
    class Program
    {
        static void Main(string[] args)
        {
            const string STR_VALUE = "10524";
            ListNode headNode = null;
            ListNode pointNode = null;
 
             MakeNode(ref headNode, null, STR_VALUE);

             for (int i = 0; i < STR_VALUE.Length; i++)
             {
                 for (int j = i+1; j < STR_VALUE.Length; j++)
                 {
                     if (GetNode(headNode, i).val > GetNode(headNode, j).val)
                     {
                         int x = GetNode(headNode, i).val;
                         GetNode(headNode, i).val = GetNode(headNode, j).val;
                         GetNode(headNode, j).val = x;
                     }
                 }
             }

             pointNode = headNode;
             while(true)
             {
                 Console.WriteLine(pointNode.val.ToString());
                 if (pointNode.next == null) break;
                 pointNode = pointNode.next;
             }
    }

     static void MakeNode(ref ListNode currentnode, ListNode previousnode, string str)
     {
         if (str.Length <= 0) return;
         currentnode = new ListNode(int.Parse(str.Substring(0, 1)));
         if (previousnode != null) {
             previousnode.next = currentnode;
         }
         ListNode dummynode = null;
         MakeNode(ref dummynode, currentnode, str.Substring(1));
     }

     static ListNode GetNode(ListNode headNode, int idx)
     {
         ListNode currentnode = headNode;
         for (int i = 0; i < idx; i++)
         {
             currentnode = currentnode.next;
         }
         return currentnode;
     }
 }

 public class ListNode {
     public int val;
     public ListNode next;
     public ListNode(int x) { val = x; }
 }
}




2018/02/11 20:07 2018/02/11 20:07
TAG ,
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 , ,