// Use this for initialization void Start() { Oka_form[0] = this.transform.GetChild(0).gameObject; Oka_form[1] = this.transform.GetChild(1).gameObject; Oka_form[2] = this.transform.GetChild(2).gameObject; playerControl = GetComponent <PlayerControl>(); wheelTrans = transform.Find("WheelCanvas").GetComponent <RectTransform>(); playerWheel = wheelTrans.GetComponent <PlayerWheel>(); }
private void Start() { if (Instance == null) { instance = this; Instance = this; } else { Destroy(this); } parent = transform.parent.gameObject; rectTransform = GetComponent <RectTransform>(); parentRectTransform = parent.GetComponent <RectTransform>(); distanceFromCenter = Vector3.Distance(rectTransform.position, parentRectTransform.position); initialDirection = rectTransform.position - parentRectTransform.position; initialDirection.Normalize(); }