コード例 #1
0
 void Start()
 {
     Screen.lockCursor = true;
     Screen.showCursor = false;
     ballTime = 0.0f;
     playerHandler = GameObject.Find ("GameHandler").GetComponent<StaticsOfGame> ().nonStaticMainPlayer.transform.GetComponent<PlayerHandler>();
 }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: aerosolswe/ShooterGame
	public static void RegisterPlayer(string netId, PlayerHandler player) {
		string playerId = PLAYER_ID_PREFIX + netId;

		players.Add(playerId, player);
		player.transform.name = playerId;

	}
コード例 #3
0
ファイル: SPlayer.cs プロジェクト: eickegao/Blazera
        public SPlayer(Player player, ClientService session)
            : base(player)
        {
            Session = session;

            Handler = new PlayerHandler(this);

            OnDirectionEnablement += new DirectionEventHandler(SPlayer_OnDirectionEnablement);
            OnDirectionDisablement += new DirectionEventHandler(SPlayer_OnDirectionEnablement);
        }
コード例 #4
0
ファイル: uiItem.cs プロジェクト: KingCrazy/Relentless
	void Start(){
		gm = GameObject.FindGameObjectWithTag ("GM").GetComponent<GameManager> ();
		player = gm.localPlayer.GetComponent<PlayerHandler> ();
		//bh = GameObject.FindGameObjectWithTag ("bh").GetComponent<DescBoxHandler> ();
		if (isSkill) {
			skill = SkillDatabase.GetSkillByUniqueName (skill_uname);
		} else {
			item = ItemDatabase.items [id];
		}
	}
コード例 #5
0
    public void Start() {
		warpPosition = warpReset;
        controller = GetComponent<CharacterController>();
        playerHander = GetComponent<PlayerHandler>();
        mouseLook = GetComponent<MouseLook>();
        camera = GetComponentInChildren<Camera>();
        animator = GetComponent<Animator>();

        mouseLook.Init(transform, camera.transform);
    }
コード例 #6
0
ファイル: UICharacterSkills.cs プロジェクト: datnewb/Kartus
 private void LookForPlayerHandler()
 {
     foreach (PlayerHandler playerHandlerInstance in FindObjectsOfType<PlayerHandler>())
     {
         if (playerHandlerInstance.GetComponent<NetworkView>().isMine)
         {
             playerHandler = playerHandlerInstance;
             break;
         }
     }
 }
コード例 #7
0
 public void Startup(PlayerHandler player)
 {
     this.player    = player;
     chats          = new Dictionary <ChatID, Chat>();
     eventsQueue    = new Queue <NetworkManager.ChatMessage>();
     player.OnChat += OnChatReceived;
     Chats.SetActive(false);
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #8
0
ファイル: Play.aspx.cs プロジェクト: JatinR/quest
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                cmdSave.Visible = IsLoggedIn && (!string.IsNullOrEmpty(Request["id"]) || !string.IsNullOrEmpty(Request["load"]));
            }

            // We store the game in the Session, but use a dictionary keyed by GUIDs which
            // are stored in the ViewState. This allows the same user in the same browser
            // to open multiple games in different browser tabs.

            if (Games == null)
            {
                Games = new Dictionary<string, PlayerHandler>();
            }

            if (OutputBuffers == null)
            {
                OutputBuffers = new Dictionary<string, OutputBuffer>();
            }

            if (Resources == null)
            {
                Resources = new SessionResources();
            }

            m_gameId = (string)ViewState["GameId"];
            if (m_gameId == null)
            {
                m_gameId = Guid.NewGuid().ToString();
                ViewState["GameId"] = m_gameId;
            }

            if (Page.IsPostBack)
            {
                if (Games.ContainsKey(m_gameId))
                {
                    m_player = Games[m_gameId];
                }

                if (!OutputBuffers.ContainsKey(m_gameId))
                {
                    // TO DO: Think this only ever happens while debugging?
                    return;
                }
                m_buffer = OutputBuffers[m_gameId];
            }
            else
            {
                m_buffer = new OutputBuffer();
                OutputBuffers.Add(m_gameId, m_buffer);
            }
        }
コード例 #9
0
    // Use this for initialization
    void Start()
    {
        GameObject _p = GameObject.Find("Player");
        if (_p != null)
        {
            player = _p;

            playerHandler = player.GetComponent<PlayerHandler>();
        }

        animationHandler = this.GetComponent<AnimationHandler>();
    }
コード例 #10
0
        public async Task LoginCommand()
        {
            if (!await PlayerHandler.AttemptLogin(Context.User))
            {
                await ReplyAsync(Context.User.Mention + ": " + Modules.NOT_REGISTERED_MSG);

                return;
            }
            Player p = PlayerHandler.GetPlayer(Context.User);

            await ReplyAsync(Context.User.Mention + ": " + Modules.LOGGED_IN_AS + p.name);
        }
コード例 #11
0
    private void CheckForSplashDamage()
    {
        // Clearing the hit players list:
        hitPlayers.Clear();

        // Getting all the colliders within the sphere:
        Collider[] hitColliders = Physics.OverlapSphere(transform.position, splashDamageRadius);

        // Looping through the hit colliders:
        for (int i = 0; i < hitColliders.Length; ++i)
        {
            GameObject hitObject = hitColliders[i].gameObject;
            if (LayerMask.LayerToName(hitObject.layer).Contains("Player"))
            {
                // Handler of the other player.
                PlayerHandler player = hitObject.GetComponentInParent <PlayerHandler>();

                // Checking if the player is already in the array.
                if (player && player.ID != shooterHandler.ID && !player.AddToSplashCheck)
                {
                    // Toggling the splash check flag in the player:
                    player.AddToSplashCheck = true;

                    // Adding the player to the array.
                    hitPlayers.Add(player);
                }
            }
        }

        foreach (PlayerHandler handler in hitPlayers)
        {
            // Dealing damage to the player, then checking if their health is 0:
            //Debug.Log("Dealing splash damage to player" + handler.ID);
            if (handler.IsInMech())
            {
                if (handler.Mech_TakeDamage(splashDamage) == 0)
                {
                    // Adding a mech kill to the player stats:
                    shooterHandler.PlayerStats.KilledMech();
                }
            }
            else
            {
                if (handler.Core_TakeDamage(splashDamage) == 0)
                {
                    // Adding a core kill to the player stats:
                    shooterHandler.PlayerStats.KilledCore();
                }
            }
            handler.AddToSplashCheck = false;
        }
    }
コード例 #12
0
    // Update is called once per frame
    void Update()
    {
        if (!gameStarted)
        {
            powerUpTimer = PowerUpTimer;
            gameTimer    = GameTimer;

            if (TileMap)
            {
                TileMap.Initialize(Players);
            }

            gameStarted = true;
            return;
        }

        gameTimer -= Time.deltaTime;

        int minutes = Mathf.FloorToInt(gameTimer / 60);
        int seconds = Mathf.FloorToInt(gameTimer - (minutes * 60));

        GameTimerUI.text = (minutes < 10 ? "0" + minutes.ToString() : minutes.ToString()) + ":" + (seconds < 10 ? "0" + seconds.ToString() : seconds.ToString());

        powerUpTimer -= Time.deltaTime;

        if (powerUpTimer < 0.0f)
        {
            // Spawn power up
            powerUpTimer = PowerUpTimer;
        }

        if (gameTimer < 0.0f)
        {
            // End the game
            //ResetGame();
            int winningPlayer = 0;
            int highestPoints = 0;
            for (int index = 0; index < Players.Count; ++index)
            {
                PlayerHandler handler = Players[index].GetComponent <PlayerHandler>();
                if (handler)
                {
                    if (handler.GetPoints() > highestPoints)
                    {
                        winningPlayer = index;
                        highestPoints = handler.GetPoints();
                    }
                }
            }
            endGameScreen.ShowPlayerWins(winningPlayer);
        }
    }
コード例 #13
0
    public void FixedUpdate()
    {
        if (canLaunch)
        {
            GameObject collidedObject = trigger.CollidedGameObject();
            if (collidedObject && collidedObject.tag == "Player")
            {
                PlayerHandler playerHandler = collidedObject.GetComponentInParent <PlayerHandler>();

                if (playerHandler.IsGrounded)
                {
                    hasLaunched = false;
                }

                if (trigger.IsEnabled())
                {
                    hasLaunched = true;
                    animator.SetTrigger("Jump");
                }
                else
                {
                    hasLaunched = false;
                }

                if (hasLaunched)
                {
                    if (playerHandler.CurrentState == StateManager.PLAYER_STATE.Mech)
                    {
                        playerHandler.MechController.ResetGravity();
                        playerHandler.MechImpactRecevier.AddImpact(forceDirection.transform.up, mechLaunchForce);
                    }
                    else
                    {
                        playerHandler.CoreRigidbody.AddForce(forceDirection.transform.up * coreLaunchForce, ForceMode.Impulse);
                    }

                    hasLaunched = false;
                    canLaunch   = false;
                }
            }
        }
        else
        {
            // Cool down timer to prevent constant launch:
            cooldownTimer += Time.deltaTime;
            if (cooldownTimer >= maxCooldown)
            {
                cooldownTimer = 0f;
                canLaunch     = true;
            }
        }
    }
コード例 #14
0
    public void Reset()
    {
        GameObject[] players    = GameObject.FindGameObjectsWithTag("Player");
        GameObject[] containers = new GameObject[players.Length];
        for (int i = 0; i < players.Length; i++)
        {
            containers[i] = players[i].transform.parent.gameObject;
        }

        for (int i = 0; i < players.Length; i++)
        {
            PlayerHandler ph = containers[i].GetComponent <PlayerHandler>();
            if (!ph.photonView.IsMine)
            {
                continue;
            }
            //containers[i].transform.rotation = ph.start_rot;
            players[i].transform.localPosition = new Vector3(0.0f, 0.0f, ph.player_local_z_start);
            players[i].GetComponent <TrailRenderer>().Clear();
            players[i].GetComponent <PositionCache>().data.Clear();
            ph.enabled = true;
            ph.ResetFly();
        }

        int        max_iters = 50;
        int        iter      = 0;
        GameObject cols      = GameObject.Find("Colliders");

        BoxCollider[] boxes = cols.GetComponents <BoxCollider>();
        do
        {
            if (iter == max_iters)
            {
                break;
            }
            foreach (BoxCollider box in boxes)
            {
                Destroy(box);
            }
            boxes = cols.GetComponents <BoxCollider>();
            iter++;
        } while (boxes.Length > 0);

        ColliderHandler ch = cols.GetComponent <ColliderHandler>();

        ch.first_time = new bool[] { true, true, true, true };
        ch.data_iter  = new int[] { 0, 0, 0, 0 };

        GameObject.Find("Text").GetComponent <Text>().text = "";

        //Globals.running = true;
    }
コード例 #15
0
 // Start is called before the first frame update
 void Start()
 {
     _structurePanel = transform.GetChild(0).gameObject;
     _player         = transform.parent.parent.gameObject.GetComponent <PlayerHandler>();
     _panelRect      = _structurePanel.GetComponent <RectTransform>();
     _closeBtn       = WaitForChild(_structurePanel, 0).GetComponent <Button>();
     _upgradeBtn     = WaitForChild(_structurePanel, 3).GetComponent <Button>();
     _strutName      = WaitForChild(_structurePanel, 1).GetComponent <TMP_Text>();
     _strutDesc      = WaitForChild(_structurePanel, 2).GetComponent <TMP_Text>();
     _reclaimBtn     = WaitForChild(_structurePanel, 4).GetComponent <Button>();
     _reclaimBtn.onClick.AddListener(() => Reclaim());
     _closeBtn.onClick.AddListener(() => CloseActiveStructure());
 }
コード例 #16
0
ファイル: StrikeHandler.cs プロジェクト: AKing58/Square-Off
    void OnTriggerStay(Collider collider)
    {
        Debug.Log(collider.name);
        PlayerHandler targetPH = collider.gameObject.GetComponent <PlayerHandler>();

        if (!targetPH.canBeStriked())
        {
            return;
        }
        //targetPH.rotTowards(selfPH.transform.position);
        targetPH.strikeMe();
        GetComponent <BoxCollider>().enabled = false;
    }
コード例 #17
0
    public static void SavePlayer(PlayerHandler player)
    {
        BinaryFormatter binaryFormatter = new BinaryFormatter();

        string path = Application.persistentDataPath + "/player.data";

        FileStream fileStream = new FileStream(path, FileMode.Create);

        PlayerData playerData = new PlayerData(player);

        binaryFormatter.Serialize(fileStream, playerData);
        fileStream.Close();
    }
コード例 #18
0
 private void GameOver(PlayerHandler activePlayer)
 {
     if (playerHandlers.Length == 1)
     {
         victoryCanvas.GetComponentInChildren <Text>().text = "You have completed the game!";
     }
     else
     {
         victoryCanvas.GetComponentInChildren <Text>().text = activePlayer.gameObject.name + " has won!";
     }
     victoryCanvas.enabled = true;
     FindObjectOfType <MenuHandler>().PauseGame();
 }
コード例 #19
0
    void Start()
    {
        player        = GameObject.FindGameObjectWithTag("Player");
        playerHandler = FindObjectOfType <PlayerHandler>();

        currentScene = SceneManager.GetActiveScene().buildIndex;

        if (PlayerPrefs.GetInt("tutorialComplete") == 1)
        {
            player.GetComponent <PlayerAimWeapon>().enabled = true;
            player.GetComponent <PlayerShoot>().enabled     = true;
        }
    }
コード例 #20
0
    private void Start()
    {
        //Make the cursor invisible.
        Cursor.visible = false;
        //Lock it.
        Cursor.lockState = CursorLockMode.Locked;

        //Get a reference to the player handler.
        pHandler = Manager.Instance.PlayerHandler;

        //Save the position the camera has while standing.
        normalPosition = transform.localPosition;
    }
コード例 #21
0
 private void Start()
 {
     upgradeHandler = GameObject.Find("UpgradeHandler").GetComponent <UpgradeHandler>();
     infoText       = GameObject.Find("InfoText").GetComponent <Text>();
     playerHandler  = GameObject.Find("PlayerHandler").GetComponent <PlayerHandler>();
     button         = GetComponent <Button>();
     button.onClick.AddListener(OnClick);
     if (cell == null)
     {
         return;
     }
     cellScript = cell.GetComponent <Cell>();
 }
コード例 #22
0
 public void ResetGame()
 {
     endGameScreen.HideUI();
     for (int index = 0; index < Players.Count; ++index)
     {
         PlayerHandler handler = Players[index].GetComponent <PlayerHandler>();
         if (handler)
         {
             handler.ResetPlayerPoints();
         }
     }
     gameStarted = false;
 }
コード例 #23
0
 public JudgementPhase(
     GameUI gameUI,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     JudgementVoteHandler judgementVotes,
     float duration)
     : base("Judgement", duration)
 {
     gameUi              = gameUI;
     this.playerHandler  = playerHandler;
     this.trialVotes     = trialVotes;
     this.judgementVotes = judgementVotes;
 }
コード例 #24
0
    private void Start()
    {
        PlayerHandler ph = GetComponentInParent <PlayerHandler>();

        if (ph != null)
        {
            PickUp(ph);
        }
        else
        {
            Drop();
        }
    }
コード例 #25
0
    // Use this for initialization
    void Start()
    {
        GameObject _p = GameObject.Find("Player");

        if (_p != null)
        {
            player = _p;

            playerHandler = player.GetComponent <PlayerHandler>();
        }

        animationHandler = this.GetComponent <AnimationHandler>();
    }
コード例 #26
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            this.DataContext = this;

            playerHandler = PlayerHandler.Instance;
            ListOfRaiseMortgagedProperties = new ObservableCollection <Property>(playerHandler.GetCurrentPlayer().ListOfProperties.Where(l => l.Status == Property.MORTGAGED).ToList());

            if (ListOfRaiseMortgagedProperties.Count() == 0)
            {
                EmptyList.Visibility = Visibility.Visible;
            }
        }
コード例 #27
0
    public override void RefreshSettings()
    {
        base.RefreshSettings();

        Debug.Log("Refreshing options in player settings menu");
        playerToUpdate = GetComponentInParent <PlayerHandler>();
        // Updates interactable options to represent the current settings
        fieldOfView.value        = playerToUpdate.movement.fieldOfView.defaultValue;
        cameraSensitivityX.value = playerToUpdate.movement.sensitivityX;
        cameraSensitivityY.value = playerToUpdate.movement.sensitivityY;
        toggleCrouch.isOn        = playerToUpdate.movement.toggleCrouch;
        toggleADS.isOn           = playerToUpdate.weapons.toggleAim;
    }
コード例 #28
0
ファイル: GameManager.cs プロジェクト: AKing58/Square-Off
    public void spawnPlayers()
    {
        Players.Add(Instantiate(Characters["RedComet"], new Vector3(-2.5f, 0, 0), Quaternion.identity));
        Players[Players.Count - 1].name = "Player1";

        PlayerHandler ph = Players[Players.Count - 1].GetComponent <PlayerHandler>();

        ph.controllable    = true;
        ph.PlayerInfoPanel = PlayerInfoPanels.transform.Find("Player1Panel").gameObject;
        ph.CharacterName   = "Red Comet";
        ph.PlayerName      = "Player 1";
        ph.InitPlayer();
    }
コード例 #29
0
        public PaintGunMod(PaintGun_GameSession session) : base(MOD_NAME, session)
        {
            string msg = "### PaintGun v23";

            VRage.Utils.MyLog.Default.WriteLineAndConsole(msg);
            Log.Info(msg);

            session.SetUpdateOrder(MyUpdateOrder.AfterSimulation); // define what update types the modAPI session comp should trigger

            DisablePaintGunVanillaShoot();

            // Systems
            Caches            = new Caches(this);
            Constants         = new Constants(this);
            PlayerHandler     = new PlayerHandler(this);
            NetworkLibHandler = new NetworkLibHandler(this);

            if (IsPlayer)
            {
                TextAPI    = new TextAPI(this);
                DrawUtils  = new DrawUtils(this);
                GameConfig = new GameConfig(this);
            }

            // Features
            Palette  = new Palette(this);
            Painting = new Painting(this);

            if (IsPlayer)
            {
                CheckPlayerField      = new CheckPlayerField(this);
                Settings              = new Settings(this);
                PaletteInputHandler   = new PaletteInputHandler(this);
                PaletteScheduledSync  = new PaletteScheduledSync(this);
                HUDSounds             = new HUDSounds(this);
                LocalToolHandler      = new LocalToolHandler(this);
                LocalToolDescription  = new LocalToolDescription(this);
                SelectionGUI          = new SelectionGUI(this);
                ToolHandler           = new ToolHandler(this);
                ChatCommands          = new ChatCommands(this);
                Notifications         = new Notifications(this);
                PaletteHUD            = new PaletteHUD(this);
                ColorPickerGUIWarning = new ColorPickerGUIWarning(this);
                ConfigMenuHandler     = new ConfigMenuHandler(this);
            }

            if (Constants.EnableTestComponent)
            {
                TestComp = new TestComp(this);
            }
        }
コード例 #30
0
ファイル: PlayerGCMessage.cs プロジェクト: npf888/game
    /**
     * 客户端请求用户信息
     * @param playerInfoData 玩家信息
     * @param bazooPersonalInfo 玩家信息
     */
    public void GC_QUERY_PLAYER_INFO(InputMessage data)
    {
        int            i, size;
        PlayerInfoData playerInfoData = new PlayerInfoData();

        playerInfoData.playerId         = data.GetLong();   //玩家id
        playerInfoData.name             = data.GetString(); //名字
        playerInfoData.img              = data.GetString(); //图片
        playerInfoData.gold             = data.GetLong();   //玩家筹码
        playerInfoData.diamond          = data.GetLong();   //钻石
        playerInfoData.charm            = data.GetLong();   //玩家筹码
        playerInfoData.level            = data.GetLong();   //等级
        playerInfoData.sex              = data.GetInt();    //性别
        playerInfoData.viplevel         = data.GetInt();    //vip等级
        playerInfoData.countries        = data.GetString(); //国籍
        playerInfoData.age              = data.GetInt();    //年龄
        playerInfoData.slotRotate       = data.GetLong();   //总转次数
        playerInfoData.slotWin          = data.GetLong();   //总赢得分
        playerInfoData.slotSingleWin    = data.GetLong();   //单次赢取最大
        playerInfoData.slotWinNum       = data.GetLong();   //玩家总胜利次数
        playerInfoData.integral         = data.GetLong();   //排行榜积分
        playerInfoData.isRequest        = data.GetInt();    //是否已经申请添加好友 0:未申请,1:已申请
        playerInfoData.newGuyGift       = data.GetInt();    //新手大礼包:1已购买,0 未购买
        playerInfoData.clubId           = data.GetString(); //俱乐部id,空字符串表示未加入俱乐部
        playerInfoData.clubIco          = data.GetInt();    //俱乐部图标
        playerInfoData.clubInvitedTimes = data.GetInt();    //被俱乐部邀请次数,0为未被邀请
        playerInfoData.achieveRate      = data.GetString(); //无双吹牛 成就  完成个数/总个数
        ArrayList bazooPersonalInfo = new ArrayList();

        size = data.GetShort();
        for (i = 0; i < size; i++)
        {
            BazooPersonalInfo bazooPersonalInfo_Datas = new BazooPersonalInfo();
            bazooPersonalInfo_Datas.modeType       = data.GetInt();      //性别
            bazooPersonalInfo_Datas.numberOfGame   = data.GetInt();      //所有模式:局数
            bazooPersonalInfo_Datas.singleTopGold  = data.GetLong();
            bazooPersonalInfo_Datas.rateOfWinning  = data.GetInt();      //吹牛模式:胜率
            bazooPersonalInfo_Datas.aWinningStreak = data.GetInt();      //吹牛模式:连胜
            bazooPersonalInfo_Datas.passToKill     = data.GetInt();      //牛牛模式:通杀
            bazooPersonalInfo_Datas.bigPatterns    = data.GetString();   //牛牛模式:最大牌型
            bazooPersonalInfo_Datas.pantherNumber  = data.GetInt();      //梭哈模式:豹子数
            bazooPersonalInfo_Datas.threeKill      = data.GetInt();      //三杀
            bazooPersonalInfo_Datas.fourKill       = data.GetInt();      //四杀
            bazooPersonalInfo_Datas.fiveKill       = data.GetInt();      //五杀
            bazooPersonalInfo_Datas.dayProfit      = data.GetLong();
            bazooPersonalInfo_Datas.weekProfit     = data.GetLong();
            bazooPersonalInfo_Datas.monthProfit    = data.GetLong();
            bazooPersonalInfo.Add(bazooPersonalInfo_Datas);
        }
        PlayerHandler.Instance().GC_QUERY_PLAYER_INFO(playerInfoData, bazooPersonalInfo);
    }
コード例 #31
0
        /////////////////////////
        // OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
        // Called when a player spawns (after connection or after death)
        /////////////////////////
        void OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
        {
            if (hasPermission(player.netUser))
            {
                return;
            }
            PlayerHandler phandler = player.GetComponent <PlayerHandler>();

            if (phandler == null)
            {
                phandler = player.gameObject.AddComponent <PlayerHandler>(); phandler.timeleft = GetPlayerData(player);
            }
            timer.Once(0.1f, () => phandler.StartCheck());
        }
コード例 #32
0
 public AdminCore()
 {
     //TODO: check EnableRuntime before creating these objects to save memory
     Database = new SQLHandler(this);
     Server   = new ServerManager(this);
     WebAdmin = new WebServer(this);
     Rcon     = new RconClient(this);
     Players  = new PlayerHandler(this);
     Announce = new AnnounceHandler(this);
     Game     = new GameHandler(this);
     Commands = new CommandDispatcher(this);
     Mods     = new LvlWriter(this);
     Plugins  = new PluginManager(this);
 }
コード例 #33
0
ファイル: EloController.cs プロジェクト: jonasah/elo
        private static Player GetOrCreatePlayer(string name)
        {
            var player = PlayerHandler.GetPlayerByName(name);

            if (player == null)
            {
                player = PlayerHandler.AddPlayer(new Player
                {
                    Name = name
                });
            }

            return(player);
        }
コード例 #34
0
ファイル: CustomItems.cs プロジェクト: 4310V343k/CustomItems
        /// <inheritdoc/>
        public override void OnDisabled()
        {
            UnregisterItems();

            Server.ReloadedConfigs        -= serverHandler.OnReloadingConfigs;
            Events.AddClassEvent.AddClass -= playerHandler.OnAddingSubclass;

            harmonyInstance?.UnpatchAll();

            serverHandler = null;
            playerHandler = null;

            base.OnDisabled();
        }
コード例 #35
0
    public static EnemyHandler CreateEnemy(Vector3 spawnPosition, PlayerHandler playerHandler)
    {
        Transform    enemyTransform = Instantiate(GameAssets.i.pfEnemyTransform, spawnPosition, Quaternion.identity);
        EnemyHandler enemyHandler   = enemyTransform.GetComponent <EnemyHandler>();

        HealthSystem healthSystem = new HealthSystem(150 + (GameControl.control.lvl * 10));
        HealthBar    healthBar    = Instantiate(GameAssets.i.pfHealthBar, spawnPosition + new Vector3(0, 1.5f), Quaternion.identity, enemyTransform).GetComponent <HealthBar>();

        healthBar.Setup(healthSystem);

        enemyHandler.Setup(playerHandler, healthSystem);

        return(enemyHandler);
    }
コード例 #36
0
 public ExecutionPhase(
     GameUI gameUI,
     WaypointCamera camera,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     JudgementVoteHandler judgementVote)
     : base("Execution")
 {
     gameUi             = gameUI;
     this.camera        = camera;
     this.playerHandler = playerHandler;
     this.trialVotes    = trialVotes;
     this.judgementVote = judgementVote;
 }
コード例 #37
0
ファイル: EnemyScript.cs プロジェクト: carlos93/BasicARPG
    private void OnTriggerEnter(Collider other)
    {
        PlayerHandler player = other.gameObject.GetComponent <PlayerHandler>();

        if (!player)
        {
            return;
        }

        if (!target)
        {
            StartAttack(other.transform);
        }
    }
コード例 #38
0
 void OnTriggerStay(Collider other)
 {
     if (other.tag == "Player")
     {
         //if (Vector2.Distance(transform.position, other.transform.position) < 0.58f)
         //{
         PlayerHandler playerScript = other.GetComponent <PlayerHandler>();
         if (playerScript.dashVector.magnitude <= 0.01f)
         {
             playerScript.SetFallingDown();
         }
         //}
     }
 }
コード例 #39
0
    // Use this for initialization
    void Start()
    {
        int currentXp = 0;
        int xpToIncrease = 50;

        for (int i = 0; i < 20; i++)
        {
            currentXp += xpToIncrease;
            levelList.Add(currentXp);
            xpToIncrease = (int)(xpToIncrease * 1.25);
        }

        playerHandler = this.GetComponent<PlayerHandler>();
        animationHandler = this.GetComponent<AnimationHandler>();
    }
コード例 #40
0
ファイル: PlayerInfo.cs プロジェクト: datnewb/Kartus
    private void CreatePlayerHandler()
    {
        playerHandler = gameObject.AddComponent<PlayerHandler>();
        playerHandler.playerInfo = this;

        foreach (Kart kartObject in FindObjectOfType<CharacterList>().karts)
        {
            if (kart == kartObject.kartEnumValue)
            {
                playerHandler.kart = kartObject.variations[kartVariation];
                break;
            }
        }
        playerHandler.driver = FindObjectOfType<CharacterList>().drivers[(int)gender];
        NetworkView playerHandlerNetworkView = gameObject.AddComponent<NetworkView>();
        playerHandlerNetworkView.stateSynchronization = NetworkStateSynchronization.Unreliable;
        playerHandlerNetworkView.observed = playerHandler;
    }
コード例 #41
0
ファイル: PreviewCamera.cs プロジェクト: datnewb/Kartus
 void Start()
 {
     currentCameraIndex = 0;
     playerHandler = null;
 }
コード例 #42
0
ファイル: GameHandler.cs プロジェクト: Jolids/SteamLandsUnity
 // Use this for initialization
 void Start()
 {
     playerHandler = player.GetComponent<PlayerHandler>();
 }
コード例 #43
0
ファイル: GestureHandler.cs プロジェクト: smokelore/StarRush
 void Start()
 {
     PC = this.gameObject.GetComponent<PlayerHandler>();
     CurrentGesture = Gesture.NOTHING;
     delayCount = 0;
 }
コード例 #44
0
ファイル: Play.aspx.cs プロジェクト: hyrmedia/quest
        private string LoadGame(string gameFile, string id, string folder, string loadData, AzureFileManager.ApiGame apiGameData)
        {
            if (string.IsNullOrEmpty(gameFile) && loadData == null)
            {
                return "No game specified";
            }

            string rootPath = folder ?? ConfigurationManager.AppSettings["GameFolder"];
            string libPath = ConfigurationManager.AppSettings["LibraryFolder"];
            string filename;

            if (Config.ReadGameFileFromAzureBlob)
            {
                filename = gameFile;
            }
            else
            {
                filename = WebPlayer.Play.GetGameFilename(gameFile, rootPath);
                if (filename == null)
                {
                    return "Invalid filename";
                }
            }

            List<string> errors;

            try
            {
                m_player = new PlayerHandler(filename, m_buffer);
                m_player.LoadData = loadData;
                m_player.ApiGameData = apiGameData;
                m_player.GameId = m_gameId;
                m_player.LibraryFolder = libPath;
                Games[m_gameId] = m_player;
                m_player.BeginWait += m_player_BeginWait;
                m_player.BeginPause += m_player_BeginPause;
                m_player.ShowMenuDelegate = m_player_ShowMenu;
                m_player.ShowQuestionDelegate = m_player_ShowQuestion;
                m_player.AddResource += AddResource;
                m_player.PlayAudio += m_player_PlayAudio;
                m_player.StopAudio += m_player_StopAudio;
                if (Config.ReadGameFileFromAzureBlob)
                {
                    m_player.ResourceUrlRoot = AzureFileManager.GetResourceUrlRoot(id);
                }

                if (m_player.Initialise(out errors))
                {
                    Resources.AddGame(m_player.Game);

                    // Successful game start
                    return m_player.ClearBuffer();
                }
            }
            catch (Exception ex)
            {
                return "<b>Error loading game:</b><br/>" + ex.Message;
            }

            string output = string.Empty;

            foreach (string error in errors)
            {
                output += error + "<br/>";
            }

            return output;
        }
コード例 #45
0
ファイル: Play.aspx.cs プロジェクト: hyrmedia/quest
        void m_player_PlayAudio(object sender, PlayerHandler.PlayAudioEventArgs e)
        {
            string functionName = null;
            if (e.Filename.EndsWith(".wav", StringComparison.InvariantCultureIgnoreCase)) functionName = "playWav";
            if (e.Filename.EndsWith(".mp3", StringComparison.InvariantCultureIgnoreCase)) functionName = "playMp3";

            if (functionName == null) return;

            string url = m_player.GetURL(e.Filename);

            m_buffer.AddJavaScriptToBuffer(
                functionName,
                new StringParameter(url),
                new BooleanParameter(e.Synchronous),
                new BooleanParameter(e.Looped));
        }
コード例 #46
0
ファイル: PlayerInfo.cs プロジェクト: datnewb/Kartus
    void Start()
    {
        myView = GetComponent<NetworkView>();
        position = 0;
        for (int testPosition = 1; testPosition <= 4; testPosition++)
        {
            bool matchFound = false;
            foreach (PlayerInfo playerInfo in FindObjectsOfType<PlayerInfo>())
            {
                if (testPosition == playerInfo.position)
                {
                    matchFound = true;
                    break;
                }
            }
            if (!matchFound)
            {
                position = testPosition;
                break;
            }
        }

        queueNumber = position;
        playerHandler = null;

        loadingFinished = false;
        kartSelected = false;
        DontDestroyOnLoad(gameObject);
    }
コード例 #47
0
ファイル: block.cs プロジェクト: smokelore/StarRush
 // Update is called once per frame
 void Update()
 {
     if (PC == null) {
         if (this.transform.parent.gameObject.tag == "Tetris") {
             PC = this.transform.parent.parent.GetComponent<PlayerHandler>();
         } else {
             PC = this.transform.parent.GetComponent<PlayerHandler>();
         }
     } else {
         if (this.transform.parent.gameObject.tag == "Tetris") {
             if (this.transform.parent.GetComponent<TetriminoHandler>().isPreview) {
                 checkCollisions();
                 checkBounds();
             } else {
                 updatePriority();
                 checkLevel();
             }
         } else {
             updatePriority();
             checkLevel();
         }
     }
 }
コード例 #48
0
ファイル: SkillDatabase.cs プロジェクト: KingCrazy/Relentless
	// This is good for basic stuff. But if I wanted to do something more advanced I can't.
	// Maybe look for a good way to implement special skills?
	void Awake(){
		gm = GameObject.FindGameObjectWithTag ("GM").GetComponent<GameManager> ();
		p = gm.localPlayer.GetComponent<PlayerHandler>();
	}
コード例 #49
0
ファイル: Player.cs プロジェクト: julius/pse_spacewar
 /// <summary>
 /// Creates a player.
 /// </summary>
 /// <param name="playerId">The player's ID.</param>
 /// <param name="playerHandler">The player's Handler.</param>
 /// <param name="playerColor">The player's color.</param>
 public Player(int playerId, PlayerHandler playerHandler, Color playerColor)
 {
     this.playerId = playerId;
     this.playerHandler = playerHandler;
     this.playerColor = playerColor;
 }
コード例 #50
0
ファイル: build.cs プロジェクト: smokelore/StarRush
 void Start()
 {
     PC = this.transform.GetComponent<PlayerHandler>();
     waitCount = waitDuration/5;	// Don't feel like waiting as long for the first tetris block to spawn
     //getNextTetris();
 }
コード例 #51
0
ファイル: lemming.cs プロジェクト: smokelore/StarRush
 // Use this for initialization
 void Start()
 {
     PC = this.transform.parent.GetComponent<PlayerHandler>();
     setAction(Action.WALKING);
     CurrentDirection = Vector3.forward;
     walkCount = 0;
     bestLevel = 0;
     blocksClimbed = new List<GameObject>();
 }