private void UpdateHole(StageObject obj) { UpdateStageObject(obj); bool touch = obj.Direction == 1 ? obj.rightEdge >= rightSide.position.x : obj.leftEdge <= leftSide.position.x; bool outFrame = obj.Direction == 1 ? obj.leftEdge >= rightSide.position.x : obj.rightEdge <= leftSide.position.x; if (!obj.PartiallyOut && touch) { obj.PartiallyOut = true; int nextLane = obj.LaneIndex + (obj.Direction == 1 ? -1 : 1); nextLane = nextLane >= 0 ? (nextLane % lanes.Length) : (lanes.Length - 1); float offset = (obj.Direction == 1 ? obj.leftEdge - obj.centerX : obj.rightEdge - obj.centerX); Transform side = (obj.Direction == 1 ? leftSide : rightSide); SpawnMirrorHole(nextLane, offset, obj.Direction, side); } else if (obj.PartiallyOut && outFrame) { obj.MarkedForRemoval = true; curHoleNumber--; obj.GetComponent <PoolObject>().Deactivate(); } }
void Start() { iDoor = gameManagee.GetComponent <StageObject>().GetDoorByColor(color).GetComponent <Door>(); cnt = 0; }
// Use this for initialization void Start() { Touch = IsOpen = false; door = gameManagee.GetComponent <StageObject>().GetDoorByColor(color).GetComponent <Door>(); }