private void Awake() { this._myScale = this.elementsContainer.gameObject.GetComponent <ScaleConstraint>(); var tempRect = this.SingleRoomPrefab.gameObject.GetComponent <RectTransform>(); this._imgX = tempRect.rect.width + this.imgOffset.x; this._imgY = tempRect.rect.height + this.imgOffset.y; // this._myImgPref = this.SingleRoomPrefab.gameObject.GetComponent<RectTransform>(); // this._myImgPref.gameObject.SetActive(true); // this._imgX = this._myImgPref.rect.width + this.imgOffset.x; // this._imgY = this._myImgPref.rect.height + this.imgOffset.y; //ChangeMapSize(2f); //TODO: }
private void Awake() { patrol = transform.parent.GetComponent <SimplePatrol>(); ddol = GameObject.Find("Manager").GetComponent <DDOL>(); player = GameObject.Find("Player"); rb2D = transform.parent.gameObject; rb = rb2D.GetComponent <Rigidbody2D>(); playerHp = player.GetComponent <HPmanager>(); source = GetComponent <AudioSource>(); enemy = GetComponent <GameObject>(); anim = GetComponent <Animator>(); constraints = GetComponent <ScaleConstraint>(); foreach (GameObject obj in ddol._ddolObjects) { if (obj.name == rb2D.name) { Debug.Log("ovo"); Destroy(rb2D); } } }
public static Tween TweenWeight(this ScaleConstraint constraint, float to, float duration) => Tweening.To(getter: () => constraint.weight, setter: weight => constraint.weight = weight, to, duration).SetTarget(constraint);
public static Tween TweenScaleOffset(this ScaleConstraint constraint, Vector3 to, float duration) => Tweening.To(getter: () => constraint.scaleOffset, setter: scaleOffset => constraint.scaleOffset = scaleOffset, to, duration).SetTarget(constraint);