private void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); objectShadow = GetComponentInChildren <ObjectShadow>(); SetLayerAndTag(); SetMyParentPool(); }
public void RenderShadow(bool isPlayer) { // Shadow Vector3[] points = new Vector3[4]; float y = -Wheels[0].Size / 2 + 0.4f; float xoffset = 0.1f; points[0] = Wheels[0].GetOffsetPosition(new Vector3(-xoffset, y, -2)); points[1] = Wheels[1].GetOffsetPosition(new Vector3(xoffset, y, -2)); points[2] = Wheels[2].GetOffsetPosition(new Vector3(-xoffset, y, 3.5f)); points[3] = Wheels[3].GetOffsetPosition(new Vector3(xoffset, y, 3.5f)); if (!_isOnGround) { points[0].Y = _currentHeightOfTrack; points[1].Y = _currentHeightOfTrack; points[2].Y = _currentHeightOfTrack; points[3].Y = _currentHeightOfTrack; } ObjectShadow.Render(points, isPlayer); }
public void Awake() { boxCollider = GetComponent <BoxCollider2D>(); animator = GetComponent <Animator>(); spriteRenderer = GetComponent <SpriteRenderer>(); objectShadow = GetComponentInChildren <ObjectShadow>(); SetLayerOrder(); articleType = ArticleType.Table; if (animator != null) { animator.speed = 0f; } //#if UNITY_EDITOR //#else // this.transform.localPosition = Vector3.zero; //#endif hp = 15; }