コード例 #1
0
 void OnSetState(TankControlState ts)
 {
     tankControlState = ts;
     head.SendMessage("OnSetState", tankControlState, SendMessageOptions.DontRequireReceiver);
     if (tankControlState == TankControlState.Manual)
     {
         GlobalInfo.playerViewID          = networkView.viewID;
         GlobalInfo.userInfo.playerViewID = networkView.viewID;
         GlobalInfo.myPlayer = gameObject;
         if (Network.isServer)
         {
             GlobalInfo.userInfoList[0].equipment    = GlobalInfo.userInfo.equipment;
             GlobalInfo.userInfoList[0].isReady      = true;
             GlobalInfo.userInfoList[0].destroyed    = false;
             GlobalInfo.userInfoList[0].playerViewID = GlobalInfo.playerViewID;
             GlobalInfo.eventHandler.SendMessage("OnUpdateUserList", SendMessageOptions.DontRequireReceiver);
         }
         else
         {
             GlobalInfo.rpcControl.RPC("OnRegistUserEquipRPC", RPCMode.Server, GlobalInfo.userInfo.name, (int)GlobalInfo.userInfo.equipment, true, GlobalInfo.playerViewID);
         }
         Camera.main.gameObject.GetComponent <AudioListener>().enabled = true;
         Camera.main.gameObject.GetComponent <MotionBlur>().enabled    = false;
         GlobalInfo.specialCamState = false;
         GlobalInfo.camPosState     = 0;
     }
     else
     {
         GlobalInfo.rpcControl.RPC("OnRegistUserEquipRPC", RPCMode.Server, nam, (int)GetComponent <TankShellAttackedBehaviour>().equipKind, true, networkView.viewID);
     }
     stateSetFlag = true;
 }
 void OnSetState(TankControlState ts)
 {
     tankControlState = ts;
     if (tankControlState == TankControlState.AutoDrive)
     {
         GetComponent <TankSpecialCameraController>().enabled = false;
         GetComponent <TankCanonBehaviour>().enabled          = false;
         foreach (UserInfoClass a in GlobalInfo.userInfoList)
         {
             if (a.playerViewID.Equals(networkView.viewID))
             {
                 nam = a.name;
             }
         }
     }
     else
     {
         aimCross                = (Texture)Resources.Load("GUI/GunSights/TankGunSight");
         v_AimCross              = (Texture)Resources.Load("GUI/GunSights/W_1");
         h_AimCross              = (Texture)Resources.Load("GUI/GunSights/W_2");
         aimCrossPos             = new Vector2(Screen.width / 2.0f, Screen.height / 2.0f);
         camPos                  = Camera.main.transform;
         GlobalInfo.playerCamera = Camera.main;
         sm          = camPos.GetComponent <SmoothFollow>();
         sm.enabled  = true;
         sm.target   = transform;
         sm.distance = camDistance;
         sm.height   = camHeight;
         df          = camPos.GetComponent <DepthOfField34>();
         df.enabled  = false;
         urc         = camPos.GetComponent <UltraRedRayCamera>();
         urc.enabled = false;
         Camera.main.SendMessage("OnSetWather", SendMessageOptions.DontRequireReceiver);
         gf = camPos.GetComponent <GlobalFog>();
         GameObject go = GameObject.Find("Snow");
         if (go != null)
         {
             for (int i = 0; i < 4; i++)
             {
                 camPos.GetChild(i).particleEmitter.emit = true;
             }
         }
         go = GameObject.Find("Rain");
         if (go != null)
         {
             for (int i = 0; i < 4; i++)
             {
                 camPos.GetChild(i).particleEmitter.emit = true;
             }
         }
     }
 }
コード例 #3
0
 void OnSetState(TankControlState ts)
 {
     tankControlState = ts;
 }