标签:#C#

Posts

· 2017-12-03 · * Unity * C# *

Easy use of singleton in unity, without using life-cycle of gameobject.

using System;
using UnityEngine;
using System.Collections;
using System.Linq;
using System.Reflection;

namespace suntabu
{

    /// <summary>
    /// Author:gouzhun 
· 2017-10-14 · * Unity * C# *
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
 
namespace Pooling
{
    public enum LoadingMode { Eager, Lazy, LazyExpanding };
 
    public enum AccessMode { FIFO, LIFO, Circular };
 
    public class Pool<T> : IDisposable
· 2017-10-14 · * Unity * C# * Performance *

(part 1 of 3)

The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.


[Note: This post presupposes 'intermediate' knowledge of C# and Unity.]

I'm going to start this post with a confession. Although raised as a C/C++ developer, for a long time I was a secret fan of Microsoft's C# language and the .NET framework. About three years ago, when I decided to leave the Wild West of C/C++-based graphics libraries and enter the civilized world of modern game engines, Unity stood out with one feature that made it an obvious choice for myself. Unity didn't require you to 'script' in one language (like Lua or UnrealScript) and 'program' in another. Instead, it had deep support for Mono, which meant all your programming could be done in any of the .NET languages. Oh joy! I finally had a legitimate reason to kiss C++ goodbye and have all my problems solved by automatic memory managment. This feature had been built deeply into the C# language and was an integral part of its philosophy. No more memory leaks, no more thinking about memory management! My life would become so much easier.

image