private void SpawnObject() { GameObject gameObject = GameObject.Instantiate(spawnObject, parryPosition, Quaternion.identity); Directable directable = gameObject.GetComponent <Directable>(); if (directable != null) { directable.DirectToward(GetInputDirection()); } hasSpawnedObject = true; }
void Start() { directableComp = GetComponent <Directable> (); rangeTransform = new GameObject("Range Transform").transform; rangeTransform.SetParent(transform); rangeTransform.localPosition = new Vector3(0, -fireRange, 0); fireTransform = new GameObject("Fire Transform").transform; fireTransform.SetParent(transform); fireTransform.localPosition = new Vector3(0, -1, 0); EnableFire(); }
public void OnHit(Directable other) { animator.SetBool("IsBouncing", true); Vector2 otherDirection = other.GetDirection(); Vector2 newDirection; if (mirrorType == MirrorType.HORIZONTAL) { // flip the x direction newDirection = new Vector2(otherDirection.x * -1, otherDirection.y); } else { // flip the y direction newDirection = new Vector2(otherDirection.x, otherDirection.y * -1); } other.DirectToward(newDirection); }
void Awake() { directable = GetComponent <Directable>(); }
void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); directable = GetComponent <Directable>(); }
public void setRow(Directable directable) { Row = directable; }
public void setDown(Directable directable) { Down = directable; }
public void setRight(Directable directable) { Right = directable; }
public void setLeft(Directable directable) { Left = directable; }
void Start() { directable = GetComponent <Directable>(); currentPoint = pointA; }