Пример #1
0
        void Start()
        {
            lRb        = GetComponent <Rigidbody2D>();
            eDirection = Direction.Right;

            var shieldObj = Instantiate(shieldPrefab, transform.position + new Vector3(.6f, .1f), Quaternion.identity, transform);

            eShield = shieldObj.GetComponent <Shield>();

            lNetworkAttacks = new List <NetworkAttack>();

            lHooks     = new HookCollection();
            eModifiers = new ModifierCollection(lHooks);
            // GameController will remove these when the game starts.
            eModifiers.CantAttack.Add();
            eModifiers.CantMove.Add();
            StandardHooks.Install(lHooks, eModifiers);
            lJumpForceHook = new StandardJumpForce();
            lJumpForceHook.Install(lHooks);
            pModifiersDebugField = new ModifiersDebugField(eModifiers, "P" + eId + ": ");

            if (pInputManager != null)
            {
                Initialize();
                lInitialized = true;
            }
        }
Пример #2
0
 public void SetJumpBehaviour(JumpForceHook hook)
 {
     lJumpForceHook.Remove(lHooks);
     hook.Install(lHooks);
     lJumpForceHook = hook;
 }