// Start is called before the first frame update public virtual void Start() { if (Movement == null) { Movement = ScriptableObject.CreateInstance <DummyMovement>(); } }
public void setTarget(MovementBase c, Vector3 offset, float tolerance = 1f) { // Debug.Log ("Setting target to: offset: " + offset + " t: " + tolerance); m_minDistance = tolerance; m_targetOffset = new Vector3(offset.x, offset.y, 0f); CurrentTarget = c; }
public void Init(MovementBase _movement, AbilityBase _ability, AttackBase _attack, DeathBase _death, HitBase _hit) { _anim = GetComponent <Animator>(); if (_movement != null) { _movement.OnMovement += HandleMovement; } if (_ability != null) { _ability.OnAbility += HandleAbility; } if (_attack != null) { _attack.OnAttack += HandleAttack; } if (_death != null) { _death.OnDeath += HandleDeath; } if (_hit != null) { _hit.OnHit += HandleHit; } }
// Use this for initialization void Start() { Init(); aggression = baseAggression; m_movement = MasterAI.GetComponent <MovementBase>(); m_charBase = MasterAI.GetComponent <CharacterBase>(); }
public void FreezeCharacter(MovementBase bm, bool isFrozen = true) { if (!FrozenCharacters.ContainsKey(bm)) { FrozenCharacters.Add(bm, bm.IsPlayerControl); } bm.GetComponent <CharacterBase>().SetAutonomy(!isFrozen); }
// le choix de mode à utiliser n'est pas la responsabilité de cette classe // " la species est le pilote, cette classe est la voiture " public MovementBase ChangeMode(string mode) { if (knownMode.ContainsKey(mode)) { currentMode = knownMode[mode]; // s'il ne contient pas mode, la ligne n'est pas exécutée } return(currentMode); }
// Use this for initialization void Start() { if (movementCam == null) { GameObject go = GameObject.FindGameObjectWithTag("Main Camera"); movementCam = go.GetComponent <Camera>(); } movement = GetComponent <MovementBase>(); }
public override void UpdateIntput(UnitBase unit, MovementBase Movement) { Movement.SetMovementVector(InputExt.KeyBoardAnalrog); if (InputExt.OnePressed(Keys.Space)) { if (unit.Status.Attackevt != null) { unit.Status.Attackevt(unit); } } }
public Movement(Rigidbody rigidbody, Vector3 dir, float maxvitesse, float maxaccel) { direction = dir; speed = 0; acceleration = 0; maxSpeed = maxvitesse; stepAcceleration = maxaccel; _rb = rigidbody; knownMode = new Dictionary <string, MovementBase>(); currentMode = null; }
protected MovementViewModelBase(MovementBase movement) { Name = movement.Info; Source = movement.Source; SourceShelf = movement.SourceCompartment; Target = movement.Target; TargetShelf = movement.TargetCompartment; Quantity = movement.Quantity; Timestamp = movement.Timestamp.ToLocalTime(); Ticket = movement.Ticket; SetBarcode(movement.Data); }
// Use this for initialization void Start() { movementBase = GetComponent <MovementBase>(); abilitybase = GetComponent <AbilityBase>(); attackbase = GetComponent <AttackBase>(); deathbase = GetComponent <DeathBase>(); //hitbase = FindObjectOfType<HitBase>(); animCtrl = GetComponent <AnimationController>(); if (animCtrl != null) { animCtrl.Init(movementBase, abilitybase, attackbase, deathbase, this); } }
// Pickup / Drop events protected virtual void OnHeldChanged(T t, bool setEnabled) { MovementBase mb = t.gameObject.GetComponent <MovementBase>(); if (mb != null) { mb.enabled = setEnabled; } foreach (MovementCollider mc in t.gameObject.GetComponents <MovementCollider>()) { mc.enabled = setEnabled; } }
public Ape(Data data, UnitInputBase input, MovementBase Movement) : base(data, input, Movement) { Stat.SetHp(150, 1.2f); Stat.SetMental(75, 1.1f); Stat.SetAttack(10.5f, 1.1f); Skin.AddAnimation("Base", @"Unit\base2", 2, 2, 4, 12, 0, 0, 16, 26); Skin.SkinChanger(new SideWalkChange()); Status.AddDeathAction((UnitBase units) => { Data.Screen.Unit.Player.Stat.Exp.Amount(1); data.Screen.Items.DropItem.AddItem(units, 1, MathExt.Random(1, 4)); data.Screen.Items.DropItem.AddItem(units, 0, MathExt.Random(1, 4)); }); SetUnitType(UnitType.Enemy); AddCollision(data.Screen.World, 0.6f, 4); }
void Start() { spacing = baseSpacing; //reactionSpeed = baseReactionSpeed; //decisionMaking = baseDecisionMaking; aggression = baseAggression; allAttacks = new List <ActionInfo>(); foreach (ActionInfo ai in GetComponents <ActionInfo> ()) { if (ai.name != "sheath" && ai.name != "unsheath") { allAttacks.Add(ai); } } m_charBase = GetComponent <CharacterBase> (); m_movement = GetComponent <MovementBase> (); m_nextDetermination = Random.Range(0f, DETERMINATION_INTERVAL); }
public void Init(MovementBase _walk) { _anim = GetComponent <Animator>(); if (_walk != null) { _walk.OnWalk += HandleWalk; } if (_walk != null) { _walk.OnIdle += HandleIdle; } if (_walk != null) { _walk.OnJump += HandleJump; } if (_walk != null) { _walk.OnDeath += HandleDeath; } }
public void Setup() { isAlive = true; movement = instance.GetComponent <MovementBase>(); gunRotation = instance.transform.Find("Body").transform.Find("GunRotation"); gunPoint = gunRotation.transform.Find("GunPoint"); movement.playerNumber = playerNumber; movement.gunPoint = gunPoint; movement.isAlive = true; if (playerHeightMultiplier == null) { SetInitialPlayerHeights(); } SetPlayerHeight(); instance.SetColor(playerColor); }
public override void Reset() { mover = null; }
private void Awake() { movementBehaviour = GetComponent <MovementBase>(); shootingBehaviour = GetComponent <ShootingBase>(); }
protected virtual void Awake() { mb = GetComponent <MovementBase>(); sb = GetComponent <ShootingBase>(); }
void Awake() { m_charBase = GetComponent <MovementBase>(); m_orient = GetComponent <Orientation>(); }
void Start() { movement = GetComponent <MovementBase>(); collisions = GetComponent <Collision>(); rigidBod = GetComponent <Rigidbody2D>(); }
public override void UpdateIntput(UnitBase unit, MovementBase Movement) { Movement.SetMovementVector(MathExt.DirectionFacing(MathExt.Angle(unit.Position, unit.Data.Screen.Unit.Player.Position)) * 0.5f); }
// Use this for initialization void Start() { agent = GetComponent <NavMeshAgent>(); movement = GetComponent <MovementBase>(); }
public override void UpdateIntput(UnitBase unit, MovementBase Movement) { }
/// <summary> /// Initializes a new instance of the <see cref="MoveNode"/> class. /// </summary> /// <param name="strategy">The strategy.</param> public MoveNode(MovementBase strategy) { this.strategy = strategy; }
// Use this for initialization void Start() { movement = GetComponent <MovementBase>(); }
public void setTarget(MovementBase c) { setTarget(c, new Vector3(), 1f); }