Beispiel #1
0
    //여까지명우가넣은거

    private void Start()
    {
        if (FogOfWar.fogAlignment == FogOfWar.FogAlignment.DDDMode)
        {
            previousFaction          = FogOfWar3D.currentlyRevealed;
            rbody                    = gameObject.AddComponent <Rigidbody>();
            rbody.useGravity         = false;
            rbody.isKinematic        = true;
            sphereCollider           = gameObject.AddComponent <SphereCollider>();
            sphereCollider.isTrigger = true;

            if (FogOfWar3D.currentlyRevealed != faction)
            {
                sphereCollider.radius = 0f;
                isInTheSightRange     = false;//명우가넣은거
                Check();
                //Hide();
            }
            else
            {
                sphereCollider.radius = visionRange;
            }

            revealer3D = new Revealer3D(visionRange,
                                        faction,
                                        transform);

            FogOfWar3D.RegisterRevealer(revealer3D);
        }
        else
        {
            revealer = new Revealer(visionRange,
                                    faction,
                                    upVision,
                                    gameObject);

            FogOfWar.RegisterRevealer(revealer);

            if (dynamicBlock)
            {
                FogOfWar.RegisterVisionBlocker(gameObject);
            }

            if (faction == FogOfWar.RevealFaction)
            {
                isInTheSightRange = true;//명우가넣은거
                Check();
                //Show();
            }
            else
            {
                isInTheSightRange = false;//명우가넣은거
                Check();
                //Hide();
            }
        }
    }
Beispiel #2
0
    private void AddFogFoWar()
    {
        return;

        FogOfWar3D _fog = mainCamera.AddComponent <FogOfWar3D>();

        _fog.m_viewer          = GameObject.Find("Avatar(Clone)").transform;
        _fog.m_topLeft         = GameObject.Find("S03_railing02_0").transform;
        _fog.m_topRight        = GameObject.Find("S03_railing02_1").transform;
        _fog.m_bottomRight     = GameObject.Find("S03_railing02_2").transform;
        _fog.m_bottomLeft      = GameObject.Find("S03_railing02_3").transform;
        _fog.m_fogCoverLayer   = (int)Mogo.Util.LayerMask.Default;
        _fog.m_edgeSmoothValue = 0.0f;
        _fog.m_fogDensity      = 0.75f;
    }
Beispiel #3
0
 public void OnDisable()
 {
     if (FogOfWar.fogAlignment == FogOfWar.FogAlignment.DDDMode)
     {
         if (revealer3D != null)
         {
             FogOfWar3D.UnregisterRevealer(revealer3D.sceneReference.GetInstanceID());
         }
     }
     else
     {
         if (revealer != null)
         {
             FogOfWar.UnRegisterRevealer(revealer.sceneReference.GetInstanceID());
         }
     }
 }
Beispiel #4
0
 public void OnEnable()
 {
     if (FogOfWar.fogAlignment == FogOfWar.FogAlignment.DDDMode)
     {
         if (revealer3D != null)
         {
             FogOfWar3D.RegisterRevealer(revealer3D);
         }
     }
     else
     {
         if (revealer != null)
         {
             FogOfWar.RegisterRevealer(revealer);
         }
     }
 }
Beispiel #5
0
    private void OnEnable()
    {
        if (FogOfWar3D.fogManager == null)
        {
            Debug.Log("Initialized fog of war manager");
            FogOfWar3D.RegisterFogOfWarManager(this);
        }

        if (factions.Count < 1)
        {
            AddFaction();
        }

        positionRange = new Vector4[maxRevealers];

        FogOfWar.fogAlignment = FogOfWar.FogAlignment.DDDMode;

        ClearArea();
        SetUpShaderKeywords();
    }
Beispiel #6
0
    private void Start()
    {
        Revealer3D revealer = new Revealer3D(visionRange, faction, this.transform);

        FogOfWar3D.RegisterRevealer(revealer);
    }
Beispiel #7
0
 public void UpdateVisionRange()
 {
     FogOfWar3D.UpdateVisionRange(transform.GetInstanceID(), visionRange);
 }
Beispiel #8
0
 private void OnDestroy()
 {
     FogOfWar3D.UnregisterRevealer(transform.GetInstanceID());
 }