Ejemplo n.º 1
0
 private void Awake()
 {
     this.map = NJGMapBase.instance;
     NJGMapZone.id++;
     this.mId = NJGMapZone.id;
     this.mCollider = base.GetComponent<SphereCollider>();
     this.mCollider.isTrigger = true;
     this.mCollider.radius = (float)this.colliderRadius;
 }
Ejemplo n.º 2
0
    void Awake()
    {
        map = NJG.NJGMapBase.instance;
        if (map == null)
        {
            Debug.LogWarning("Can't render map photo. NJGMiniMap instance not found.");
            NJGTools.Destroy(gameObject);
            return;
        }

        if (gameObject.GetComponent <Camera>() == null)
        {
            gameObject.AddComponent <Camera>();
        }

        camera.useOcclusionCulling = false;

        Render();
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     this.map = NJGMapBase.instance;
 }
Ejemplo n.º 4
0
 protected virtual void Awake()
 {
     NJGMapBase.mInst = this;
     if (this.fow.textureSize < 200)
     {
         this.fow.textureSize = 200;
     }
     if (this.miniMap == null)
     {
         this.miniMap = base.transform.GetComponentInChildren<UIMiniMapBase>();
     }
     if (Application.isPlaying)
     {
         if (this.mapTexture != null)
         {
             NJGTools.Destroy(this.mapTexture);
         }
         if (this.generateAtStart)
         {
             this.GenerateMap();
         }
     }
 }
Ejemplo n.º 5
0
 void Start()
 {
     map = NJG.NJGMapBase.instance;
     fow = NJGFOW.instance;
 }
Ejemplo n.º 6
0
 protected virtual void Start()
 {
     this.map = NJGMapBase.instance;
     if (this.material == null)
     {
         if (Application.isPlaying)
         {
             global::Debug.LogWarning(new object[]
             {
                 "The UITexture does not have a material assigned",
                 this
             });
         }
     }
     else
     {
         if (this.map.generateMapTexture)
         {
             this.material.mainTexture = this.map.mapTexture;
         }
         else
         {
             this.material.mainTexture = NJGMapBase.instance.userMapTexture;
         }
         if (this.maskTexture != null)
         {
             this.material.SetTexture("_Mask", this.maskTexture);
         }
         this.material.color = this.mapColor;
     }
     if (Application.isPlaying && this.mChild == null)
     {
         if (this.cachedTransform.childCount > 0)
         {
             this.mChild = this.cachedTransform;
         }
         else
         {
             this.mChild = this.cachedTransform.GetChild(0);
         }
     }
     this.OnStart();
     this.Update();
 }
Ejemplo n.º 7
0
 protected virtual void Awake()
 {
     this.mMapScaleChanged = true;
     this.rendererTransform.hasChanged = true;
     this.map = NJGMapBase.instance;
     this.mTrans = base.transform;
     this.mUICam = NJGTools.FindCameraForLayer(NJGMapBase.instance.layer);
     if (this.material != null)
     {
         if (this.shaderType == NJGMapBase.ShaderType.FOW)
         {
             this.material.shader = Shader.Find("NinjutsuGames/Map FOW");
         }
         else if (this.shaderType == NJGMapBase.ShaderType.TextureMask)
         {
             this.material.shader = Shader.Find("NinjutsuGames/Map TextureMask");
         }
         else if (this.shaderType == NJGMapBase.ShaderType.ColorMask)
         {
             this.material.shader = Shader.Find("NinjutsuGames/Map ColorMask");
         }
     }
     if (this.maskTexture == null && this.material != null)
     {
         this.maskTexture = this.material.GetTexture("_Mask");
     }
     if (this.drawDirectionalLines && Application.isPlaying)
     {
         if (this.linesShader == null)
         {
             this.linesShader = Shader.Find("Particles/Additive");
         }
         GameObject gameObject = NJGTools.AddChild(base.gameObject);
         this.mLinesRoot = gameObject.transform;
         this.mLinesRoot.parent = this.iconRoot;
         this.mLinesRoot.localPosition = Vector3.zero;
         this.mLinesRoot.localEulerAngles = Vector3.zero;
         this.mLineRenderer = gameObject.GetComponent<LineRenderer>();
         if (this.mLineRenderer == null)
         {
             gameObject.AddComponent<LineRenderer>();
         }
         this.mLineRenderer = gameObject.GetComponent<LineRenderer>();
         this.mLineRenderer.useWorldSpace = true;
         this.mLineRenderer.material = new Material(this.linesShader);
         this.mLinesRoot.name = "_Lines";
     }
     this.mapAngle = 180f;
     this.mapRotation = Quaternion.Euler(0f, 0f, this.mapAngle);
 }
Ejemplo n.º 8
0
 public Vector2 WorldToMap(Vector3 worldPos, bool calculateZoom)
 {
     if (this.map == null)
     {
         this.map = NJGMapBase.instance;
     }
     Bounds bounds = this.map.bounds;
     Vector3 extents = bounds.extents;
     Vector3 vector = worldPos - bounds.center;
     float num = this.mapHalfScale.x / extents.x;
     float num2 = this.mapHalfScale.y / ((this.map.orientation != NJGMapBase.Orientation.XZDefault) ? extents.y : extents.z);
     Vector3 vector2 = this.WorldScrollPosition();
     if (calculateZoom)
     {
         num *= this.zoom;
         num2 *= this.zoom;
     }
     else
     {
         num *= 1f;
         num2 *= 1f;
         vector2 = Vector3.zero;
     }
     this.mWTM.x = (vector.x - vector2.x) * num;
     this.mWTM.y = ((this.map.orientation != NJGMapBase.Orientation.XZDefault) ? ((vector.y - vector2.y) * num2) : ((vector.z - vector2.z) * num2));
     if (this.map.mapResolution == NJGMapBase.Resolution.Double)
     {
         num *= this.mMod;
         num2 *= this.mMod;
     }
     return this.mWTM;
 }
Ejemplo n.º 9
0
 private void Awake()
 {
     this.map = NJGMapBase.instance;
     if (this.map == null)
     {
         global::Debug.LogWarning(new object[]
         {
             "Can't render map photo. NJGMiniMap instance not found."
         });
         NJGTools.Destroy(base.gameObject);
         return;
     }
     if (base.gameObject.GetComponent<Camera>() == null)
     {
         base.gameObject.AddComponent<Camera>();
     }
     base.camera.enabled = false;
 }