Ejemplo n.º 1
0
        public override void OnEnable()
        {
            base.OnEnable();

#if UNITY_EDITOR
            HideStuff();
            SetupPhotonView();
#endif

            if (PhotonNetwork.UseRpcMonoBehaviourCache)
            {
                photonView.RefreshRpcMonoBehaviourCache();
            }

            if (networkCulling && this.photonView.IsMine)
            {
                if (CullArea == null)
                {
                    CullArea = FindObjectOfType <CullArea>();
                }

                this.previousActiveCells = new List <byte>(0);
                this.activeCells         = new List <byte>(0);

                this.currentPosition = this.lastPosition = transform.position;
            }

#if UNITY_EDITOR
            FormatName();
#endif
        }
Ejemplo n.º 2
0
 private void OnEnable()
 {
     if (Object.op_Equality((Object)this.pView, (Object)null))
     {
         this.pView = (PhotonView)((Component)this).GetComponent <PhotonView>();
         if (!this.pView.isMine)
         {
             return;
         }
     }
     if (Object.op_Equality((Object)this.cullArea, (Object)null))
     {
         this.cullArea = (CullArea)Object.FindObjectOfType <CullArea>();
     }
     this.previousActiveCells = new List <int>(0);
     this.activeCells         = new List <int>(0);
     this.currentPosition     = this.lastPosition = ((Component)this).get_transform().get_position();
 }
Ejemplo n.º 3
0
 private void OnEnable()
 {
     if (this.pView == null)
     {
         this.pView = base.GetComponent <PhotonView>();
         if (!this.pView.isMine)
         {
             return;
         }
     }
     if (this.cullArea == null)
     {
         this.cullArea = Object.FindObjectOfType <CullArea>();
     }
     this.previousActiveCells = new List <byte>(0);
     this.activeCells         = new List <byte>(0);
     this.currentPosition     = (this.lastPosition = base.transform.position);
 }
Ejemplo n.º 4
0
    public void OnEnable()
    {
        cullArea = (CullArea)target;

        // Destroying the newly created cull area if there is already one existing
        if (FindObjectsOfType <CullArea>().Length > 1)
        {
            Debug.LogWarning("Destroying newly created cull area because there is already one existing in the scene.");

            DestroyImmediate(cullArea);

            return;
        }

        // Prevents the dropdown from resetting
        if (cullArea != null)
        {
            upAxisOptions = cullArea.YIsUpAxis ? UP_AXIS_OPTIONS.SideScrollerMode : UP_AXIS_OPTIONS.TopDownOr3DMode;
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    ///     Gets references to the PhotonView component and the cull area game object.
    /// </summary>
    private void OnEnable()
    {
        if (pView == null)
        {
            pView = GetComponent <PhotonView>();

            if (!pView.isMine)
            {
                return;
            }
        }

        if (cullArea == null)
        {
            cullArea = GameObject.FindObjectOfType <CullArea>();
        }

        previousActiveCells = new List <int>(0);
        activeCells         = new List <int>(0);

        currentPosition = lastPosition = transform.position;
    }