コード例 #1
0
 private void OnDestroy()
 {
     if (instance_ == this)
     {
         instance_ = null;
     }
 }
コード例 #2
0
        // Use this for initialization
        void Awake()
        {
            // インスタンスが生成されてるかどうかをチェックする
            if (null == instance_)
            {
                // ないなら自分を渡す
                instance_ = this;
            }
            else
            {
                // すでにあるなら自分を破棄する
                DestroyImmediate(gameObject);
            }

            camera_    = GetComponentInChildren <MinimapCameraController>();
            map_scale_ = camera_.GetComponent <Camera>().orthographicSize;
            hashtable_ = new Hashtable();
        }