Exemple #1
0
 protected override void OnDisable()
 {
     base.OnDisable();
     UIQueueManager.Instance.Islocked = false;
     base.FindTransform("PanelInfo").GetComponent <CanvasGroup>().set_alpha(0f);
     RTManager.SetRT(this.m_spBackgroundImage, ResourceManagerBase.GetNullTexture());
     EventDispatcher.Broadcast <bool, RTManager.RtType>("RTManager.ENABLE_PROJECTION_TYPE", false, RTManager.RtType.ActorModel1);
 }
Exemple #2
0
 public void FixedCamera2RTCommon()
 {
     if (CamerasMgr.IsCamera2RTCommonTargetNull())
     {
         Debug.LogError("CamerasMgr.Camera2RTCommon.targetTexture == null");
         if (this.m_RTCommon != null)
         {
             CamerasMgr.Camera2RTCommon.set_targetTexture(this.m_RTCommon);
         }
         if (this.CurrentRawImageOfProjection != null)
         {
             RTManager.SetRT(this.CurrentRawImageOfProjection, this.RTCommon);
         }
     }
 }
Exemple #3
0
    public static GameObject SetRawImage(RawImage rawImage, int wingModelId)
    {
        RenderTexture renderTexture = null;

        RTManager.CreateRenderTexture(ref renderTexture, "temp_render_texture");
        rawImage.GetComponent <RectTransform>().set_sizeDelta(new Vector2((float)renderTexture.get_width(), (float)renderTexture.get_height()));
        RTManager.SetRT(rawImage, renderTexture);
        Camera     camera = WingGlobal.CreateCameraToModel(renderTexture);
        ActorModel model  = WingGlobal.GetModel(wingModelId);

        WingGlobal.cameras.Add(camera.get_gameObject());
        WingGlobal.models.Add(model.get_gameObject());
        camera.get_transform().set_rotation(model.get_transform().get_rotation() * Quaternion.AngleAxis(180f, Vector3.get_up()));
        Vector3 vector  = model.get_transform().get_up() * 0.9f;
        Vector3 vector2 = model.get_transform().get_forward() * 2.95f;

        camera.get_transform().set_position(model.get_transform().get_position() + vector + vector2);
        return(model.get_gameObject());
    }
    public static ActorModel SetRawImage(RawImage rawImage, int modelId, Vector2 offsetlocalPos, ref GameObject goModel, ref GameObject goCamera)
    {
        AvatarModel avatarModel = DataReader <AvatarModel> .Get(modelId);

        if (avatarModel == null)
        {
            return(null);
        }
        RenderTexture renderTexture = null;

        RTManager.CreateRenderTexture(ref renderTexture, "temp_render_texture");
        rawImage.GetComponent <RectTransform>().set_sizeDelta(new Vector2((float)renderTexture.get_width(), (float)renderTexture.get_height()));
        RTManager.SetRT(rawImage, renderTexture);
        ActorModel actorModel = ModelDisplayManager.Instance.JustCreateUIModel(0, modelId, avatarModel, true, "CameraRange", offsetlocalPos);
        Camera     camera     = ModelDisplayManager.CreateCameraToModel(renderTexture);

        ModelDisplayManager.CameraSettingOfActorModel(camera, avatarModel, offsetlocalPos.x);
        goModel  = actorModel.get_gameObject();
        goCamera = camera.get_gameObject();
        return(actorModel);
    }
 private void SyncImage()
 {
     if (this.m_thisImage != null && this.m_syncImage != null)
     {
         this.m_syncImage.set_sprite(this.m_thisImage.get_sprite());
         return;
     }
     if (this.m_thisRawImage != null && this.m_syncRawImage != null)
     {
         RTManager.SetRT(this.m_syncRawImage, this.m_thisRawImage.get_texture());
         return;
     }
     if (this.m_syncImage != null)
     {
         ResourceManager.SetSprite(this.m_syncImage, ResourceManagerBase.GetNullSprite());
     }
     if (this.m_syncRawImage != null)
     {
         RTManager.SetRT(this.m_syncRawImage, ResourceManagerBase.GetNullTexture());
     }
 }
Exemple #6
0
    public List <GameObject> SetModelData(RawImage rawImage, ExteriorArithmeticUnit exteriorUnit, out int index)
    {
        List <GameObject> list = new List <GameObject>();

        index = this.BorrowModelIndex();
        RenderTexture renderTexture = null;

        RTManager.CreateRenderTexture(ref renderTexture, "temp_render_texture");
        rawImage.GetComponent <RectTransform>().set_sizeDelta(new Vector2((float)renderTexture.get_width(), (float)renderTexture.get_height()));
        RTManager.SetRT(rawImage, renderTexture);
        Camera camera = this.CreateModelCamera(renderTexture);

        list.Add(camera.get_gameObject());
        ActorModel model = this.GetModel(index, exteriorUnit);

        list.Add(model.get_gameObject());
        camera.get_transform().set_rotation(model.get_transform().get_rotation() * Quaternion.AngleAxis(180f, Vector3.get_up()));
        Vector3 vector  = model.get_transform().get_up() * 0.9f;
        Vector3 vector2 = model.get_transform().get_forward() * 2.95f;

        camera.get_transform().set_position(model.get_transform().get_position() + vector + vector2);
        return(list);
    }
Exemple #7
0
 public void SetModelRawImage1(RawImage actorRawImage, bool Is3DScene2Bg = false)
 {
     if (actorRawImage != null)
     {
         float         num           = 470f;
         RectTransform rectTransform = actorRawImage.get_transform() as RectTransform;
         if (rectTransform != null)
         {
             num = rectTransform.get_sizeDelta().y;
         }
         float num2 = (float)((int)((float)CamerasMgr.CameraMain.get_pixelWidth() * num / (float)CamerasMgr.CameraMain.get_pixelHeight()));
         actorRawImage.get_rectTransform().set_sizeDelta(new Vector2(num2, num));
         this.CurrentRawImageOfProjection = actorRawImage;
         RTManager.SetRT(actorRawImage, this.RTCommon);
         if (Is3DScene2Bg)
         {
             actorRawImage.set_material(this.RTMat);
         }
         else
         {
             actorRawImage.set_material(this.RTNoAlphaMat);
         }
     }
 }
Exemple #8
0
 private void Awake()
 {
     RTManager.Instance = this;
     EventDispatcher.AddListener <bool, RTManager.RtType>("RTManager.ENABLE_PROJECTION_TYPE", new Callback <bool, RTManager.RtType>(this.EnableProjectionType));
     EventDispatcher.AddListener("EquipCustomization.ACTSELF_CHANGE_WEAPON", new Callback(this.ActSelfChangeWeapon));
 }