Наследование: MonoBehaviour
Пример #1
0
 void Awake()
 {
     Instance = this;
     _baseScoreText = scoreText.text;
     _baseTimerText = timerText.text;
     _audioSource = GetComponent<AudioSource>();
 }
Пример #2
0
	// Use this for initialization
	void Start () {
		hudManager = GameObject.FindGameObjectWithTag("HudManager").GetComponent<HudManager>();
		killscores = new int[NetworkManager.GetPlayerList().Count];
		
		if(Network.isServer) {
			timeStartMatch = Time.time;
			networkView.RPC("SetStartTime", RPCMode.AllBuffered, timeStartMatch);
		}
		currentLevel = LevelManager.GetLoadedLevel();
	}
Пример #3
0
    void Awake()
    {
        if (_instance == null)
        {
            _instance = this;

        }
        else
        {
            Destroy(gameObject);
        }
    }
Пример #4
0
    void Awake()
    {
        if (manager == null)
        {
            manager = this;
            DontDestroyOnLoad(this.gameObject);
            
        }
        else if (manager != this)
        {
            Destroy(this.gameObject);
        }
        

    }
Пример #5
0
    /// <summary>
    /// Coroutine for the welcome text.
    /// Implement your welcome loop here.
    /// </summary>
    /// <returns>Yield instruction</returns>
    public override IEnumerator WelcomeLoop()
    {
        // First flag that we are in the welcome routine
        welcomeDone = false;
        inWelcome   = true;

        //
        HudManager.DisplayText("Look to the top right.");
        InstructionManager.DisplayText("Hi " + SaveSystem.ActiveUser.name + "! Welcome to the virtual world. \n\n (Press the trigger button to continue...)");
        yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.

        InstructionManager.DisplayText("Make sure you are standing on top of the green circle. \n\n (Press the trigger button to continue...)");
        yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.

        // Now that you are done, set the flag to indicate we are done.
        welcomeDone = true;
    }
Пример #6
0
 public static void Postfix(HudManager __instance)
 {
     /*var bodies = Object.FindObjectsOfType<DeadBody>();
      * foreach (var body in bodies)
      * {
      *  System.Console.WriteLine(body.ParentId);
      *  var player = PlayerControl.AllPlayerControls.ToArray().FirstOrDefault(x => x.PlayerId == body.ParentId);
      *  if (player != null)
      *  {
      *      if (player.Is(ModifierEnum.BigBoi))
      *      {
      *          body.transform.localScale = new Vector3(1.5f, 1.5f, 1f);
      *      }
      *  }
      *
      * }*/
 }
Пример #7
0
 public static void Postfix(HudManager __instance)
 {
     SheriffRole.sheriifKillButton = new CooldownButton(
         () =>
     {
         PlayerControl playerKilled = Utils.getClosestPlayer(PlayerControl.LocalPlayer);
         if (playerKilled == null)
         {
             return;
         }
         if (playerKilled.Data.IsImpostor)
         {
             PlayerControl.LocalPlayer.RpcMurderPlayer(playerKilled);
         }
         else
         {
             PlayerControl.LocalPlayer.RpcMurderPlayer(PlayerControl.LocalPlayer);
         }
     },
         PlayerControl.GameOptions.KillCooldown - 4,
         Properties.Resources.KillButton,
         new Vector2(-0.125f, 0.125f),
         () =>
     {
         if (PlayerControl.LocalPlayer.Data.IsDead)
         {
             return(false);
         }
         if (PlayerControl.LocalPlayer.Data.IsImpostor)
         {
             return(false);
         }
         if (!AmongUsClient.Instance.IsGameStarted)
         {
             return(false);
         }
         if (SheriffRole.sheriffID == PlayerControl.LocalPlayer.Data.PlayerId)
         {
             return(true);
         }
         return(false);
     },
         __instance
         );
 }
Пример #8
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public virtual void Update(GameTime gameTime)
        {
            if (CloseOnExit)
            {
                if (Keyboard.GetState().IsKeyDown(Keys.Escape))
                {
                    Exit();
                }
            }


            if (nextLevel != null)
            {
                loadLevel(nextLevel);
                nextLevel = null;
            }

            HudManager.update();

            if (!HudManager.ConsoleMode)
            {
                InputManager.update();
                InputSourceManager.update();
                LogManager.update();


                try
                {
                    ObjectManager.updateAll();
                }
                catch (Exception e)
                {
                    // Get stack trace for the exception with source file information
                    var st = new System.Diagnostics.StackTrace(e, true);
                    // Get the top stack frame
                    var frame = st.GetFrame(1);
                    // Get the line number from the stack frame
                    var line = frame.GetFileName() + " at " + frame.GetFileLineNumber();


                    LogManager.error(e.Source + ":: " + e.Message);
                    // HudManager.ConsoleMode = true;
                }
            }
        }
Пример #9
0
        public static void Postfix(HudManager __instance)
        {
            if (PlayerControl.AllPlayerControls.Count <= 1)
            {
                return;
            }
            if (PlayerControl.LocalPlayer == null)
            {
                return;
            }
            if (PlayerControl.LocalPlayer.Data == null)
            {
                return;
            }
            if (!PlayerControl.LocalPlayer.Is(RoleEnum.Swooper))
            {
                return;
            }
            var role = Role.GetRole <Swooper>(PlayerControl.LocalPlayer);

            if (role.SwoopButton == null)
            {
                role.SwoopButton = Object.Instantiate(__instance.KillButton, HudManager.Instance.transform);
                role.SwoopButton.renderer.enabled = true;
            }

            role.SwoopButton.renderer.sprite = SwoopSprite;
            role.SwoopButton.gameObject.SetActive(!PlayerControl.LocalPlayer.Data.IsDead && !MeetingHud.Instance);
            var position = __instance.KillButton.transform.localPosition;

            role.SwoopButton.transform.localPosition = new Vector3(position.x,
                                                                   __instance.ReportButton.transform.localPosition.y, position.z);

            if (role.IsSwooped)
            {
                role.SwoopButton.SetCoolDown(role.TimeRemaining, CustomGameOptions.SwoopDuration);
                return;
            }

            role.SwoopButton.SetCoolDown(role.CooldownTimer(), CustomGameOptions.SwoopCd);


            role.SwoopButton.renderer.color = Palette.EnabledColor;
            role.SwoopButton.renderer.material.SetFloat("_Desat", 0f);
        }
Пример #10
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            Instance = this;
        }

        tileManager     = FindObjectOfType <TileManager>();
        combatManager   = GetComponentInChildren <CombatManager>();
        inputController = FindObjectOfType <InputController>();
        hudManager      = FindObjectOfType <HudManager>();

        InitStateMachine();
    }
Пример #11
0
 public CooldownButton(Action OnClick, float Cooldown, string ImageEmbededResourcePath, float PixelsPerUnit,
                       Vector2 PositionOffset, Category category, HudManager hudManager, float EffectDuration, Action OnEffectEnd)
 {
     this.hudManager     = hudManager;
     this.OnClick        = OnClick;
     this.OnEffectEnd    = OnEffectEnd;
     this.PositionOffset = PositionOffset;
     this.EffectDuration = EffectDuration;
     this.category       = category;
     pixelsPerUnit       = PixelsPerUnit;
     MaxTimer            = Cooldown;
     Timer             = MaxTimer;
     ResourceName      = ImageEmbededResourcePath;
     hasEffectDuration = true;
     isEffectActive    = false;
     buttons.Add(this);
     this.Start();
 }
Пример #12
0
    //GameStart
    private void Start()
    {
        //Cleans all active rooms
        foreach (Room room in RoomList)
        {
            //room.gameObject.transform.position = new Vector3();
            room.gameObject.SetActive(false);
        }

        LoadRoom(_startingRoom);
        HudManager.OnRoomEnter(_startingRoom.RoomName);

        _mainPlayer.transform.position  = new Vector3(_currentRoom.PlayerSpawn.x, _mainPlayer.transform.position.y, _currentRoom.PlayerSpawn.y);
        _mainPlayer.transform.position += _currentRoom.transform.position;
        _mainPlayerCamera.CameraTarget  = _mainPlayer.transform.position;

        MainPlayerCamera.ResetCameraPos();
    }
Пример #13
0
 /// <summary>
 /// UnloadContent will be called once per game and is the place to unload
 /// all content.
 /// </summary>
 public virtual void UnloadContent()
 {
     try
     {
         LogManager.debug("SHUTTING DOWN MANAGERS");
         RenderManager.close();
         ObjectManager.close();
         ResourceManager.close();
         InputManager.close();
         HudManager.close();
         LogManager.debug("CLOSING");
         LogManager.close();
     }
     catch (Exception e)
     {
         // this is pure sin
     }
 }
Пример #14
0
 // Start is called before the first frame update
 void Start()
 {
     seed      = new int[9];
     maxHP     = 10;
     hp        = 10;
     gold      = 0;
     xp        = 0;
     rb        = GetComponent <Rigidbody2D>();
     moveSpeed = 5f;
     if (weapon != null)
     {
         weapon.InstantiateWeapon(this);
         weapon = GameObject.FindWithTag("Weapon").GetComponent <Weapon>();
     }
     xpToNextLvl = (weapon.level + 1) * 10;
     hm          = GameObject.FindWithTag("HUDManager").GetComponent <HudManager>();
     hm.UpdateXP(xp, xpToNextLvl);
 }
Пример #15
0
    public void ResetGame()
    {
        score        = 0;
        currentLevel = 1;

        if (hudManager != null)
        {
            hudManager.ResetHud();
        }
        else
        {
            hudManager = FindObjectOfType <HudManager>();
            hudManager.ResetHud();
        }


        SceneManager.LoadScene("Level1");
    }
Пример #16
0
        public void CheckRepairButton(HudManager instance)
        {
            if (player == null || player.PlayerId != PlayerControl.LocalPlayer.PlayerId ||
                !instance.UseButton.isActiveAndEnabled || player.Data.IsDead)
            {
                return;
            }

            KillButtonManager killButton = instance.KillButton;

            killButton.gameObject.SetActive(true);
            killButton.isActive         = true;
            killButton.renderer.enabled = true;
            killButton.SetCoolDown(0f, 1f);
            killButton.renderer.sprite = _specialButton;
            killButton.renderer.color  = Palette.EnabledColor;
            killButton.renderer.material.SetFloat("_Desat", 0f);
        }
Пример #17
0
 public static void MakeButtons(HudManager hm)
 {
     trackerButton = new CustomButton(
         () =>
     {
         target = currentTarget;
     },
         () => { return(target == null && PlayerControl.LocalPlayer.isRole(RoleType.EvilTracker) && PlayerControl.LocalPlayer.isAlive()); },
         () => { return(currentTarget != null && target == null && PlayerControl.LocalPlayer.CanMove); },
         () => { trackerButton.Timer = trackerButton.MaxTimer; },
         getTrackerButtonSprite(),
         new Vector3(-1.8f, -0.06f, 0),
         hm,
         hm.KillButton,
         KeyCode.F
         );
     trackerButton.buttonText = ModTranslation.getString("TrackerText");
 }
Пример #18
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        inputHandler = GameObject.Find("GameManager").GetComponent <InputHandler>();
        if (inputHandler == null)
        {
            Debug.LogError("Could not find InputHandler");
        }

        hudManager = GameObject.Find("HUD").GetComponent <HudManager>();
        if (hudManager == null)
        {
            Debug.LogError("Could not find HUD Manager");
        }

        mainCamera = Camera.main;
        if (mainCamera == null)
        {
            Debug.LogError("Camera missing");
        }

        curLevel = GameObject.Find("LevelManager_" + levelNum).GetComponent <LevelManager>();
        if (curLevel == null)
        {
            Debug.LogError("Current level manager is not set");
        }

        splashScreen = GameObject.Find("SplashScreen").GetComponent <SplashScreen>();
        if (splashScreen == null)
        {
            Debug.LogError("Spash screen is not set");
        }
        splashScreen.clearScore();
    }
Пример #19
0
        public override void ProcessClient()
        {
            switch (CommandType)
            {
            case PlayerMissionManage.AddMission:
                EconomyScript.Instance.ClientConfig.Missions.Add(Mission);
                Mission.AddGps();
                MyAPIGateway.Utilities.ShowMissionScreen("Mission", Mission.MissionId + " : ", Mission.GetName(), Mission.GetDescription(), null, "Yes Sir!");
                Mission.SeenBriefing = true;
                EconomyScript.Instance.ClientConfig.MissionId       = Mission.MissionId;
                EconomyScript.Instance.ClientConfig.LazyMissionText = Mission.GetName();
                HudManager.UpdateHud();
                break;

            default:
                //MessageClientTextMessage.SendMessage(SenderSteamId, "mission", (MissionId + "client side"));
                break;
            }
        }
Пример #20
0
        public override void PreUpdate(HudManager Manager, bool UseEnabled, bool Dead)
        {
            if (Protected == null)
            {
                return;
            }
            if (Player != null && !Player.Data.IsDead && !Protected.Data.IsDead)
            {
                return;
            }

            ExtraNetwork.Send(CustomRPC.ShieldBreak);

            var Material = Protected.myRend.material;

            Material.SetColor(Globals.VISOR_COLOR, Palette.VisorColor);
            Material.SetFloat(Globals.OUTLINE, 0f);
            Protected = null;
        }
    /// <summary>
    /// Coroutine for the experiment training.
    /// Implement your training loop here.
    /// </summary>
    /// <returns>Yield instruction</returns>
    public override IEnumerator TrainingLoop()
    {
        // First flag that we are in the training routine
        trainingDone = false;
        inTraining   = true;

        // Only run the training loop when requested, for instance some session may require different session.
        if (trainingPerSession[sessionNumber - 1] == 1)
        {
            //
            InstructionManager.DisplayText("This is training. You'll probably want to guide your subject through the task here! \n Press the trigger button to continue...");
            yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.

            //
            InstructionManager.DisplayText("Like... Punch the Cube!");
            yield return(new WaitForSecondsRealtime(5.0f));

            HudManager.DisplayText("What Cube???", 2.0f);
            yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.

            //
            HudManager.DisplayText("On your left, quick!!", 5.0f);
            if (isCubeAvailable != true)
            {
                isCubeAvailable = true;
                cubeGO.SetActive(true);
            }
            yield return(new WaitForSecondsRealtime(5.0f));

            HudManager.DisplayText("And it's gone...", 3.0f);
            isCubeAvailable = false;
            cubeGO.SetActive(false);
            yield return(new WaitForSecondsRealtime(5.0f));

            //
            HudManager.DisplayText("Look to the screen.");
            InstructionManager.DisplayText("It's revolutionary ain't it! \n Press the trigger button to continue...");
            yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.
        }

        // Now that you are done, set the flag to indicate we are done.
        trainingDone = true;
    }
Пример #22
0
        public static void Postfix(HudManager __instance)
        {
            if (PlayerControl.AllPlayerControls.Count <= 1 || !PlayerControl.LocalPlayer.isMafioso())
            {
                return;
            }
            var killButton = __instance.KillButton;

            if (!Utils.Godfather.Data.IsDead)
            {
                killButton.gameObject.SetActive(false);
                killButton.isActive = false;
            }
            else if (!Utils.Mafioso.Data.IsDead)
            {
                killButton.gameObject.SetActive(true);
                killButton.isActive = true;
            }
        }
Пример #23
0
    private void Awake()
    {
        if (singleton == null)
        {
            singleton = this;
            DontDestroyOnLoad(this);
        }
        else if (singleton != this)
        {
            Destroy(gameObject);
        }

        backgroundHUD_Animator = backgroundHUD.GetComponent <Animator>();

        if (graphicRaycaster == null)
        {
            graphicRaycaster = GetComponentInChildren <GraphicRaycaster>();
        }
    }
Пример #24
0
        private void CheckPreviusState()
        {
            if (firstAcess)
            {
                return;
            }
            else if (reEnter)
            {
                return;
            }
            else
            {
                HudManager.BackFromActivity();
                Camera.main.transform.position = new Vector3(0, 0, -10);
                GameObject.FindGameObjectWithTag("Music").GetComponent <MusicVolumeChecker>().CheckVolume();
                switch (previousHomeFocus)
                {
                case PreviousHomeFocus.IBeach:
                    objIBeach.SetActive(true);
                    break;

                case PreviousHomeFocus.IForest:
                    objIForest.SetActive(true);
                    break;

                case PreviousHomeFocus.IGlacius:
                    objIGlacius.SetActive(true);
                    break;

                case PreviousHomeFocus.ITech:
                    objITech.SetActive(true);
                    break;

                case PreviousHomeFocus.IVulcan:
                    objIVulcan.SetActive(true);
                    break;

                case PreviousHomeFocus.ISearch:

                    break;
                }
            }
        }
    /// <summary>
    /// Coroutine for the welcome text.
    /// Implement your welcome loop here.
    /// </summary>
    /// <returns>Yield instruction</returns>
    public override IEnumerator WelcomeLoop()
    {
        // First flag that we are in the welcome routine
        welcomeDone = false;
        inWelcome   = true;

        //
        HudManager.DisplayText("Look to the top right.");
        InstructionManager.DisplayText("This is the welcome. Here you can write a welcome for your subject! \n Press the trigger button to continue...");
        yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.

        //
        HudManager.ClearText();
        InstructionManager.DisplayText("It's awesome! \n Press the trigger button to continue...");
        yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.

        // Now that you are done, set the flag to indicate we are done.
        welcomeDone = true;
    }
        static void Postfix(HudManager __instance)
        {
            if (AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Started)
            {
                bool sabotageActive = false;
                foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
                {
                    if (task.TaskType == TaskTypes.FixLights || task.TaskType == TaskTypes.RestoreOxy || task.TaskType == TaskTypes.ResetReactor || task.TaskType == TaskTypes.ResetSeismic || task.TaskType == TaskTypes.FixComms)
                    {
                        sabotageActive = true;
                    }
                }
                EngineerRole.sabotageActive = sabotageActive;

                if (EngineerPlayer.IsPlayerEngineer(PlayerControl.LocalPlayer) || EngineerConfig.showEngineers)
                {
                    foreach (EngineerPlayer engineer in EngineerPlayer.allEngineers)
                    {
                        engineer.engineerControl.nameText.Color = EngineerConfig.engineerColor;
                    }
                    if (MeetingHud.Instance != null)
                    {
                        foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
                        {
                            if (EngineerPlayer.IsPlayerEngineer(PlayerTools.getPlayerFromId((byte)player.TargetPlayerId)))
                            {
                                player.NameText.Color = EngineerConfig.engineerColor;
                            }
                        }
                    }
                }

                if (EngineerPlayer.IsPlayerEngineer(PlayerControl.LocalPlayer) && __instance.UseButton.isActiveAndEnabled)
                {
                    __instance.KillButton.gameObject.SetActive(true);
                    __instance.KillButton.isActive = true;
                    __instance.KillButton.SetCoolDown(0f, 30f);
                    __instance.KillButton.renderer.sprite = repairIco;
                    __instance.KillButton.renderer.color  = Palette.EnabledColor;
                    __instance.KillButton.renderer.material.SetFloat("_Desat", 0f);
                }
            }
        }
Пример #27
0
        public void InsertNumber(int number)
        {
            currentNumber += number.ToString();

            if (currentNumber.Length == 4)
            {
                if (currentNumber == CurrentStatsInfo.currentUser.pin.ToString())
                {
                    //TODO - CHAMADA CASO O PIN ESTEJA CERTO DENTRO DESSE BLOCO IF.
                    HudManager.PinAcess();
                }
                else
                {
                    Message.instance.Show(MessageClass.ERROR_INCORRECT_PIN);
                }

                currentNumber = string.Empty;
            }
        }
    /// <summary>
    /// Coroutine for the experiment instructions.
    /// Implement your instructions loop here.
    /// </summary>
    /// <returns>Yield instruction</returns>
    public override IEnumerator InstructionsLoop()
    {
        // First flag that we are in the instructions routine
        instructionsDone = false;
        inInstructions   = true;

        //
        InstructionManager.DisplayText("These are the isntructions. You can use other conditions to wait, not only the trigger press! e.g. 10 seconds.");
        HudManager.DisplayText("You can use the HUD too!");
        yield return(new WaitForSecondsRealtime(10.0f)); // Wait for some time.

        //
        HudManager.DisplayText("And get their attention!", 5.0f);
        InstructionManager.DisplayText("It's exciting! \n Press the trigger button to continue...");
        yield return(WaitForSubjectAcknowledgement()); // And wait for the subject to cycle through them.

        // Now that you are done, set the flag to indicate we are done.
        instructionsDone = true;
    }
Пример #29
0
    public void IncreaseScore(int amount)
    {
        score += amount;

        if (score > highScore)
        {
            highScore = score;
        }

        if (hudManager != null)
        {
            hudManager.ResetHud();
        }
        else
        {
            hudManager = FindObjectOfType <HudManager>();
            hudManager.ResetHud();
        }
    }
Пример #30
0
        public static void Postfix(HudManager __instance)
        {
            var flag = MeetingHud.Instance != null;

            if (flag)
            {
                UpdateMeeting(MeetingHud.Instance);
            }

            var flag2 = PlayerControl.AllPlayerControls.Count > 1;

            if (!flag2)
            {
                return;
            }
            var flag3 = Utils.Godfather != null && Utils.Mafioso != null && Utils.Janitor != null;

            if (!flag3)
            {
                return;
            }
            var flag4 = PlayerControl.LocalPlayer.Data.IsImpostor;

            if (!flag4)
            {
                return;
            }
            foreach (var player in PlayerControl.AllPlayerControls)
            {
                if (player.isGodfather())
                {
                    player.nameText.Text = Utils.Godfather.name + " (G)";
                }
                if (player.isMafioso())
                {
                    player.nameText.Text = Utils.Mafioso.name + " (M)";
                }
                if (player.isJanitor())
                {
                    player.nameText.Text = Utils.Janitor.name + " (J)";
                }
            }
        }
Пример #31
0
        public static void Postfix(HudManager __instance)
        {
            if (
                PlayerControl.AllPlayerControls.Count <= 1 ||
                PlayerControl.LocalPlayer == null ||
                PlayerControl.LocalPlayer.Data == null ||
                !PlayerControl.LocalPlayer.Is(RoleEnum.Teleporter)
                )
            {
                return;
            }

            var role = Role.GetRole <Teleporter>(PlayerControl.LocalPlayer);

            if (role.TeleportButton == null)
            {
                role.TeleportButton = Object.Instantiate(__instance.KillButton, HudManager.Instance.transform);
                role.TeleportButton.renderer.enabled = true;
            }

            role.TeleportButton.renderer.sprite = TownOfUs.ButtonSprite;
            role.TeleportButton.gameObject.SetActive(!PlayerControl.LocalPlayer.Data.IsDead && !MeetingHud.Instance);
            var position = __instance.KillButton.transform.localPosition;

            role.TeleportButton.transform.localPosition = new Vector3(position.x,
                                                                      __instance.ReportButton.transform.localPosition.y, position.z);
            role.TeleportButton.SetCoolDown(role.CooldownTimer(), CustomGameOptions.TeleporterCooldown);

            if (
                role.TeleportButton.enabled &&
                !role.TeleportButton.isCoolingDown &&
                !Utils.IsSabotageActive()
                )
            {
                role.TeleportButton.renderer.color = Palette.EnabledColor;
                role.TeleportButton.renderer.material.SetFloat("_Desat", 0f);
                return;
            }

            role.TeleportButton.renderer.color = Palette.DisabledClear;
            role.TeleportButton.renderer.material.SetFloat("_Desat", 1f);
        }
Пример #32
0
 public static void MakeButtons(HudManager hm)
 {
     // SerialKiller Suicide Countdown
     serialKillerButton = new CustomButton(
         () => { },
         () => { return(PlayerControl.LocalPlayer.isRole(RoleType.SerialKiller) && PlayerControl.LocalPlayer.isAlive() && local.isCountDown); },
         () => { return(true); },
         () => { },
         SerialKiller.getButtonSprite(),
         new Vector3(-1.8f, -0.06f, 0),
         hm,
         hm.AbilityButton,
         KeyCode.F,
         true,
         suicideTimer,
         () => { local.suicide(); }
         );
     serialKillerButton.buttonText     = ModTranslation.getString("SerialKillerText");
     serialKillerButton.isEffectActive = true;
 }
Пример #33
0
        public override void HudManagerUpdate(object sender, HudManager __instance)
        {
            UpdateKillButton(__instance);
            //__instance.KillButton.renderer.sprite = Kill;
            if (__instance.KillButton == null)
            {
                return;
            }

            __instance.KillButton.renderer.sprite = Kill;
            bool flag = true;

            var keyInt     = Input.GetKeyInt(KeyCode.Q);
            var controller = ConsoleJoystick.player.GetButtonDown(8);

            if ((keyInt | controller) && __instance.KillButton != null && flag && !PlayerControl.LocalPlayer.Data.IsDead)
            {
                __instance.KillButton.PerformKill();
            }
        }
Пример #34
0
    public void Start()
    {
        GM     = GameObject.FindGameObjectWithTag("Managers").GetComponent <GameManager>();
        player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
        WM     = player.GetComponentInChildren <WeaponManager>();
        Hud    = GetComponent <HudManager>();
        items  = player.GetComponentInChildren <Items>();
        health = player.GetComponentInChildren <HealthPeace>();

        for (int i = 0; i < WM.weapons.Length; i++)
        {
            oldGunsDistance[i]  = WM.weapons[i].fireDist;
            oldChangeGunTime[i] = WM.timeAbleGun[i];
        }

        oldSpeed          = player.runSpeed;
        oldDodgeForce     = player.dodgeForce;
        oldDodgeResetTime = player.timeOfDodge;
        oldHitDamage      = player.normalModeFistDamage;
    }
Пример #35
0
    // Use this for initialization
    void Start()
    {
        AudioSource[] auSource = GetComponents<AudioSource>();

        heartBeat = auSource[0];
        //jump = auSource[1];

        state = "running";
        heartRateManager = new HeartRateManager(this);
        BPM = heartRateManager.GetCurrentHeartRate();
        hudManager = new HudManager(heartRateManager);
        GameObject goal = GameObject.Find("Level Goal");
        winManager = new WinTransitionManager(this, new Rect(goal.transform.position.x, goal.transform.position.y, 5.0f, 10.0f));
    }
Пример #36
0
 void Awake()
 {
     _instance=this;
 }
Пример #37
0
	void Start()
	{
		field_settings = FindObjectOfType<Settings>();
		field_stateManager = FindObjectOfType<StateManager>();
		field_localizationManager = FindObjectOfType<LocalizationManager>();
		field_hudManager = FindObjectOfType<HudManager>();
		field_menuManager = FindObjectOfType<MenuManager>();
		field_audioManager = FindObjectOfType<AudioManager>();
		field_hapticsManager = FindObjectOfType<HapticsManager>();

		field_gameplay = FindObjectOfType<Gameplay>();
		field_scoreManager = FindObjectOfType<ScoreManager>();
	}