コード例 #1
0
 // Start is called before the first frame update
 public virtual void Start()
 {
     if (Movement == null)
     {
         Movement = ScriptableObject.CreateInstance <DummyMovement>();
     }
 }
コード例 #2
0
 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;
 }
コード例 #3
0
    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;
        }
    }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     Init();
     aggression = baseAggression;
     m_movement = MasterAI.GetComponent <MovementBase>();
     m_charBase = MasterAI.GetComponent <CharacterBase>();
 }
コード例 #5
0
ファイル: Textbox.cs プロジェクト: DrDoak/TourismGame
 public void FreezeCharacter(MovementBase bm, bool isFrozen = true)
 {
     if (!FrozenCharacters.ContainsKey(bm))
     {
         FrozenCharacters.Add(bm, bm.IsPlayerControl);
     }
     bm.GetComponent <CharacterBase>().SetAutonomy(!isFrozen);
 }
コード例 #6
0
ファイル: Movement.cs プロジェクト: Thyvong/Chimera-Ants
 // 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);
 }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     if (movementCam == null)
     {
         GameObject go = GameObject.FindGameObjectWithTag("Main Camera");
         movementCam = go.GetComponent <Camera>();
     }
     movement = GetComponent <MovementBase>();
 }
コード例 #8
0
        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);
                }
            }
        }
コード例 #9
0
ファイル: Movement.cs プロジェクト: Thyvong/Chimera-Ants
    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;
    }
コード例 #10
0
 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);
 }
コード例 #11
0
 // 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);
     }
 }
コード例 #12
0
    // 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;
        }
    }
コード例 #13
0
ファイル: Ape.cs プロジェクト: yadiate/MoonLightCraft
        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);
        }
コード例 #14
0
 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);
 }
コード例 #15
0
    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;
        }
    }
コード例 #16
0
    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);
    }
コード例 #17
0
 public override void Reset()
 {
     mover = null;
 }
コード例 #18
0
 private void Awake()
 {
     movementBehaviour = GetComponent <MovementBase>();
     shootingBehaviour = GetComponent <ShootingBase>();
 }
コード例 #19
0
 protected virtual void Awake()
 {
     mb = GetComponent <MovementBase>();
     sb = GetComponent <ShootingBase>();
 }
コード例 #20
0
ファイル: HitboxMaker.cs プロジェクト: sdasd30/TSSG
 void Awake()
 {
     m_charBase = GetComponent <MovementBase>();
     m_orient   = GetComponent <Orientation>();
 }
コード例 #21
0
ファイル: MonsterBehaviour.cs プロジェクト: Ekkara/Eye-of-God
 void Start()
 {
     movement   = GetComponent <MovementBase>();
     collisions = GetComponent <Collision>();
     rigidBod   = GetComponent <Rigidbody2D>();
 }
コード例 #22
0
 public override void UpdateIntput(UnitBase unit, MovementBase Movement)
 {
     Movement.SetMovementVector(MathExt.DirectionFacing(MathExt.Angle(unit.Position, unit.Data.Screen.Unit.Player.Position)) * 0.5f);
 }
コード例 #23
0
 // Use this for initialization
 void Start()
 {
     agent    = GetComponent <NavMeshAgent>();
     movement = GetComponent <MovementBase>();
 }
コード例 #24
0
 public override void UpdateIntput(UnitBase unit, MovementBase Movement)
 {
 }
コード例 #25
0
 /// <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;
 }
コード例 #26
0
 // Use this for initialization
 void Start()
 {
     movement = GetComponent <MovementBase>();
 }
コード例 #27
0
 public void setTarget(MovementBase c)
 {
     setTarget(c, new Vector3(), 1f);
 }