本文整理汇总了C#中BasePlayer类的典型用法代码示例。如果您正苦于以下问题:C# BasePlayer类的具体用法?C# BasePlayer怎么用?C# BasePlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BasePlayer类属于命名空间,在下文中一共展示了BasePlayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RustLivePlayer
internal RustLivePlayer(BasePlayer player)
{
this.player = player;
steamId = player.userID;
Character = this;
Object = player;
}
开发者ID:yas-online,项目名称:Oxide,代码行数:7,代码来源:RustLivePlayer.cs
示例2: Awake
void Awake()
{
cameraMove = false;
secondTarget = false;
if (!player)
{
Debug.LogError("Missing player!");
}
else
{
basePlayer = player.GetComponent<BasePlayer>();
if(!basePlayer)
{
Debug.LogError("Missing base player script!");
}
}
if (!goblin)
{
Debug.LogError("Missing goblin!");
}
if (!goblin1)
{
Debug.LogError("Missing goblin1!");
}
if (!mainCamera)
{
Debug.LogError("Missing camera!");
}
}
开发者ID:Morthalin,项目名称:TheGame,代码行数:33,代码来源:EventController.cs
示例3: HammerEvent
public HammerEvent(HitInfo info, BasePlayer player)
{
_info = info;
basePlayer = player;
string bonename = StringPool.Get(info.HitBone);
HitBone = bonename == "" ? "unknown" : bonename;
}
开发者ID:Notulp,项目名称:Pluton,代码行数:7,代码来源:HammerEvent.cs
示例4: ActivateFly
void ActivateFly(BasePlayer player, float speed)
{
fly.Add(player, speed);
oldPos.Add(player, player.transform.position);
player.ChangePlayerState(PlayerState.Type.Spectating, false);
SendReply(player, "FlyMode: Activated, press any key to start flying");
}
开发者ID:LouisTakePILLz,项目名称:Oxide2Plugins,代码行数:7,代码来源:Fly.cs
示例5: Update
public static void Update(bool withEnts = true)
{
if (entityAddress == 0)
entityAddress = SignatureManager.GetEntityList();
currentList = new EntityList();
var players = new List<BasePlayer>();
var entities = new List<BaseEntity>();
var entityList = Memory.ReadMemory(entityAddress, 4096 * 0x10); //lol
for (int i = 0; i < 64/*BaseClient.GlobalVars.maxClients*/; i++)
{
var entity = BitConverter.ToInt32(entityList, i * 0x10);
if (entity == 0) continue;
var player = new BasePlayer(entity);
players.Add(player);
}
currentList.Players = players;
if (withEnts)
{
for (int i = 64/*BaseClient.GlobalVars.maxClients*/; i < 4096; i++)
{
var entity = BitConverter.ToInt32(entityList, i * 0x10);
if (entity == 0) continue;
var ent = new BaseEntity(entity);
entities.Add(ent);
}
currentList.Entities = entities;
}
}
开发者ID:Ch0bits,项目名称:ExternalCounterstrike,代码行数:32,代码来源:EntityBase.cs
示例6: cmdWaypointsClose
void cmdWaypointsClose(BasePlayer player, string command, string[] args)
{
if (!hasAccess(player)) return;
if (!isEditingWP(player, 1)) return;
SendReply(player, "Waypoints: Closed without saving");
GameObject.Destroy(player.GetComponent<WaypointEditor>());
}
开发者ID:vividentity,项目名称:Oxide2Plugins,代码行数:7,代码来源:Waypoints.cs
示例7: cmdSpawnOpen
void cmdSpawnOpen(BasePlayer player, string command, string[] args)
{
if (!hasAccess(player)) return;
if (SpawnsData.ContainsKey(player))
{
SendReply(player, "You must save/close your current spawns first. /spawns_help for more informations");
return;
}
if (args == null || args.Length == 0)
{
SendReply(player, "/spawns_remove SPAWN_NUMBER");
return;
}
var NewSpawnFile = Interface.GetMod().DataFileSystem.GetDatafile(args[0].ToString());
if (NewSpawnFile["1"] == null)
{
SendReply(player, "This spawnfile is empty or not valid");
return;
}
SpawnsData.Add(player, new List<Vector3>());
foreach (KeyValuePair<string, object> pair in NewSpawnFile)
{
var currentvalue = pair.Value as Dictionary<string, object>;
((List<Vector3>)SpawnsData[player]).Add(new Vector3(Convert.ToInt32(currentvalue["x"]), Convert.ToInt32(currentvalue["y"]), Convert.ToInt32(currentvalue["z"])));
}
SendReply(player, string.Format("Opened spawnfile with {0} spawns", ((List<Vector3>)SpawnsData[player]).Count.ToString()));
}
开发者ID:stuffedmotion,项目名称:plugins,代码行数:27,代码来源:Spawns2.cs
示例8: GetOpenDialog
/// <summary>
/// Gets the dialog currently being shown to the specified <paramref name="player" />.
/// </summary>
/// <param name="player">The player whose dialog to get.</param>
/// <returns>The dialog currently being shown to the specified <paramref name="player" />.</returns>
public static Dialog GetOpenDialog(BasePlayer player)
{
if (player == null)
throw new ArgumentNullException(nameof(player));
return OpenDialogs.ContainsKey(player.Id) ? OpenDialogs[player.Id] : null;
}
开发者ID:Xalphox,项目名称:SampSharp,代码行数:12,代码来源:Dialog.cs
示例9: AddPlayerLobbyTest
public void AddPlayerLobbyTest()
{
var lobby = new Lobby(new LobbyConfig());
var player = new BasePlayer();
lobby.AddPlayers(new BasePlayerGroup(player));
Assert.IsTrue(lobby.PlayerList.Contains(player));
}
开发者ID:patrious,项目名称:GameLobby,代码行数:7,代码来源:LobbyTests.cs
示例10: DamageEventArgs
/// <summary>
/// Initializes a new instance of the DamageEventArgs class.
/// </summary>
/// <param name="otherPlayer">The other player.</param>
/// <param name="amount">Amount of damage done.</param>
/// <param name="weapon">Weapon used to damage another.</param>
/// <param name="bodypart">BodyPart shot at.</param>
public DamageEventArgs(BasePlayer otherPlayer, float amount, Weapon weapon, BodyPart bodypart)
{
OtherPlayer = otherPlayer;
Amount = amount;
Weapon = weapon;
BodyPart = bodypart;
}
开发者ID:Xalphox,项目名称:SampSharp,代码行数:14,代码来源:DamageEventArgs.cs
示例11: SelectPlayerObjectEventArgs
/// <summary>
/// Initializes a new instance of the <see cref="SelectPlayerObjectEventArgs" /> class.
/// </summary>
/// <param name="player">The player.</param>
/// <param name="object">The player object.</param>
/// <param name="modelid">The modelid.</param>
/// <param name="position">The position.</param>
public SelectPlayerObjectEventArgs(BasePlayer player, PlayerObject @object, int modelid, Vector3 position)
: base(position)
{
Player = player;
Object = @object;
ModelId = modelid;
}
开发者ID:Xalphox,项目名称:SampSharp,代码行数:14,代码来源:SelectGlobalObjectEventArgs.cs
示例12: Load_Player
public BasePlayer Load_Player(string user)
{
//Debug.Log(Get_Random_User());
user = user.ToLower().Replace(" ", string.Empty);
//GameManager.instance.player = new BasePlayer();
//GameManager.instance.player.Player_Spell_Book = new SpellBook();
//GameManager.instance.player.Player_Spell_Inventory = new SpellInventory();
//GameManager.instance.player.Player_Name = user;
BasePlayer player = new BasePlayer();
player.Player_Spell_Book = new SpellBook();
player.Player_Spell_Inventory = new SpellInventory();
player.Player_Name = user;
player.Players_Summon = Load_Player_Summon(user);
Load_Player_Spell_Inventory(user, ref player);
spell_book_db.Load("Assets/Scripts/Grimoire/Database/SpellBookDatabase.xml");
spell_book_root = spell_book_db.DocumentElement;
string path = "descendant::Book[@id='" + user + "']";
XmlNode book = spell_book_root.SelectSingleNode(path);
if (book == null)
{
return null;
}
//Debug.Log("Spell Book Elements: " + book.ChildNodes.Count);
foreach (XmlNode spell in book.ChildNodes)
{
Add_Spell(spell.InnerText, "spell_book", ref player);
}
return player;
}
开发者ID:Higure27,项目名称:Grimoire,代码行数:31,代码来源:GrimoireDatabase.cs
示例13: ApplyEffect
public void ApplyEffect(BasePlayer p)
{
switch (Type)
{
// More power
case PowerUpType.Power:
p.IncreasePower(1);
break;
// More bombs
case PowerUpType.Bomb:
p.IncreaseTotalBombNumber(1);
break;
// More speed
case PowerUpType.Speed:
p.IncreaseSpeed(GameConfiguration.BasePlayerSpeed * (GameConfiguration.PlayerSpeedIncrementeurPercentage/100));
break;
// Skeleton ! => Bad items
case PowerUpType.BadEffect:
int randomBadEffect = GameConfiguration.Random.Next(GameConfiguration.BadEffectList.Count);
p.ApplyBadItem(GameConfiguration.BadEffectList[randomBadEffect]);
break;
// More points
case PowerUpType.Score:
p.Stats.Score++;
break;
}
}
开发者ID:Noxalus,项目名称:Final-Bomber,代码行数:27,代码来源:BasePowerUp.cs
示例14: StackAllCommand
private void StackAllCommand(BasePlayer player, string command, string[] args)
{
if (!hasPermission(player, "canChangeStackSize"))
{
SendReply(player, "You don't have permission to use this command.");
return;
}
if (args.Length == 0)
{
SendReply(player, "Syntax Error: Requires 1 argument. Syntax Example: /stackall 65000");
return;
}
var itemList = ItemManager.itemList;
foreach (var item in itemList)
{
if (item.displayName.english.ToString() == "Salt Water" ||
item.displayName.english.ToString() == "Water") { continue; }
Config[item.displayName.english] = Convert.ToInt32(args[0]);
item.stackable = Convert.ToInt32(args[0]);
}
SaveConfig();
SendReply(player, "The Stack Size of all stackable items has been set to " + args[0]);
}
开发者ID:SteveKnowless,项目名称:Rust,代码行数:31,代码来源:StackSizeController.cs
示例15: spawnWall
private void spawnWall(BasePlayer player, string cmd, string[] args)
{
var pos = player.transform.position;
pos.z += 2;
var angles = new Quaternion();
var prefab = GameManager.server.CreatePrefab("assets/prefabs/building/wall.external.high.stone/wall.external.high.stone.prefab", pos, angles, true);
if (prefab == null)
{
this.SendReply(player, "Prefab is null");
return;
}
var block = prefab.GetComponent<BuildingBlock>();
if (block == null)
{
this.SendReply(player, "Building block is null");
return;
}
block.transform.position = pos;
block.transform.rotation = angles;
block.gameObject.SetActive(true);
block.blockDefinition = PrefabAttribute.server.Find<Construction>(block.prefabID);
block.Spawn(true);
block.health = block.MaxHealth();
block.SendNetworkUpdate();
}
开发者ID:nevadascout,项目名称:RustFactionsPublic,代码行数:30,代码来源:Radtowns.cs
示例16: Create_User
public void Create_User()
{
BasePlayer player = new BasePlayer();
GrimoireDatabase db = new GrimoireDatabase();
string user = character_name_field.GetComponentsInChildren<Text>()[1].text;
player.Player_Name = user;
user = user.Trim().ToLower().Replace(" ", string.Empty);
if(user == "")
{
warning_text.GetComponent<Text>().text = "Name Cannot Be Empty";
warning_text.SetActive(true);
return;
}
Debug.Log(user + " , word size: " + user.Length);
Debug.Log("User Exisist: " + db.User_Exists(user));
if(db.User_Exists(user))
{
warning_text.GetComponent<Text>().text = "User already exists";
warning_text.SetActive(true);
return;
}
player.Player_Spell_Book = starter_book;
Setup_Summon();
player.Players_Summon = starter_summon;
player.Player_Spell_Inventory = starter_inventory;
db.Save_Player(user, player);
GameManager.instance.player = player;
GameManager.instance.current_state = GameManager.GameStates.MAIN;
GameManager.instance.scene_loaded = false;
}
开发者ID:Higure27,项目名称:Grimoire,代码行数:34,代码来源:CreateNewUser.cs
示例17: UpdateBehavior
public virtual void UpdateBehavior(BasePlayer player)
{
if((mStopWhileFlickering && mEnemy.IsFlickering) || mEnemy.Hp <= 0)
{
return;
}
if(mResponseDelayTimer > 0)
{
mResponseDelayTimer -= Time.deltaTime;
return;
}
mAttackDelayTimer -= Time.deltaTime;
switch (mCurrentState)
{
case EnemyState.Idle:
HandleIdleState(player);
break;
case EnemyState.Chase:
HandleChaseState(player);
break;
case EnemyState.Attack:
HandleAttackState(player);
break;
case EnemyState.Flee:
HandleFleeState(player);
break;
case EnemyState.Boss:
HandleBossBehaviour(player);
break;
}
}
开发者ID:stregawolf,项目名称:VDayJam2016,代码行数:32,代码来源:EnemyController.cs
示例18: Start
void Start()
{
animator = GameObject.Find("Player").GetComponent<Animator>();
if (!animator)
{
Debug.LogError("Missing animator!");
}
basePlayer = GameObject.Find("Player").GetComponent<BasePlayer>();
if (!basePlayer)
{
Debug.LogError("Missing BasePlayer script!");
}
audioSource = GameObject.Find("Player").GetComponent<AudioSource>();
if (!audioSource)
{
Debug.LogError("Missing audio source!");
}
if (!cooldownIndicator)
{
Debug.LogError("Missing cooldown button!");
}
if (clip.Length == 0)
{
Debug.LogError("0 sounds for attacking!");
}
timer = 0f;
targets = new List<BaseNPC>();
attacking = false;
}
开发者ID:Morthalin,项目名称:TheGame,代码行数:34,代码来源:WhirlwindAttack.cs
示例19: Awake
void Awake()
{
input = serverinput.GetValue(GetComponent<BasePlayer>()) as InputState;
player = GetComponent<BasePlayer>();
enabled = true;
ispressed = false;
}
开发者ID:mpendel,项目名称:RUSTBOYS,代码行数:7,代码来源:Build.cs
示例20: GiveItem
public object GiveItem(BasePlayer player, string itemname, int amount, ItemContainer pref)
{
itemname = itemname.ToLower();
bool isBP = false;
if (itemname.EndsWith(" bp"))
{
isBP = true;
itemname = itemname.Substring(0, itemname.Length - 3);
}
if (displaynameToShortname.ContainsKey(itemname))
itemname = displaynameToShortname[itemname];
var definition = ItemManager.FindItemDefinition(itemname);
if (definition == null)
return string.Format("{0} {1}", "Item not found: ", itemname);
int giveamount = 0;
int stack = (int)definition.stackable;
if (isBP)
stack = 1;
if (stack < 1) stack = 1;
for (var i = amount; i > 0; i = i - stack)
{
if (i >= stack)
giveamount = stack;
else
giveamount = i;
if (giveamount < 1) return true;
player.inventory.GiveItem(ItemManager.CreateByItemID((int)definition.itemid, giveamount, isBP), pref);
}
return true;
}
开发者ID:bodyweightenergy,项目名称:TeamBattlefield,代码行数:31,代码来源:TeamBattlefield.cs
注:本文中的BasePlayer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论