Ejemplo n.º 1
0
 protected override void Awake()
 {
     if (this.IsInit)
     {
         return;
     }
     this.IsInit = true;
     base.Awake();
     this.InitFXLOD();
     this.InitColliders();
     this.InitAnimators();
     this.InitAnimations();
     this.InitParticles();
     this.InitSequenceFrames();
     this.InitTransformNodesStateOfActive(base.get_transform());
     this.InitTransformNodesStateOfRender(base.get_transform());
     this.InitColliderEnable(base.get_transform());
     this.CalDelayTimeByRoot();
     this.CalAnimationLiveTime();
     this.CalAnimatorLiveTime();
     if (base.get_gameObject().get_layer() != LayerSystem.NameToLayer("Gear"))
     {
         LayerSystem.SetGameObjectLayer(base.get_gameObject(), "FX", 1);
     }
     this.InitFXEventReceivers();
 }
Ejemplo n.º 2
0
 public void Create()
 {
     if (CamerasMgr.Camera2RTCommon == null)
     {
         base.set_enabled(false);
         return;
     }
     if (RTSyncBackground.RTCanvas == null)
     {
         RTSyncBackground.RTCanvas = new GameObject("RTCanvas");
         RTSyncBackground.RTCanvas.get_transform().set_parent(CamerasMgr.Camera2RTCommon.get_transform());
         RTSyncBackground.RTCanvas.get_transform().set_localPosition(Vector3.get_zero());
         RTSyncBackground.RTCanvas.get_transform().set_localRotation(Quaternion.get_identity());
         RTSyncBackground.RTCanvas.get_transform().set_localScale(Vector3.get_one());
         RTSyncBackground.RTCanvas.set_layer(LayerSystem.NameToLayer("FX"));
         Canvas canvas = RTSyncBackground.RTCanvas.AddComponent <Canvas>();
         canvas.set_renderMode(1);
         canvas.set_pixelPerfect(false);
         canvas.set_worldCamera(CamerasMgr.Camera2RTCommon);
         CanvasScaler canvasScaler = RTSyncBackground.RTCanvas.AddComponent <CanvasScaler>();
         canvasScaler.set_uiScaleMode(0);
     }
     if (this.m_goSync != null)
     {
         this.m_goSync.SetActive(true);
         this.SyncImage();
     }
     else
     {
         this.m_goSync = new GameObject(base.get_gameObject().get_name());
         this.m_goSync.get_transform().set_parent(RTSyncBackground.RTCanvas.get_transform());
         this.m_goSync.get_transform().set_localPosition(Vector3.get_zero());
         this.m_goSync.get_transform().set_localRotation(Quaternion.get_identity());
         this.m_goSync.get_transform().set_localScale(Vector3.get_one());
         this.m_goSync.set_layer(LayerSystem.NameToLayer("FX"));
         this.m_thisImage = base.get_gameObject().GetComponent <Image>();
         if (this.m_thisImage != null)
         {
             this.m_syncImage = this.m_goSync.AddComponent <Image>();
             this.m_syncImage.set_material(RTSyncBackground.BackgroundMat);
         }
         else
         {
             this.m_thisRawImage = base.get_gameObject().GetComponent <RawImage>();
             if (this.m_thisRawImage != null)
             {
                 this.m_syncRawImage = this.m_goSync.AddComponent <RawImage>();
                 this.m_syncRawImage.set_material(RTSyncBackground.BackgroundMat);
             }
         }
         this.SyncImage();
         if (base.get_gameObject().GetComponent <UIMaskLayer>() != null)
         {
             this.m_goSync.AddComponent <UIMaskLayer>();
         }
     }
 }
Ejemplo n.º 3
0
    public static int GetCullingMask(int classify)
    {
        int num = 0;

        switch (classify)
        {
        case 1:
            num = -1;
            break;

        case 2:
            num = 0;
            break;

        case 3:
            num = LayerSystem.GetMask(Utils.background_layers);
            break;

        case 4:
            num = -1;
            for (int i = 0; i < Utils.background_layers.Length; i++)
            {
                num &= ~(1 << LayerSystem.NameToLayer(Utils.background_layers[i]));
            }
            break;

        case 5:
            num = LayerSystem.GetMask(Utils.win_layers);
            break;

        case 6:
            num = LayerSystem.GetMask(Utils.timeline_layers);
            break;

        case 7:
            num = -1;
            for (int j = 0; j < Utils.pet_ultra_skill_no_layers.Length; j++)
            {
                num &= ~(1 << LayerSystem.NameToLayer(Utils.pet_ultra_skill_no_layers[j]));
            }
            break;

        case 8:
            num = -1;
            for (int k = 0; k < Utils.no_camerarange_layers.Length; k++)
            {
                num &= ~(1 << LayerSystem.NameToLayer(Utils.no_camerarange_layers[k]));
            }
            break;

        case 9:
            num = LayerSystem.GetMask(Utils.camerarange_layers);
            break;
        }
        return(num);
    }
Ejemplo n.º 4
0
    private static void CreateWaveBloodControlPool()
    {
        Transform transform = new GameObject("Pool2WaveBloodControl").get_transform();

        transform.set_parent(UINodesManager.NoEventsUIRoot);
        transform.get_gameObject().set_layer(LayerSystem.NameToLayer("UI"));
        WaveBloodManager.Pool2WaveBloodControl = transform;
        UGUITools.ResetTransform(WaveBloodManager.Pool2WaveBloodControl);
        WaveBloodManager.WaveBloodControlPool = new UIPool("WaveBloodControl", WaveBloodManager.Pool2WaveBloodControl, false);
    }
Ejemplo n.º 5
0
    private static void CreatePools()
    {
        Transform transform = new GameObject("Pool2FloatTip").get_transform();

        transform.set_parent(UINodesManager.NoEventsUIRoot);
        transform.get_gameObject().set_layer(LayerSystem.NameToLayer("UI"));
        FloatTipManager.Pool2FloatTip = transform;
        UGUITools.ResetTransform(FloatTipManager.Pool2FloatTip);
        FloatTipManager.FloatTipPool = new UIPool("FloatTipUnit", FloatTipManager.Pool2FloatTip, false);
    }
Ejemplo n.º 6
0
    private static void CreatePools()
    {
        Transform transform = new GameObject("Pool2EnemyArrow").get_transform();

        transform.set_parent(UINodesManager.NoEventsUIRoot);
        transform.get_gameObject().set_layer(LayerSystem.NameToLayer("UI"));
        ArrowManager.Pool2EnemyArrow = transform;
        UGUITools.ResetTransform(ArrowManager.Pool2EnemyArrow);
        ArrowManager.EnemyArrowPool = new UIPool("EnemyInScreenUnit", ArrowManager.Pool2EnemyArrow, false);
    }
Ejemplo n.º 7
0
 private void OnTriggerExit(Collider other)
 {
     if (other.get_gameObject().get_layer() != LayerSystem.NameToLayer("Default") && other.get_gameObject().get_layer() != LayerSystem.NameToLayer("Terrian"))
     {
         ActorParent component = other.get_transform().GetComponent <ActorParent>();
         if (component && this.Actor && component != this.Actor && component.FixGameObject.get_layer() != this.Actor.FixGameObject.get_layer())
         {
             this.Actor.OnCushionExit(component);
         }
     }
 }
Ejemplo n.º 8
0
 private void OnTriggerStay(Collider other)
 {
     if (other.get_gameObject().get_layer() != LayerSystem.NameToLayer("Default") && other.get_gameObject().get_layer() != LayerSystem.NameToLayer("Terrian"))
     {
         ActorParent component = other.get_transform().GetComponent <ActorParent>();
         if (component && this.Actor && component != this.Actor && component.FixGameObject.get_layer() != this.Actor.FixGameObject.get_layer() && XUtility.DistanceNoY(other.get_transform().get_position(), base.get_transform().get_position()) < XUtility.GetTriggerRadius(other.get_transform()) + XUtility.GetTriggerRadius(base.get_transform()))
         {
             this.Actor.OnCushionStay(component);
         }
     }
 }
Ejemplo n.º 9
0
    private static void CreatePools()
    {
        Transform transform = new GameObject("Pool2HeadInfo").get_transform();

        transform.set_parent(UINodesManager.NoEventsUIRoot);
        transform.get_gameObject().set_layer(LayerSystem.NameToLayer("UI"));
        HeadInfoManager.Pool2HeadInfo = transform;
        UGUITools.ResetTransform(HeadInfoManager.Pool2HeadInfo);
        HeadInfoManager.HeadInfoPool = new UIPool("HeadInfoUnit", HeadInfoManager.Pool2HeadInfo, false);
        TimerHeap.AddTimer(10000u, 2500, delegate
        {
            HeadInfoManager.Instance.ResortOfZ2D();
        });
    }
Ejemplo n.º 10
0
 protected void OnTriggerStay(Collider other)
 {
     if (other.get_gameObject().get_layer() == LayerSystem.NameToLayer(LayerSystem.GetGameObjectLayerName(EntityWorld.Instance.EntSelf.Camp, EntityWorld.Instance.EntSelf.LayerEntityNumber, 1)))
     {
         if (this.col != null && this.col.get_isTrigger())
         {
             float num = this.radius - other.get_gameObject().GetComponent <CharacterController>().get_radius() - 0.4f;
             if (Vector3.Distance(other.get_gameObject().get_transform().get_position(), base.get_transform().get_position()) < num)
             {
                 this.isTrigger = true;
             }
         }
         this.StayPlatform(other);
     }
 }
Ejemplo n.º 11
0
    private static void CreatePools()
    {
        Transform transform = new GameObject("Pool2BubbleDialogue").get_transform();

        transform.set_parent(UINodesManager.NoEventsUIRoot);
        transform.SetAsLastSibling();
        transform.get_gameObject().set_layer(LayerSystem.NameToLayer("UI"));
        BubbleDialogueManager.Pool2BubbleDialogue = transform;
        UGUITools.ResetTransform(BubbleDialogueManager.Pool2BubbleDialogue);
        BubbleDialogueManager.BubbleDialoguePool = new UIPool("BubbleDialogueUnit", BubbleDialogueManager.Pool2BubbleDialogue, false);
        TimerHeap.AddTimer(10000u, 2500, delegate
        {
            BillboardManager.ResortOfZ(BubbleDialogueManager.BubbleDialoguePool);
        });
    }
Ejemplo n.º 12
0
 protected void OnTriggerExit(Collider other)
 {
     Debuger.Error("OnTriggerExit", new object[0]);
     if (other.get_gameObject().get_layer() == LayerSystem.NameToLayer(LayerSystem.GetGameObjectLayerName(EntityWorld.Instance.EntSelf.Camp, EntityWorld.Instance.EntSelf.LayerEntityNumber, 1)))
     {
         this.isTrigger = false;
         if (this.lastPosition == base.get_transform().get_position())
         {
             this.isUp = !this.isUp;
         }
         this.lastPosition  = Vector3.get_zero();
         this.firstPosition = Vector3.get_zero();
         this.LeavePlatform(other);
         this.startMove = null;
         this.endMove   = null;
     }
 }
Ejemplo n.º 13
0
 protected void OnTriggerEnter(Collider other)
 {
     Debuger.Error("OnTriggerEnter", new object[0]);
     if (other.get_gameObject().get_layer() == LayerSystem.NameToLayer(LayerSystem.GetGameObjectLayerName(EntityWorld.Instance.EntSelf.Camp, EntityWorld.Instance.EntSelf.LayerEntityNumber, 1)))
     {
         this.firstPosition = base.get_transform().get_position();
         if (this.isUp)
         {
             this.lastPosition = this.endPoint.get_position();
         }
         else
         {
             this.lastPosition = this.startPoint.get_position();
         }
         this.EnterPlatform(other);
     }
 }
Ejemplo n.º 14
0
 public static void SetMeshRenderToLayerFXDistortion(Transform tran)
 {
     if (!SystemConfig.IsShaderEffectOn)
     {
         return;
     }
     if (tran == null)
     {
         return;
     }
     PostProcessManager.Instance.EnableLocalHeatDistortion(true);
     Renderer[] componentsInChildren = tran.GetComponentsInChildren <Renderer>();
     for (int i = 0; i < componentsInChildren.Length; i++)
     {
         Renderer renderer = componentsInChildren[i];
         renderer.get_gameObject().set_layer(LayerSystem.NameToLayer("FX_Distortion"));
     }
 }
Ejemplo n.º 15
0
 private void OnEnable()
 {
     this._emit         = this._emitOfInit;
     this._emitTime     = this._emitTimeOfInit;
     this._lastPosition = base.get_transform().get_position();
     this._trailObject  = new GameObject("Trail");
     this._trailObject.set_layer(LayerSystem.NameToLayer("FX"));
     this._trailObject.get_transform().set_parent(null);
     this._trailObject.get_transform().set_position(Vector3.get_zero());
     this._trailObject.get_transform().set_rotation(Quaternion.get_identity());
     this._trailObject.get_transform().set_localScale(Vector3.get_one());
     this._trailObject.AddComponent(typeof(MeshFilter));
     this._trailObject.AddComponent(typeof(MeshRenderer));
     this._trailObject.GetComponent <Renderer>().set_material(this._material);
     this._trailMesh = new Mesh();
     this._trailMesh.set_name(base.get_name() + "TrailMesh");
     this._trailObject.GetComponent <MeshFilter>().set_mesh(this._trailMesh);
     this._minVertexDistanceSqr = this._minVertexDistance * this._minVertexDistance;
     this._maxVertexDistanceSqr = this._maxVertexDistance * this._maxVertexDistance;
 }
Ejemplo n.º 16
0
    public static RealDrop CreateRealDrop(int theIndex, int theModelID, string theItemName, Vector3 originPoint, Vector3 waitPoint, int waitFxID, int collectTextID)
    {
        if (!DataReader <DiaoLuoMoXingBiao> .Contains(theModelID))
        {
            return(null);
        }
        DiaoLuoMoXingBiao diaoLuoMoXingBiao = DataReader <DiaoLuoMoXingBiao> .Get(theModelID);

        GameObject gameObject = GameObjectLoader.Instance.Get(diaoLuoMoXingBiao.path);

        if (gameObject == null)
        {
            return(null);
        }
        RealDrop realDrop = gameObject.AddUniqueComponent <RealDrop>();

        realDrop.Index    = theIndex;
        realDrop.ModelID  = theModelID;
        realDrop.ItemName = theItemName;
        realDrop.animator = realDrop.GetComponentInChildren <Animator>();
        realDrop.get_gameObject().set_layer(LayerSystem.NameToLayer("Gear"));
        realDrop.get_transform().set_parent(RealDrop.DropPool.get_transform());
        realDrop.get_transform().set_position(originPoint);
        if (originPoint.x == waitPoint.x && originPoint.z == waitPoint.z)
        {
            realDrop.currentState           = RealDrop.RealDropState.Wait;
            realDrop.waitPosition           = originPoint;
            realDrop.flyToWaitPositionSpeed = Vector3.get_zero();
        }
        else
        {
            realDrop.currentState           = RealDrop.RealDropState.FlyToWait;
            realDrop.waitPosition           = MySceneManager.GetTerrainPoint(waitPoint.x, waitPoint.z, waitPoint.y);
            realDrop.flyToWaitPositionSpeed = (realDrop.waitPosition - originPoint) / RealDrop.FlyToWaitPositionDefaultTime;
        }
        realDrop.waitFxModelID = waitFxID;
        realDrop.waitCollider  = realDrop.GetComponent <BoxCollider>();
        realDrop.waitCollider.set_enabled(false);
        RealDrop.allRealDrop.Add(realDrop);
        return(realDrop);
    }
Ejemplo n.º 17
0
    public static FakeDrop CreateFakeDrop(int modelID, Vector3 originPoint, Vector3 waitPoint, int waitFxID, int flyToEntityFxID)
    {
        DiaoLuoMoXingBiao diaoLuoMoXingBiao = DataReader <DiaoLuoMoXingBiao> .Get(modelID);

        if (diaoLuoMoXingBiao == null)
        {
            return(null);
        }
        GameObject gameObject = GameObjectLoader.Instance.Get(diaoLuoMoXingBiao.path);

        if (gameObject == null)
        {
            return(null);
        }
        FakeDrop fakeDrop = gameObject.AddUniqueComponent <FakeDrop>();

        fakeDrop.animator = fakeDrop.GetComponentInChildren <Animator>();
        fakeDrop.get_gameObject().set_layer(LayerSystem.NameToLayer("Gear"));
        fakeDrop.get_transform().set_parent(FakeDrop.DropPool.get_transform());
        fakeDrop.get_transform().set_position(originPoint);
        if (originPoint.x == waitPoint.x && originPoint.z == waitPoint.z)
        {
            fakeDrop.currentState           = FakeDrop.FakeDropState.Wait;
            fakeDrop.waitPosition           = originPoint;
            fakeDrop.flyToWaitPositionSpeed = Vector3.get_zero();
        }
        else
        {
            fakeDrop.currentState           = FakeDrop.FakeDropState.FlyToWait;
            fakeDrop.waitPosition           = MySceneManager.GetTerrainPoint(waitPoint.x, waitPoint.z, waitPoint.y);
            fakeDrop.flyToWaitPositionSpeed = (fakeDrop.waitPosition - originPoint) / FakeDrop.FlyToWaitPositionDefaultTime;
        }
        fakeDrop.waitFxModelID = waitFxID;
        fakeDrop.waitCollider  = fakeDrop.GetComponent <BoxCollider>();
        fakeDrop.waitCollider.set_enabled(false);
        fakeDrop.flyToEntityFxModelID = flyToEntityFxID;
        FakeDrop.allFakeDrop.Add(fakeDrop);
        return(fakeDrop);
    }
Ejemplo n.º 18
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.get_gameObject().get_layer() != LayerSystem.NameToLayer("Default") && other.get_gameObject().get_layer() != LayerSystem.NameToLayer("Terrian"))
     {
         ActorCollider component = other.GetComponent <ActorCollider>();
         if (!component)
         {
             return;
         }
         if (!component.Actor)
         {
             return;
         }
         if (component.Actor.GetEntity() == null)
         {
             return;
         }
         if (!component.Actor.GetEntity().IsEntitySelfType)
         {
             return;
         }
         this.OnSelfEnter();
     }
 }
Ejemplo n.º 19
0
 protected bool IsRendererValid(Renderer item)
 {
     return(item.get_gameObject().get_layer() != LayerSystem.NameToLayer("FX") && item.GetType() != typeof(ParticleSystemRenderer) && !item.get_gameObject().get_name().Equals("SP"));
 }
Ejemplo n.º 20
0
 public static void SetGameObjectLayer(GameObject root, string layerName, int ignoreType)
 {
     LayerSystem.SetGameObjectLayer(root, LayerSystem.NameToLayer(layerName), ignoreType);
 }