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; }
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); }
protected virtual void Start() { References.Init(this); }
protected override void Start() { base.Start(); References.Init(this); }