Esempio n. 1
0
    void Start()
    {
        EventTire = this.GetEventTire();

        KeyMap.Add(KeyCode.D, ControlAction.WalkForward);
        KeyMap.Add(KeyCode.A, ControlAction.WalkBack);
        KeyMap.Add(KeyCode.Space, ControlAction.Jump);
        KeyMap.Add(KeyCode.LeftShift, ControlAction.Shift);
        KeyMap.Add(KeyCode.RightShift, ControlAction.Shift);
        KeyMap.Add(KeyCode.E, ControlAction.Use);
        KeyMap.Add(KeyCode.W, ControlAction.WalkUp);
        KeyMap.Add(KeyCode.S, ControlAction.WalkDown);
        KeyMap.Add(KeyCode.R, ControlAction.Recharge);
        KeyMap.Add(KeyCode.LeftControl, ControlAction.SitDown);
        KeyMap.Add(KeyCode.RightControl, ControlAction.SitDown);

        KeyMap.Add(KeyCode.Mouse0, ControlAction.MainAttack);

        foreach (var pair in KeyMap)
        {
            State[pair.Value] = false;
        }

        State[ControlAction.NextWeapon] = false;
        State[ControlAction.PrevWeapon] = false;

        EventTire.SendEvent(TEPath.Up, TireEventType.ControlEvent, State);
    }
 void Start()
 {
     EventTire = this.GetEventTire();
     BaseMoveState = GetComponent<BaseMoveState>();
     EventTire.AddEventListener(TireEventType.ChangedMoveStateEvent, OnChangedMoveStateEvent);
     EventTire.AddEventListener(TireEventType.ChangedDirectionEvent, OnChangedDirectionEvent);
 }
 void Start ()
 {
     EventTire = this.GetEventTire();
     Animator = GetComponent<Animator>();
     EventTire.AddEventListener(TireEventType.ChangedCurrentWeapon, OnPlayerChangedCurrentWeapon);
     //EventTire.AddEventListener(TireEventType.WeaponUseStateChangedEvent, OnWeaponUseStateChangedEvent);
 }
 void Start()
 {
     EventTire = this.GetEventTire();
     EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
     EventTire.AddEventListener(TireEventType.AmmoPickupEvent, OnAmmoPickupEvent);
     WeaponaryState = GetComponent<WeaponaryState>();
 }
 void Start()
 {
     EventTire = this.GetEventTire();
     Animator = GetComponent<Animator>();
     EventTire.AddEventListener(TireEventType.ChangedMoveStateEvent, OnPlayerChangedMoveStateEvent);
     EventTire.AddEventListener(TireEventType.ChangedJumpStateEvent, OnPlayerChangedJumpStateEvent);
 }
    void Start()
    {
        EventTire = this.GetEventTire();
        BaseState = GetComponent<BaseMoveState>();
        UpperCollider.enabled = true;

        EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
        EventTire.AddEventListener(TireEventType.ChangedSitDownEvent, OnChangedSitDownEvent);
    }
    void Start()
    {
        EventTire = this.GetEventTire();
        BaseState = GetComponent<BaseMoveState>();
        Rigidbody = GetComponent<Rigidbody2D>();

        Rigidbody.gravityScale = 1f;
        EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
        EventTire.AddEventListener(TireEventType.ChangedMoveStateEvent, UpdateHorizontalMoveState);
        EventTire.AddEventListener(TireEventType.ChangedShiftWalkEvent, UpdateHorizontalMoveState);
        EventTire.AddEventListener(TireEventType.ChangedJumpStateEvent, OnPlayerChangedJumpStateEvent);
    }
    void Start()
    {
        EventTire = this.GetEventTire();
        EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
        EventTire.AddEventListener(TireEventType.SaveWeaponStateEvent, OnSaveWeaponStateEvent);
        EventTire.AddEventListener(TireEventType.LoadWeaponStateEvent, OnLoadWeaponStateEvent);
        EventTire.AddEventListener(TireEventType.WeaponPickupEvent, OnWeaponPickupEvent);

        WeaponaryState = GetComponent<WeaponaryState>();
        if (WeaponaryState.CurrentWeaponIndex >= 0)
        {
            SelectWeapon(WeaponaryState.CurrentWeaponIndex);
        }
    }
    void Start()
    {
        EventTire = this.GetEventTire();
        Rigidbody = GetComponent<Rigidbody2D>();
        BaseState = GetComponent<BaseMoveState>();
        BaseState.VerticalMoveState = VerticalMoveState.Idle;
        BaseState.MoveState = MoveState.Idle;

        EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
        EventTire.AddEventListener(TireEventType.ChangedMoveStateEvent, UpdateHorizontalMoveState);
        EventTire.AddEventListener(TireEventType.ChangedVerticalMoveStateEvent, UpdateVerticalMoveState);
        EventTire.AddEventListener(TireEventType.ChangedJumpStateEvent, OnPlayerChangedJumpStateEvent);
        Rigidbody.gravityScale = 0f;
    }
Esempio n. 10
0
    void Start()
    {
        EnemyAiState = GetComponent<EnemyAiState>();
        EventTire = this.GetEventTire();
        SelfUnit = GetComponent<IUnit>();

        Actions.Add(ControlAction.WalkForward, false);
        Actions.Add(ControlAction.WalkBack, false);
        Actions.Add(ControlAction.Jump, false);
        Actions.Add(ControlAction.Shift, false);
        Actions.Add(ControlAction.MainAttack, false);
        Actions.Add(ControlAction.Use, false);
        Actions.Add(ControlAction.WalkUp, false);
        Actions.Add(ControlAction.WalkDown, false);
        Actions.Add(ControlAction.Recharge, false);
        Actions.Add(ControlAction.NextWeapon, false);
        Actions.Add(ControlAction.PrevWeapon, false);
        Actions.Add(ControlAction.SitDown, false);
    }
Esempio n. 11
0
    void ConnectToParentTire()
    {
        Transform parent = transform.parent;
        while(parent != null)
        {
            var parentTire = parent.GetComponent<IETireHierarchy>();
            if(parentTire != null)
            {
                parentTire.AddChild(this);
                Parent = parentTire;
                return;
            }
            else
            {
                parent = parent.parent;
            }
        }

        Parent = GlobalEventTire.Instance;
    }
 void Start()
 {
     State = GetComponent<WeaponState>();
     EventTire = this.GetEventTire();
     EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
 }
Esempio n. 13
0
 void Start()
 {
     EventTire = this.GetEventTire();
 }
 void Start()
 {
     EventTire = this.GetEventTire();
     EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
 }
 void Start()
 {
     EventTire = this.GetEventTire();
     BaseMoveState = GetComponent<BaseMoveState>();
     EventTire.AddEventListener(TireEventType.ControlEvent, OnControlEvent);
 }
Esempio n. 16
0
    public void AddChild(IEventTire child)
    {
        Children.Add(child);

    }
 void Start()
 {
     WeaponState = GetComponent<WeaponState>();
     EventTire = this.GetEventTire();
     LoadWeaponState();
 }
Esempio n. 18
0
 void Start()
 {
     EventTire = this.GetEventTire();
     OwnedWeapons.Add(WeaponType.None);
     OwnedWeapons.Add(WeaponType.None);
     OwnedWeapons.Add(WeaponType.None);
     OwnedWeapons.Add(WeaponType.None);
     OwnedWeapons.Add(WeaponType.None);
 }