Пример #1
0
        public CharacterCameraView(MonsterData monsterData, int width, int height)
        {
            GameObject gameObject = GUIManager.LoadCommonGUI("Render3D/Render3DRT", null);

            this.csRender3DRT = gameObject.GetComponent <CommonRender3DRT>();
            if (!monsterData.userMonster.IsEgg())
            {
                string filePath = MonsterObject.GetFilePath(monsterData.GetMonsterMaster().Group.modelId);
                this.csRender3DRT.LoadChara(filePath, 0f, 10000f, -0.65f, 1.1f, true);
                this.csRender3DRT.SetBillBoardCamera();
            }
            else
            {
                string eggModelId = MonsterObject.GetEggModelId(monsterData.userMonster.monsterEvolutionRouteId);
                string filePath2  = MonsterObject.GetFilePath(eggModelId);
                this.csRender3DRT.LoadEgg(filePath2, 0f, 10000f, 0.1f);
            }
            this.renderTex    = this.csRender3DRT.SetRenderTarget(width, height, 16);
            this.defaultPos   = Camera.main.ScreenToViewportPoint(new Vector3(-382f, -80f, 0f));
            this.defaultPos.x = -0.6f;
            this.orignal      = this.csRender3DRT.projectionMatrix;
            Matrix4x4 lhs = Matrix4x4.TRS(this.defaultPos, Quaternion.identity, Vector3.one);

            this.csRender3DRT.projectionMatrix = lhs * this.orignal;
            this.pinch = new PinchInOut();
        }
 public override void Initialize(Vector3 renderCameraPosition, int width, int height)
 {
     base.Initialize(renderCameraPosition, width, height);
     this.touchAreaCollider      = base.gameObject.GetComponent <BoxCollider>();
     this.viewerCameraController = new ViewerCameraController();
     this.pinch = new PinchInOut();
 }
        public override void OnPinth(PinchInOut pinch, GameObject characterGameObject)
        {
            CharacterParams component = characterGameObject.GetComponent <CharacterParams>();

            if (null != component && null != component.transform.parent)
            {
                float   value      = pinch.Value;
                Vector3 localScale = component.transform.localScale;
                if (value == 0f || (value < 0f && localScale.x <= 0.8f) || (value > 0f && localScale.x >= 1.2f))
                {
                    return;
                }
                float num = localScale.x + value / 500f;
                if (num < 0.8f)
                {
                    num = 0.8f;
                }
                else if (num > 1.2f)
                {
                    num = 1.2f;
                }
                component.transform.localScale = new Vector3(num, num, num);
            }
        }
Пример #4
0
 public abstract void OnPinth(PinchInOut pinch, GameObject characterGameObject);
 public override void OnPinth(PinchInOut pinch, GameObject characterGameObject)
 {
 }