本文整理汇总了C#中PlayerObject类的典型用法代码示例。如果您正苦于以下问题:C# PlayerObject类的具体用法?C# PlayerObject怎么用?C# PlayerObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerObject类属于命名空间,在下文中一共展示了PlayerObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attacked
// Player attacking trainer.
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = false)
{
if (attacker == null) return 0;
if (_currentAttacker != null && _currentAttacker != attacker)
{
OutputAverage();
ResetStats();
}
damage += attacker.AttackBonus;
_currentAttacker = attacker;
_hitCount++;
_totalDamage += damage;
_lastAttackTime = Envir.Time;
switch (type)
{
case DefenceType.ACAgility:
attacker.ReceiveChat(damage + " Physical Agility Damage inflicted on the trainer.", ChatType.Trainer);
break;
case DefenceType.AC:
attacker.ReceiveChat(damage + " Physical Damage inflicted on the trainer.", ChatType.Trainer);
break;
case DefenceType.MACAgility:
attacker.ReceiveChat(damage + " Magic Agility Damage inflicted on the trainer.", ChatType.Trainer);
break;
case DefenceType.MAC:
attacker.ReceiveChat(damage + " Magic Damage inflicted on the trainer.", ChatType.Trainer);
break;
case DefenceType.Agility:
attacker.ReceiveChat(damage + " Agility Damage inflicted on the trainer.", ChatType.Trainer);
break;
}
return 1;
}
示例2: GetTarget
public PlayerObject GetTarget(bool isRight)
{
var sortedList = new SortedList<float, PlayerObject>();
foreach (PlayerObject po in _targetList)
{
sortedList.Add(po._playerPrefab.transform.position.x, po);
}
float currentTargetX = _currentTarget._playerPrefab.transform.position.x;
foreach (var kpo in sortedList)
{
PlayerObject po = kpo.Value;
if (isRight)
{
if (currentTargetX < kpo.Key)
{
_currentTarget = po;
break;
}
}
else
{
if (currentTargetX >= kpo.Key)
{
_currentTarget = po;
break;
}
}
}
return _currentTarget;
}
示例3: 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;
}
示例4: Attacked
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
{
int currentMoveDistance = 0;
Point target = Functions.PointMove(CurrentLocation, attacker.Direction, _ballMoveDistance);
MirDirection dir = Functions.DirectionFromPoint(CurrentLocation, target);
while (currentMoveDistance < _ballMoveDistance)
{
Point location = Functions.PointMove(CurrentLocation, dir, 1);
if (location.X < 0 || location.Y < 0 || location.X >= CurrentMap.Width || location.Y >= CurrentMap.Height) break;
currentMoveDistance++;
if (!CurrentMap.GetCell(location).Valid)
{
dir = Functions.ReverseDirection(dir);
continue;
}
Walk(dir);
MoveTime = 0;
ActionTime = 0;
}
return 0;
}
示例5: procBonusStart
public void procBonusStart(PlayerObject player)
{
if(activeBonus != null)
{
activeBonus.start(player);
}
}
示例6: CheckSkillConditions
public bool CheckSkillConditions(PlayerObject origin, PlayerObject target)
{
// Check target
var targetType = TargetType.None;
Team teamOrigin = origin._playerPrefab.GetComponent<PlayerState>()._team;
Team teamTarget = target._playerPrefab.GetComponent<PlayerState>()._team;
if (origin == target)
{
targetType = TargetType.Myself;
return false;
} /*
else if ((teamOrigin == Team.Blue && teamTarget == Team.Blue) ||
(teamOrigin == Team.Red && teamTarget == Team.Red))
{
targetType = TargetType.Ally;
}
else
{
targetType = TargetType.Enemy;
}
if (_targetTypes.Find(t => t != null && t == targetType) == TargetType.None)
{
return false;
}
*/
// Check range
if (_range <= 0)
{
return true;
}
float distance = Vector3.Distance(origin._playerPrefab.position, target._playerPrefab.position);
Debug.Log("Distance: " + distance + "max range: " + _range);
if (distance > _range)
{
return false;
}
// Checks if the source is facing the target (Expensive)
if (_needToBeInFront)
{
Vector3 heading = origin._playerPrefab.transform.position - target._playerPrefab.transform.position;
float dot = Vector3.Dot(heading, origin._playerPrefab.transform.forward);
if (dot < 0.0f)
{
Debug.Log("in front");
}
else
{
Debug.Log("Not in front");
return false;
}
}
return true;
}
示例7: AddEffectsForPlayer
public void AddEffectsForPlayer(PlayerObject source, PlayerObject target, List<Effect> effect)
{
foreach (Effect e in effect)
{
DynamicEffect de = new DynamicEffect(e, source, target);
_effectDictionary[target].Add(de);
}
}
示例8: Attacked
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
{
CheckDirection();
if (!Conquest.WarIsOn || attacker.MyGuild != null && Conquest.Owner == attacker.MyGuild.Guildindex) damage = 0;
return base.Attacked(attacker, damage, type, damageWeapon);
}
示例9: EditPlayerObjectEventArgs
/// <summary>
/// Initializes a new instance of the <see cref="EditPlayerObjectEventArgs" /> class.
/// </summary>
/// <param name="player">The player.</param>
/// <param name="object">The global object.</param>
/// <param name="response">The response.</param>
/// <param name="position">The position.</param>
/// <param name="rotation">The rotation.</param>
public EditPlayerObjectEventArgs(GtaPlayer player, PlayerObject @object, EditObjectResponse response,
Vector3 position, Vector3 rotation)
: base(position)
{
Player = player;
Object = @object;
EditObjectResponse = response;
Rotation = rotation;
}
示例10: Attacked
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
{
if (ChildRock) ParentRock.FirstAttack = false;
if (!ChildRock && FirstAttack == true)
{
Die();
return 0;
}
return base.Attacked(attacker, damage, type, damageWeapon);
}
示例11: procBonusEnd
public void procBonusEnd(PlayerObject player)
{
if(activeBonus != null)
{
activeBonus.end(player);
if(activeBonus.isEnd())
activeBonus = null;
}
}
示例12: Start
void Start()
{
_parent = this.transform.parent.gameObject;
_parentPlayerObj = _parent.GetComponent<PlayerObject>();
_hp = this.transform.Find("Panel").Find("slider_hp").GetComponent<Slider>();
_time = this.transform.Find("Panel").Find("slider_time").GetComponent<Slider>();
_name = this.transform.Find("Panel").Find("txt_enemyname").GetComponent<Text>();
_icon = this.transform.Find("Panel").Find("img_icon").GetComponent<RawImage>();
if (_name != null) _name.text = _parent.name;
if (_time != null) _time.maxValue = _parentPlayerObj.waitTime;
}
示例13: RegisterPlayer
/// <summary>
/// Registers a player entity with this player mover.
/// </summary>
/// <param name="player">The player to register with this mover.</param>
public void RegisterPlayer(PlayerObject player)
{
if(OnRegisterPlayer(player))
{
m_registeredPlayers.Add(player);
if (player.Player.isLocal)
OnRegistered();
else
photonView.RPC(nameof(_rpcOnRegistered), player.Player);
}
}
示例14: Attacked
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
{
MirDirection newDirection = (MirDirection)(3 - GetDamageLevel());
if (newDirection != Direction)
{
Direction = newDirection;
Broadcast(new S.ObjectTurn { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
}
return base.Attacked(attacker, damage, type, damageWeapon);
}
示例15: Awake
void Awake()
{
// Setting up the references.
settings = GameObject.Find("System");
player = settings.GetComponent<SystemDB>().player;
playerObject = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerObject>();
playerMovement = GetComponent<PlayerMovement>();
lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<LastPlayerSighting>();
health=player.maxHP;
player.HP = health;
}