Наследование: MonoBehaviour
    private IEnumerator applyPunchForce(Vector2 punchForce)
    {
        Vector2 tempPunchForce = punchForce;
        bool    isTempForceLow = false;

        CamManager.PunchShake(tempPunchForce.magnitude);
        while (tempPunchForce.magnitude > 0.01f)
        {
            velocity      += tempPunchForce;
            tempPunchForce = Vector2.Lerp(tempPunchForce, Vector2.zero, PunchForceDecel);

            if (!isTempForceLow &&
                tempPunchForce.magnitude < punchForce.magnitude * PunchDisablePerc)
            {
                isTempForceLow = true;
                //if the force goes below 25%, let the character move again.
                punchForceApplied = false;
            }
            else if (!isTempForceLow)
            {
                punchForceApplied = true;
            }
            yield return(null);
        }
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            CamManager cameraManager = GameCamera.GetComponent <CamManager>();

            Transform cameraTarget = cameraManager.Target;

            int      index;
            spider[] insects = GameObject.FindObjectsOfType <spider>();

            if (cameraTarget == null)
            {
                index = 0;
            }
            else
            {
                index = Array.FindIndex(insects, insect => insect.transform == cameraTarget);
                index++;
                if (index == insects.Length)
                {
                    index = 0;
                }
            }

            cameraManager.SetTarget(insects[index].transform);
        }
        if (Input.GetKeyDown(KeyCode.C))
        {
            ToggleColliderVisible();
        }
    }
        static void Postfix(MainSettingsModelSO ____mainSettingsModel)
        {
            useDepthTexture = ____mainSettingsModel.smokeGraphicsSettings;

            if (!isInited)
            {
                if (CamManager.baseCullingMask == 0)
                {
                    CamManager.baseCullingMask = Camera.main.cullingMask;
                }

                isInited = true;

                Plugin.Log.Notice("Game is ready, Initializing...");

                CamManager.Init();
            }
            else
            {
                foreach (var cam in CamManager.cams.Values)
                {
                    cam.UpdateDepthTextureActive();
                }
            }
        }
        static void Postfix()
        {
#if DEBUG
            Plugin.Log.Info("AudioTimeSyncController.Pause/Resume()");
#endif
            CamManager.ApplyCameraValues(worldCam: true);
        }
Пример #5
0
        public static void OnActiveSceneChanged(Scene oldScene, Scene newScene)
        {
            if (newScene == null)
            {
                return;
            }

            currentScene = newScene;
            isInSong     = newScene.name == "GameCore";
            isInMenu     = !isInSong && menuSceneNames.Contains(newScene.name);

            if (oldScene.name == "GameCore")
            {
#if DEBUG
                Plugin.Log.Info("oldScene = GameCore, resetting stuffs in SceneUtil");
#endif

                ScoresaberUtil.isInReplay = false;
                HookLeveldata.Reset();
                audioTimeSyncController = null;
            }

            ScenesManager.ActiveSceneChanged();

            // Updating the bitmask on scene change to allow for things like the auto wall toggle
            CamManager.ApplyCameraValues(bitMask: true, worldCam: true, posRot: true);
        }
Пример #6
0
    public void DisablePanel()
    {
        building.GetComponent <Building>().showMenu = false;
        CamManager manager = GameObject.FindObjectOfType <CamManager>();

        manager.ActivateCamera(manager.MainCam);
    }
Пример #7
0
 private void Start()
 {
     if (cam == null)
     {
         cam = GameObject.FindWithTag("CamManager").GetComponent <CamManager>();
     }
     viewport = GetComponent <SpriteRenderer>();
 }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     //get script camm manager on it
     CamMngr = gameObject.GetComponent <CamManager>();
     Init();
     //Set Player Destination
     GoToNextPosition();
 }
Пример #9
0
        public TestForm()
        {
            InitializeComponent();

            var techProcessService = new CamManager(new AcadGatewayMock(listBox));

            techProcessView.Init(techProcessService);
            techProcessService.ProgramGenerated += (object sender, ProgramEventArgs e) => programView.ShowProgram(e.Program);
        }
Пример #10
0
 void Start()
 {
     _instance      = this;
     Cams[0].Active = true;
     for (int i = 1; i < Cams.Length; i++)
     {
         Cams[i].Active = false;
     }
 }
Пример #11
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Пример #12
0
 private void Update()
 {
     if (isManagerFound != true)
     {
         if (GameObject.FindGameObjectWithTag("CamManager").GetComponent <CamManager>() != null)
         {
             camManagerScript = GameObject.FindGameObjectWithTag("CamManager").GetComponent <CamManager>();
             isManagerFound   = true;
         }
     }
 }
Пример #13
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         _instance = new CamManager();
     }
     else
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Пример #14
0
    void OnTriggerExit2D(Collider2D col)
    {
        bool isOutsideWall = !col.IsTouching(GetComponentInChildren <Collider2D>());

        if (col.tag == "DeathWall" && isOutsideWall)
        {
            myAudioSrc.Play();
            CamManager.DeathShake(CamManager.GetTarget().name == gameObject.name);

            OnDeath(lastHitBy, ID);
        }
    }
Пример #15
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else
     if (this != _instance)
     {
         Destroy(this.gameObject);
     }
 }
Пример #16
0
 public void EndDungeon()
 {
     if (endQuest)
     {
         StartCoroutine(questComplete());
         return;
         // EndQuest();
         // change to IENumerator that says congrats on finishing quest
     }
     camera = FindObjectOfType <CamManager>();
     // SceneManager.LoadScene("Map");
     camera.switchMap();
 }
Пример #17
0
    private void activateSpectatingMode()
    {
        Yes.SetActive(false);
        No.SetActive(false);

        transform.GetChild(0).gameObject.SetActive(true);
        ReadyGUI.GetComponent <Text>().text = "Spectating . . .";
        PercentReady.text = "";
        for (int i = 0; i < RoomSlotImages.Length; i++)
        {
            RoomSlotImages[i].transform.gameObject.SetActive(false);
        }

        CamManager.SetTarget(null);
    }
Пример #18
0
 public TouchInput() : base(GameRoot.Instance)
 {
     camManager  = CamManager.Instance;
     PressedKeys = new GameKey[1];
     switch (Device.Instance.DeviceType)
     {
     case DType.Android:
     case DType.IOS:
     case DType.Win10_Phone:
         IsConnected = true;
         Game.Components.Add(this);
         break;
     }
     ClearInput();
 }
Пример #19
0
 public void NextDungeon()
 {
     PlayerPrefs.SetFloat("Party Position x", 0f);
     // if (num_quest_rooms == 1) {
     // if (endQuest) {
     //     EndQuest();
     // } else {
     camera = FindObjectOfType <CamManager>();
     // num_quest_rooms -= 1;
     // int rand_dungeon = Random.Range(0, num_dungeons);
     // SceneManager.LoadScene(possible_dungeons[rand_dungeon]);
     FindObjectOfType <PartyController>().updateStartPos();
     camera.switchDungeon();
     // }
 }
    void Awake()
    {
        isFrozen = false;
        //DontDestroyOnLoad(gameObject);
        anim            = GetComponentInChildren <Animator>();
        moveRight       = 0;
        moveLeft        = 0;
        controlsPaused  = false;
        myAudioSrc      = GetComponent <AudioSource>();
        myAudioSrc.clip = DeathNoise;
        punching        = false;

        isDead        = false;
        StrengthsList = GameObject.FindGameObjectWithTag("Master").
                        GetComponent <Master>().GetStrengthList();

        CBUG.Log("Str List: " + StrengthsList.ToStringFull());
        jumpForceTemp      = 0f;
        SpeedTemp          = 0f;
        attackDisableDelay = new WaitForSeconds(AttackLife);
        facingRight        = true;
        position           = new Vector2();
        _Rigibody2D        = GetComponent <Rigidbody2D>();
        jumpsRemaining     = TotalJumpsAllowed;
        _PhotonView        = GetComponent <PhotonView>();
        _PhotonTransform   = GetComponent <PhotonTransformView>();

        AttackObjs    = new GameObject[3];
        AttackObjs[0] = transform.GetChild(3).gameObject;
        AttackObjs[1] = transform.GetChild(1).gameObject;
        AttackObjs[2] = transform.GetChild(2).gameObject;

        _MobileInput = GameObject.FindGameObjectWithTag("MobileController").GetComponent <MobileController>();

        spawnPause     = 0.5f;
        spawnPauseWait = new WaitForSeconds(spawnPause);

        lastHitBy           = -1;
        lastHitTime         = Time.time;
        lastHitForgetLength = 5;//Seconds

        if (_PhotonView.isMine)
        {
            tag = "PlayerSelf";
            _PhotonView.RPC("SetSlotNum", PhotonTargets.All, NetIDs.PlayerNumber(PhotonNetwork.player.ID));
            CamManager.SetTarget(transform);
        }
    }
Пример #21
0
    override public void OnInspectorGUI()
    {
        CamManager man = target as CamManager;

        DrawDefaultInspector();

        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("ProjectionMode");
        man.ProjectionMode = (ProjectionMode)EditorGUILayout.EnumPopup(man.ProjectionMode);
        EditorGUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Eye Separation");
        man.EyeSeparation = EditorGUILayout.FloatField(man.EyeSeparation);
        GUILayout.EndHorizontal();
    }
Пример #22
0
    void OnTriggerExit2D(Collider2D col)
    {
        if (col.tag != "DeathWall")
        {
            return;
        }
        myAudioSrc.Play();
        CamManager.DeathShake(_PhotonView.isMine);

        if (!_PhotonView.isMine)
        {
            return;
        }

        _PhotonView.RPC("OnDeath", PhotonTargets.All, lastHitBy, SlotNum);
    }
    void OnTriggerExit2D(Collider2D col)
    {
        bool isOutsideWall = !col.IsTouching(GetComponentInChildren <Collider2D>());

        if (col.tag == "DeathWall" && isOutsideWall)
        {
            myAudioSrc.Play();
            CamManager.DeathShake(CamManager.GetTarget().name == gameObject.name);

            if (!_PhotonView.isMine)
            {
                return;
            }

            _PhotonView.RPC("OnDeath", PhotonTargets.All, lastHitBy, SlotNum);
        }
    }
Пример #24
0
    private void Start()
    {
        SendCamTexture  = false;
        CamQuality      = 3;
        CarStatusObject = GameObject.Find("CarStatusObject");

        objcarDevice = CarStatusObject.GetComponent <ObjectCarDevice>();
        tracerObj    = CarStatusObject.GetComponent <GPSTracerObj>();

        baseCarDivice = objcarDevice.Basecardivice;
        camManager    = GameObject.Find("CamManager").GetComponent <CamManager>();

        socketObj               = GameObject.Find("NetworkManager(Clone)").GetComponent <SocketObj>();
        clientSender            = socketObj.socketClient;
        socketObj.OnDataInvoke += SocketObj_OnDataInvoke;
        StartCoroutine(SendInitData());
    }
Пример #25
0
    // Use this for initialization
    void Start()
    {
        //get script camm manager on it
        CamMngr = gameObject.GetComponent <CamManager>();
        Init();

        //Set Player Destination
        GoToNextPosition();

        tutoText = tutoImage.transform.GetChild(0).gameObject.GetComponent <Text>();

        DeactivateMeshRenderer("PtDecouvert");
        DeactivateMeshRenderer("CheckPoint");
        DeactivateMeshRenderer("Respawn");

        gameStartTime = DateTime.Now;
    }
Пример #26
0
 /// <summary>
 /// Starts the server. (immer, ausser wenn CaveClient)
 /// </summary>
 public void startServer(bool withSocket = true)
 {
     try
     {
         Logger.Log("Game: Starte Server " + (withSocket ? "mit Netzwerk." : "ohne Netzwerk."));
         if (withSocket)
         {
             CamManager cm = GameObject.Find("CAVEStereoHeadNew").GetComponent <CamManager>();
             Network.InitializeServer(cm.camsPerGroup * cm.camGroups.Length + Config.Instance.additionalPlayerCount, Config.Instance.caveGameServerPort, false);
         }
         __client = null;
         __server = new Server(this, Config.Instance.IsStandalone);
     }
     catch (Exception e)
     {
         Logger.LogException(e);
     }
 }
Пример #27
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this);
        }

        allCams = FindObjectsOfType <Camera>();
        for (int i = 0; i < allCams.Length; i++)
        {
            cameras.Add(allCams[i]);
        }
        UseCam(cameras[currentCameraIndex]);
        UpdateTextUI();
    }
Пример #28
0
        public static void SongStarted(AudioTimeSyncController controller)
        {
            audioTimeSyncController = controller;
            ScoresaberUtil.UpdateIsInReplay();

            TransparentWalls.MakeWallsOpaqueForMainCam();
            CamManager.ApplyCameraValues(worldCam: true);

            if (CamManager.cams.Values.Any(x => !x.settings.visibleObjects.Floor))
            {
                // Move the plattform stuff to the correct layer because beat games didnt
                foreach (var x in (new string[] { "Construction", "Frame", "RectangleFakeGlow" }).Select(x => GameObject.Find($"Environment/PlayersPlace/{x}")))
                {
                    if (x != null)
                    {
                        x.layer = (int)VisibilityLayers.PlayerPlattform;
                    }
                }
            }
        }
Пример #29
0
    private void Awake()
    {
        gamMan                 = Resources.Load <GameManager>("GameManager");
        camMan                 = Resources.Load <CamManager>("CamManagement");
        gamMan.jogoComecou     = false;
        camMan.camsPriority[0] = 10;
        camMan.camsPriority[1] = 15;
        camMan.camsPriority[2] = 10;
        camMan.camsPriority[3] = 10;


        gamMan.fogoSala    = false;
        gamMan.luzSala     = false;
        gamMan.luzCozinha  = false;
        gamMan.fogoCozinha = false;

        gamMan.inMinigame = false;
        gamMan.iniciou    = false;
        //Debug.Log("ah meu");
    }
Пример #30
0
    void Update()
    {
        UpdateHurt();
        if (CamManager.GetTarget().gameObject.name != gameObject.name)
        {
            return;
        }

        //CBUG.Log("OOOH I AM" + name);
        //Jump Detection Only, no physics handling.
        if (controlsPaused)
        {
            moveLeft  = 0;
            moveRight = 0;
            return;
        }

        updateSpecials();
        updateJumping();
        updateDownJumping();
        updateAttacks();
        updateMovement();
    }
Пример #31
0
            public bool init()
            {
                // Start with a new root to get this party started
                root = new Root();

                // Configuration buisness
                ConfigFile config = new ConfigFile();
                config.Load("resources.cfg", "\t:=", true);

                // Go through all our configuration settings
                ConfigFile.SectionIterator itor = config.GetSectionIterator();
                string secName, typeName, archName;

                // Move through all of the sections
                while (itor.MoveNext())
                {
                  secName = itor.CurrentKey;
                  ConfigFile.SettingsMultiMap settings = itor.Current;
                  foreach (KeyValuePair<string, string> pair in settings)
                  {
                typeName = pair.Key;
                archName = pair.Value;
                ResourceGroupManager.Singleton.AddResourceLocation(archName, typeName, secName);
                  }
                }

                // Configure our window and set up the RenderSystem
                bool found = false;
                foreach (RenderSystem rs in root.GetAvailableRenderers())
                {
                  root.RenderSystem = rs;
                  string rname = root.RenderSystem.Name;
                  if (rname == "Direct3D9 Rendering Subsystem")
                  {
                found = true;
                break;
                  }
                }

                // If we can't find the DirectX rendering system somethign is seriously wrong
                if (!found)
                  return false;

                root.RenderSystem.SetConfigOption("Full Screen", "No");
                root.RenderSystem.SetConfigOption("Video Mode", "640 x 480 @ 32-bit colour");

                root.Initialise(false);
                NameValuePairList misc = new NameValuePairList();
                misc["externalWindowHandle"] = hWnd.ToString();
                window = root.CreateRenderWindow("Simple Mogre Form Window", 0, 0, false, misc);
                ResourceGroupManager.Singleton.InitialiseAllResourceGroups();

                // Create our SceneManager
                sceneMgr = root.CreateSceneManager(SceneType.ST_GENERIC, "SceneMgr");
                sceneMgr.AmbientLight = new ColourValue(0.5f, 0.5f, 0.5f);
                sceneMgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE;

                // Create the camera
                camMgr = new CamManager();
                camMgr.Initialize(ref sceneMgr);

                viewport = window.AddViewport(camMgr.mainCam);
                viewport.BackgroundColour = new ColourValue(0, 0, 0, 1);

                // Load our stick here
                LoadModel("TEStick.mesh");

                // Set up ground
                Plane plane = new Plane(Mogre.Vector3.UNIT_Y, 0);
                MeshManager.Singleton.CreatePlane("ground", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, plane,
                  1500, 1500, 20, 20, true, 1, 5, 5, Mogre.Vector3.UNIT_Z);
                Entity ground = sceneMgr.CreateEntity("GroundEnt", "ground");
                sceneMgr.RootSceneNode.CreateChildSceneNode().AttachObject(ground);

                ground.SetMaterialName("Examples/Rockwall");
                ground.CastShadows = false;

                // Set up some lights
                Light pointLight = sceneMgr.CreateLight("pointLight");
                pointLight.Type = Light.LightTypes.LT_POINT;
                pointLight.Position = new Mogre.Vector3(0, 150, 250);
                pointLight.DiffuseColour = ColourValue.White;
                pointLight.SpecularColour = ColourValue.White;

                Light directionalLight = sceneMgr.CreateLight("directionalLight");
                directionalLight.Type = Light.LightTypes.LT_DIRECTIONAL;
                directionalLight.DiffuseColour = new ColourValue(.25f, .25f, 0);
                directionalLight.SpecularColour = new ColourValue(.25f, .25f, 0);
                directionalLight.Direction = new Mogre.Vector3(0, -1, 1);

                Light spotLight = sceneMgr.CreateLight("spotLight");
                spotLight.Type = Light.LightTypes.LT_SPOTLIGHT;
                spotLight.DiffuseColour = ColourValue.White;
                spotLight.SpecularColour = ColourValue.White;
                spotLight.Direction = new Mogre.Vector3(-1, -1, 0);
                spotLight.Position = new Mogre.Vector3(300, 300, 0);
                spotLight.SetSpotlightRange(new Degree(35), new Degree(50));

                // Set up our Input
                root.FrameRenderingQueued += new FrameListener.FrameRenderingQueuedHandler(Input);

                // Set up for picking
                raySceneQuery = sceneMgr.CreateRayQuery(new Ray(), SceneManager.WORLD_GEOMETRY_TYPE_MASK);
                if (null == raySceneQuery)
                  return false;
                raySceneQuery.SetSortByDistance(true);

                return true;
            }