示例#1
0
 private void Start()
 {
     instance  = this;
     isPausing = false;
     invertY   = (int)FengGameManagerMKII.settings[0x142];
     this.setDayLight(dayLight);
     this.locker    = CachingsGM.Find("locker");
     cameraTilt     = (int)FengGameManagerMKII.settings[0x141];
     cameraDistance = FengGameManagerMKII.instance.distanceSlider + 0.3f;
     this.createSnapShotRT2();
     this.isOn = true;
 }
示例#2
0
 public void setHUDposition()
 {
     CachingsGM.Find <Transform>("Flare").localPosition = new Vector3((float)(((int)(-Screen.width * 0.5f)) + 14), (float)((int)(-Screen.height * 0.5f)), 0f);
     CachingsGM.Find <Transform>("LabelInfoBottomRight").localPosition = new Vector3((float)((int)(Screen.width * 0.5f)), (float)((int)(-Screen.height * 0.5f)), 0f);
     CachingsGM.Find <Transform>("LabelInfoTopCenter").localPosition   = new Vector3(0f, (float)((int)(Screen.height * 0.5f)), 0f);
     CachingsGM.Find <Transform>("LabelInfoTopRight").localPosition    = new Vector3((float)((int)(Screen.width * 0.5f)), (float)((int)(Screen.height * 0.5f)), 0f);
     CachingsGM.Find <Transform>("LabelNetworkStatus").localPosition   = new Vector3((float)((int)(-Screen.width * 0.5f)), (float)((int)(Screen.height * 0.5f)), 0f);
     CachingsGM.Find <Transform>("LabelInfoTopLeft").localPosition     = new Vector3((float)((int)(-Screen.width * 0.5f)), (float)((int)((Screen.height * 0.5f) - 20f)), 0f);
     CachingsGM.Find <Transform>("Chatroom").localPosition             = new Vector3((float)((int)(-Screen.width * 0.5f)), (float)((int)(-Screen.height * 0.5f)), 0f);
     if (InRoomChat.instance != null)
     {
         InRoomChat.instance.setPosition();
     }
     if (usingTitan && (gametype != GAMETYPE.SINGLE))
     {
         Vector3 vector = new Vector3(0f, 9999f, 0f);
         CachingsGM.Find <Transform>("skill_cd_bottom").localPosition      = vector;
         CachingsGM.Find <Transform>("skill_cd_armin").localPosition       = vector;
         CachingsGM.Find <Transform>("skill_cd_eren").localPosition        = vector;
         CachingsGM.Find <Transform>("skill_cd_jean").localPosition        = vector;
         CachingsGM.Find <Transform>("skill_cd_levi").localPosition        = vector;
         CachingsGM.Find <Transform>("skill_cd_marco").localPosition       = vector;
         CachingsGM.Find <Transform>("skill_cd_mikasa").localPosition      = vector;
         CachingsGM.Find <Transform>("skill_cd_petra").localPosition       = vector;
         CachingsGM.Find <Transform>("skill_cd_sasha").localPosition       = vector;
         CachingsGM.Find <Transform>("GasUI").localPosition                = vector;
         CachingsGM.Find <Transform>("stamina_titan").localPosition        = new Vector3(-160f, (float)((int)((-Screen.height * 0.5f) + 15f)), 0f);
         CachingsGM.Find <Transform>("stamina_titan_bottom").localPosition = new Vector3(-160f, (float)((int)((-Screen.height * 0.5f) + 15f)), 0f);
     }
     else
     {
         CachingsGM.Find <Transform>("skill_cd_bottom").localPosition      = new Vector3(0f, (float)((int)((-Screen.height * 0.5f) + 5f)), 0f);
         CachingsGM.Find <Transform>("GasUI").localPosition                = CachingsGM.Find("skill_cd_bottom").transform.localPosition;
         CachingsGM.Find <Transform>("stamina_titan").localPosition        = new Vector3(0f, 9999f, 0f);
         CachingsGM.Find <Transform>("stamina_titan_bottom").localPosition = new Vector3(0f, 9999f, 0f);
     }
     if ((this.main_object != null) && (this.main_objectH != null))
     {
         if (gametype == GAMETYPE.SINGLE)
         {
             this.main_objectH.setSkillHUDPosition2();
         }
         else if ((this.main_objectH.photonView != null) && this.main_objectH.photonView.isMine)
         {
             this.main_objectH.setSkillHUDPosition2();
         }
     }
     if (stereoType == STEREO_3D_TYPE.SIDE_BY_SIDE)
     {
         base.gameObject.GetComponent <Camera>().aspect = Screen.width / Screen.height;
     }
     this.createSnapShotRT2();
 }
示例#3
0
 private void Awake()
 {
     isTyping               = false;
     isPausing              = false;
     base.name              = "MainCamera";
     instance               = this;
     this.baseT             = Camera.main.transform;
     this.baseR             = Camera.main.rigidbody;
     this.Smov              = base.GetComponent <SpectatorMovement>();
     this.mouselook         = base.GetComponent <MouseLook>();
     this.camLght           = CachingsGM.Find("mainLight").GetComponent <Light>();
     this.skybox            = base.GetComponent <Skybox>();
     this.tiltShift         = base.GetComponent <TiltShift>();
     this.tiltShift.enabled = false;
     this.CreateMinimap();
 }
示例#4
0
    public void update2()
    {
        if (this.flashDuration > 0f)
        {
            this.flashDuration -= Time.deltaTime;
            if (this.flashDuration <= 0f)
            {
                this.flashDuration = 0f;
            }
            (flash != null ? flash : flash = CachingsGM.Find("flash").GetComponent <UISprite>()).alpha = this.flashDuration * 0.5f;
        }
        if (gametype == GAMETYPE.STOP)
        {
            Screen.showCursor = true;
            Screen.lockCursor = false;
        }
        else
        {
            if ((gametype != GAMETYPE.SINGLE) && this.gameOver)
            {
                if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_attack1))
                {
                    if (this.spectatorMode)
                    {
                        this.setSpectorMode(false);
                    }
                    else
                    {
                        this.setSpectorMode(true);
                    }
                }
                if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_flare1))
                {
                    int num = FengGameManagerMKII.instance.allheroes.Count;
                    if (num > 0)
                    {
                        this.currentPeekPlayerIndex = currentPeekPlayerIndex + 1;

                        if (this.currentPeekPlayerIndex >= num)
                        {
                            this.currentPeekPlayerIndex = 0;
                        }
                        this.setMainObject(FengGameManagerMKII.instance.allheroes[this.currentPeekPlayerIndex], true, false);

                        this.setSpectorMode(false);
                        this.lockAngle = false;
                    }
                }
                if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_flare2))
                {
                    int num2 = FengGameManagerMKII.instance.allheroes.Count;
                    if (num2 > 0)
                    {
                        this.currentPeekPlayerIndex = currentPeekPlayerIndex - 1;
                        if (this.currentPeekPlayerIndex < 0)
                        {
                            this.currentPeekPlayerIndex = num2 - 1;
                        }
                        this.setMainObject(FengGameManagerMKII.instance.allheroes[this.currentPeekPlayerIndex], true, false);
                        this.setSpectorMode(false);
                        this.lockAngle = false;
                    }
                }
                if (this.spectatorMode)
                {
                    return;
                }
            }
            if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_pause))
            {
                if (isPausing)
                {
                    if (this.main_object != null)
                    {
                        Vector3 position = this.baseT.position;
                        position            = (this.head == null) ? this.main_objectT.position : this.head.transform.position;
                        position           += (Vector3)(Vector3.up * this.heightMulti);
                        this.baseT.position = Vector3.Lerp(this.baseT.position, position - ((Vector3)(this.baseT.forward * 5f)), 0.2f);
                    }
                    return;
                }
                isPausing = !isPausing;
                if (isPausing)
                {
                    if (gametype == GAMETYPE.SINGLE)
                    {
                        Time.timeScale = 0f;
                    }
                    FengGameManagerMKII.instance.MenuOn = true;
                    Screen.showCursor = true;
                    Screen.lockCursor = false;
                }
            }
            if (this.needSetHUD)
            {
                this.needSetHUD = false;
                this.setHUDposition();
                Screen.lockCursor = !Screen.lockCursor;
                Screen.lockCursor = !Screen.lockCursor;
            }
            if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_fullscreen))
            {
                Screen.fullScreen = !Screen.fullScreen;
                if (Screen.fullScreen)
                {
                    Screen.SetResolution(960, 600, false);
                }
                else
                {
                    Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, true);
                }
                this.needSetHUD = true;
                Minimap.OnScreenResolutionChanged();
            }
            if (FengGameManagerMKII.inputRC.isInputCustomKey(InputCode.custom_restart))
            {
                this.reset();
            }
            if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_hideCursor))
            {
                Screen.showCursor = !Screen.showCursor;
            }
            if (this.main_object != null)
            {
                RaycastHit hit;
                if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_camera))
                {
                    cameraMode = this.chageCamera();
                    this.verticalRotationOffset = 0f;
                    if ((((int)FengGameManagerMKII.settings[0xf5]) == 1) || (this.main_object.GetComponent <HERO>() == null))
                    {
                        Screen.showCursor = false;
                    }
                }

                if (FengGameManagerMKII.inputRC.isInputCustomKeyDown(InputCode.custom_focus))
                {
                    triggerAutoLock = !triggerAutoLock;
                    if (triggerAutoLock)
                    {
                        this.lockTarget = this.findNearestTitan();
                        if (this.closestDistance >= 150f)
                        {
                            this.lockTarget = null;
                            triggerAutoLock = false;
                        }
                    }
                }
                if (this.gameOver && (this.main_object != null))
                {
                    if (this.main_objectT == null)
                    {
                        this.main_objectT = this.main_object.transform;
                    }
                    if (FengGameManagerMKII.inputRC.isInputHumanDown(InputCodeRC.liveCam))
                    {
                        if (((int)FengGameManagerMKII.settings[0x107]) == 0)
                        {
                            FengGameManagerMKII.settings[0x107] = 1;
                        }
                        else
                        {
                            FengGameManagerMKII.settings[0x107] = 0;
                        }
                    }

                    if (((main_objectH != null) && (((int)FengGameManagerMKII.settings[0x107]) == 1)) && (main_objectH.smoothSyncMovement.enabled && main_objectH.isPhotonCamera))
                    {
                        this.CameraMovementLive(main_objectH);
                    }
                    else if (this.lockAngle)
                    {
                        this.baseT.rotation = Quaternion.Lerp(this.baseT.rotation, this.main_objectT.rotation, 0.2f);
                        this.baseT.position = Vector3.Lerp(this.baseT.position, this.main_objectT.position - ((Vector3)(this.main_objectT.forward * 5f)), 0.2f);
                    }
                    else
                    {
                        this.camareMovement();
                    }
                }
                else
                {
                    this.camareMovement();
                }
                if (triggerAutoLock && (this.lockTarget != null))
                {
                    float     z         = this.baseT.eulerAngles.z;
                    Transform transform = this.lockTarget.transform.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck");
                    Vector3   vector2   = transform.position - ((this.head == null) ? this.main_objectT.position : this.head.transform.position);
                    vector2.Normalize();
                    this.lockCameraPosition  = (this.head == null) ? this.main_objectT.position : this.head.transform.position;
                    this.lockCameraPosition -= (Vector3)(((vector2 * this.distance) * this.distanceMulti) * this.distanceOffsetMulti);
                    this.lockCameraPosition += (Vector3)(((Vector3.up * 3f) * this.heightMulti) * this.distanceOffsetMulti);
                    this.baseT.position      = Vector3.Lerp(this.baseT.position, this.lockCameraPosition, Time.deltaTime * 4f);
                    if (this.head != null)
                    {
                        this.baseT.LookAt((Vector3)((this.head.transform.position * 0.8f) + (transform.position * 0.2f)));
                    }
                    else
                    {
                        this.baseT.LookAt((Vector3)((this.main_objectT.position * 0.8f) + (transform.position * 0.2f)));
                    }
                    this.baseT.localEulerAngles = new Vector3(this.baseT.eulerAngles.x, this.baseT.eulerAngles.y, z);
                    Vector2 vector3 = base.camera.WorldToScreenPoint(transform.position - ((Vector3)(transform.forward * this.lockTarget.transform.localScale.x)));
                    this.locker.transform.localPosition = new Vector3(vector3.x - (Screen.width * 0.5f), vector3.y - (Screen.height * 0.5f), 0f);
                    if ((this.lockTarget.GetComponent <TITAN>() != null) && this.lockTarget.GetComponent <TITAN>().hasDie)
                    {
                        this.lockTarget = null;
                    }
                }
                else
                {
                    this.locker.transform.localPosition = new Vector3(0f, (-Screen.height * 0.5f) - 50f, 0f);
                }
                Vector3 end        = (this.head == null) ? this.main_objectT.position : this.head.transform.position;
                Vector3 vector5    = ((this.head == null) ? this.main_objectT.position : this.head.transform.position) - this.baseT.position;
                Vector3 normalized = vector5.normalized;
                end -= (Vector3)((this.distance * normalized) * this.distanceMulti);
                LayerMask mask  = ((int)1) << LayerMask.NameToLayer("Ground");
                LayerMask mask2 = ((int)1) << LayerMask.NameToLayer("EnemyBox");
                LayerMask mask3 = mask | mask2;
                if (this.head != null)
                {
                    if (Physics.Linecast(this.head.transform.position, end, out hit, (int)mask))
                    {
                        this.baseT.position = hit.point;
                    }
                    else if (Physics.Linecast(this.head.transform.position - ((Vector3)((normalized * this.distanceMulti) * 3f)), end, out hit, (int)mask2))
                    {
                        this.baseT.position = hit.point;
                    }
                    Debug.DrawLine(this.head.transform.position - ((Vector3)((normalized * this.distanceMulti) * 3f)), end, Color.red);
                }
                else if (Physics.Linecast(this.main_objectT.position + Vector3.up, end, out hit, (int)mask3))
                {
                    this.baseT.position = hit.point;
                }
                this.shakeUpdate();
            }
        }
    }
示例#5
0
 public void flashBlind()
 {
     CachingsGM.Find("flash").GetComponent <UISprite>().alpha = 1f;
     this.flashDuration = 2f;
 }