Пример #1
0
        public virtual void Init(Observer observer)
        {
            Manager.Add(this);

            this.Observer = observer;
            observer.Data.UpdateHealth(Health);

            rigidbody = GetComponent <Rigidbody>();

            Variants = Dependancy.Get <PlayerVariants>(gameObject);

            Movement = Dependancy.Get <PlayerMovement>(gameObject);
            Body     = Dependancy.Get <PlayerBody>(gameObject);
            Aim      = Dependancy.Get <PlayerAim>(gameObject);
            Weapons  = Dependancy.Get <PlayerWeapons>(gameObject);
            Score    = Dependancy.Get <PlayerScore>(gameObject);

            References.Init(this);

            Variants.Init(this);

            Ragdoll = Dependancy.Get <RagdollController>(gameObject);
            Ragdoll.Disable();

            Health.OnValueChanged += OnHealthChanged;
        }
Пример #2
0
        public virtual void Init(Client client)
        {
            this.Client = client;

            Input = GetComponent <ObserverInput>();

            Data = GetComponent <ObserverData>();

            Manager.Add(this);

            References.Init(this);

            Level.Players.Spawn(this);
        }
Пример #3
0
 protected virtual void Start()
 {
     References.Init(this);
 }
Пример #4
0
        protected override void Start()
        {
            base.Start();

            References.Init(this);
        }