public void Start() { _model = GetComponent <PawnModelComponent>().PawnModel; _model.OnUnitKilled += () => { GameObject.Destroy(transform.gameObject); }; MyStart(); }
private void UpdateView() { if (_model == null) // todo more elegant solution { _model = GetComponent <PawnModelComponent>().PawnModel; } transform.localPosition = _model.Position.GetPosition(); transform.localEulerAngles = new Vector3(90, _model.Orientation.FlatRotation(), 0); }